From 26fb0b3e76f52212a2cef49a0bc0b94e7425880c Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 29 七月 2024 10:55:10 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 wechat_jiaxuan/pages/productVideo/index.js |   28 +++++++++++++++++++++++-----
 1 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/wechat_jiaxuan/pages/productVideo/index.js b/wechat_jiaxuan/pages/productVideo/index.js
index 4db093b..3915e21 100644
--- a/wechat_jiaxuan/pages/productVideo/index.js
+++ b/wechat_jiaxuan/pages/productVideo/index.js
@@ -5,11 +5,13 @@
    * 椤甸潰鐨勫垵濮嬫暟鎹�
    */
   data: {
+    videoContext:null,
     category: [],
     tagCodes: '',
     videoUrl: '',
     showVideo: false,
-
+    isShow:false,
+    curVideoSrc:'',
     dataList: [],
     total: 0,
     pageSize: 10,
@@ -48,10 +50,12 @@
     })
   },
   itemClick(e) {
-    const { videourl } = e.currentTarget.dataset
-    wx.previewMedia({
-      sources: [{ url: videourl, type: 'video' }]
-    })
+    const { videourl } = e.currentTarget.dataset 
+    this.startPlayVideo(videourl)
+
+    // wx.previewMedia({
+    //   sources: [{ url: videourl, type: 'video' }]
+    // })
   },
   cateClick(e) {
     const { code } = e.target.dataset
@@ -66,6 +70,7 @@
   onLoad(options) {
     this.getTagList()
     this.getList()
+    this.videoContext = wx.createVideoContext('myVideo')
   },
 
   /**
@@ -107,5 +112,18 @@
    */
   onShareAppMessage() {
 
+  },
+  startPlayVideo(videourl){
+    this.setData({isShow:true, curVideoSrc:videourl})
+    console.log(videourl) 
+    this.videoContext.requestFullScreen({
+      // direction: 0  
+    });  
+  },
+  onClose(){
+    this.setData({isShow:false}) 
+    if(this.videoContext){
+      this.videoContext.exitFullScreen() 
+    }
   }
 })
\ No newline at end of file

--
Gitblit v1.9.3