From 8dc4e50769a7ebc5f0a3d766f61aa08b8f23b772 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期五, 06 九月 2024 11:23:21 +0800
Subject: [PATCH] login

---
 packageDomain/pages/resourceDetails/myVideo/index.js |   66 ++++++++++++++++++++++++++++-----
 1 files changed, 56 insertions(+), 10 deletions(-)

diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js
index a0ce5b1..7b64637 100644
--- a/packageDomain/pages/resourceDetails/myVideo/index.js
+++ b/packageDomain/pages/resourceDetails/myVideo/index.js
@@ -25,6 +25,7 @@
     productLinkPath: '',
     threeLeveData: [],
     showData: '',
+    showDataVod: '',
     src: '',
     selectedId: null,
     topicId: '',
@@ -44,7 +45,8 @@
     videoError: false,
     videoLoading: false,
     progress: 0,
-    playerList: []
+    playerList: [],
+    videoLoaidng: true
   },
   // 鏍煎紡鍖栫瑪璁版椂闂�
   convertTimestamp(timestamp) {
@@ -86,8 +88,14 @@
         parentName: options.parentName,
       })
     }
+    const token = wx.getStorageSync(app.config.tokenKey)
+    if (!token) {
+      loginInfo(app, (data) => {
+        if (data) {} else {}
+      })
+    }
     this.resourceDetailsData()
-    this.getNoteList()
+
   },
 
   /**
@@ -173,12 +181,13 @@
 
   },
   onTabsChange(event) {
-
+    console.log(event, 234)
+    let tabValue = event.detail.value
+    if (tabValue == '1') {
+      this.getNoteList()
+    }
   },
 
-  onTabsClick(event) {
-
-  },
   handleChange(e) {
     this.setData({
       activeValues: e.detail.value,
@@ -207,7 +216,8 @@
   },
   resourceDetailsData() {
     this.setData({
-      videoLoaidng: true
+      videoLoaidng: true,
+      loading: true
     })
     let query = {
       storeInfo: this.data.storeInfo,
@@ -238,6 +248,9 @@
       res.datas.cmsDatas[0].datas.forEach((item) => {
         if (item.selectType === "video" || item.learnSelectType === "video") {
           this.data.threeLeveData.push(item)
+          this.setData({
+            threeLeveData: this.data.threeLeveData
+          })
         }
       })
       this.data.threeLeveData.forEach((items, index) => { // 淇敼姝ゅ娣诲姞index鍙傛暟
@@ -249,11 +262,14 @@
               showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey),
               titleName: items.name
             })
+            this.aliVod(file, this.data.showData)
+
           } else {
             this.setData({
               showData: items.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.freeFile,
               titleName: items.name
             })
+            this.aliVod(items.file, this.data.showData)
           }
           let selectedIndex = index; // 瀛樺偍閫変腑椤圭殑绱㈠紩
           this.setData({
@@ -284,15 +300,44 @@
         this.setData({
           showData: app.config.requestCtx + '/file/api/ApiDownloadForAuthorize?md5=' + file + '&token=' + wx.getStorageSync(app.config.tokenKey)
         })
+        this.aliVod(file, this.data.showData)
       } else {
         this.setData({
           showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
         })
+        this.aliVod(item.file, this.data.showData)
       }
     }
   },
 
+  aliVod(md5, currentVideo) {
+    let query = {
+      md5: md5,
+      appRefCode: app.config.appRefCode
+    }
+    app.MG.file.getAliVod(query).then((res) => {
+      if (res) {
+        if (res && res.data == '') {
+          this.setData({
+            showDataVod: currentVideo,
+          })
+        } else {
+          this.setData({
+            showDataVod: res,
+          })
+        }
+      } else if (currentVideo) {
+        this.setData({
+          showDataVod: currentVideo,
+        })
+      } else {
+        return ElMessage.error('鏃犳硶鑾峰彇瑙嗛璧勬簮')
+      }
+    })
+  },
+
   timeUpdate(e) {
+    console.log(2);
     let {
       currentTime,
       duration
@@ -409,9 +454,9 @@
   },
   // 鑾峰彇绗旇鍒楄〃
   async getNoteList() {
-    // this.setData({
-    //   loading: true
-    // })
+    this.setData({
+      loading: true
+    })
     let topicId
     await app.MG.ugc
       .getProductUserSubmitTopic({
@@ -592,6 +637,7 @@
     });
   },
   loadedmetadata(e) {
+    console.log(1);
     this.setData({
       videoLoaidng: false
     })

--
Gitblit v1.9.1