From c2cd778fd3f40a75df483758bb2f1fe1dedc7eef Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期五, 26 四月 2024 09:49:25 +0800
Subject: [PATCH] 资源购买页请求慢优化

---
 packageDomain/pages/resourceDetails/myVideo/index.js |   39 +++++++++++++++++++++++++--------------
 1 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/packageDomain/pages/resourceDetails/myVideo/index.js b/packageDomain/pages/resourceDetails/myVideo/index.js
index 695ebd3..63118dd 100644
--- a/packageDomain/pages/resourceDetails/myVideo/index.js
+++ b/packageDomain/pages/resourceDetails/myVideo/index.js
@@ -10,7 +10,7 @@
     noteList: [],
     navBarHeight: '',
     barHeight: '',
-    flag: false, // 杈撳叆妗嗘槸鍚︽樉绀�
+    flag: true, // 杈撳叆妗嗘槸鍚︽樉绀�
     tabPanelstyle: 'display:flex;justify-content:center;align-items:center;',
     activeValues: [0],
     dialogKey: false,
@@ -34,13 +34,13 @@
     style: 'height: 248rpx',
     submitType: "new", //  鏂板缓 or 缂栬緫
     noteId: '',
-
     videoChange: true,
     startTime: "", //杩涘叆椤甸潰褰撳墠鏃堕棿
     pauseTime: 0, //鏆傚仠鏃堕棿
     formPath: '',
     loading: true,
-    hidden: true
+    hidden: true,
+    videoError: false
   },
   // 鏍煎紡鍖栫瑪璁版椂闂�
   convertTimestamp(timestamp) {
@@ -59,6 +59,9 @@
    */
   onLoad(options) {
 
+    wx.setNavigationBarTitle({
+      title: '璧勬簮璇︽儏-瑙嗛'
+    });
     const systInfo = wx.getSystemInfoSync();
     const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅
     const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴�
@@ -70,12 +73,16 @@
       bookId: options.bookId,
       bookName: options.bookName,
       cmsId: options.cmsId,
-      parentName: options.parentName,
       parentProductLinkPath: options.parentProductLinkPath,
       productLinkPath: options.productLinkPath,
       formPath: options.formPath,
       flag: false
     })
+    if (options.parentName !== "鏁欏璧勬簮" && options.parentName !== "浜戝涔�") {
+      this.setData({
+        parentName: options.parentName,
+      })
+    }
     console.log(options, 'options');
     this.resourceDetailsData()
     this.getNoteList()
@@ -179,10 +186,10 @@
   showDialog(e) {
 
     this.setData({
-      submitTitle: this.data.bookName,
-      dialogKey: true,
-      textvalue: ''
 
+      dialogKey: true,
+      textvalue: '',
+      submitTitle: this.data.titleName
 
     });
   },
@@ -239,7 +246,7 @@
                 })
               } else {
                 this.setData({
-                  showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + items.file,
+                  showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
                   titleName: items.name
                 })
               }
@@ -289,7 +296,7 @@
         })
       } else {
         this.setData({
-          showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file
+          showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
         })
       }
 
@@ -337,7 +344,7 @@
   // 鏍囬杈撳叆妗嗗��
   inputChange(e) {
     this.setData({
-      titleName: e.detail.value
+      submitTitle: e.detail.value
     })
   },
 
@@ -347,7 +354,7 @@
         icon: 'error',
         title: '璇峰~鍐欑瑪璁板唴瀹�',
       })
-    } else if (!this.data.titleName) {
+    } else if (!this.data.submitTitle) {
       return wx.showToast({
         icon: 'error',
         title: '璇峰~鍐欑瑪璁版爣棰�',
@@ -430,11 +437,9 @@
       submitType: "edit",
       textvalue: note.content,
       submitTitle: note.name,
-
       noteId: note.id,
       dialogKey: true,
     })
-    console.log(this.data.submitTitle);
     // this.showDialog()
   },
 
@@ -519,7 +524,7 @@
       return wx.getUserProfile({
         desc: '鐢ㄦ埛鐧诲綍',
         success: (res) => {
-          // console.log(res);
+          console.log(res);
         }
       })
     }
@@ -557,5 +562,11 @@
   },
   videoErrorCallback(e) {
     console.log(e);
+  },
+  videoError: function (e) {
+    console.log('瑙嗛鍔犺浇澶辫触', e);
+    this.setData({
+      videoError: true
+    });
   }
 })
\ No newline at end of file

--
Gitblit v1.9.1