From 6df96b3e7a7da1985ee875e84711e9f15c5fbff0 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期二, 24 十二月 2024 18:25:02 +0800
Subject: [PATCH] Merge refs/remotes/origin/master into refs/heads/master

---
 packageDomain/pages/resourceDetails/document/index.js |   33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diff --git a/packageDomain/pages/resourceDetails/document/index.js b/packageDomain/pages/resourceDetails/document/index.js
index 0f5bb65..ab77867 100644
--- a/packageDomain/pages/resourceDetails/document/index.js
+++ b/packageDomain/pages/resourceDetails/document/index.js
@@ -29,6 +29,7 @@
     showData: '',
     titleName: '',
     selectType: '',
+    learnSelectType: '',
     zipData: '',
     naturalResources: [],
     titleName: '',
@@ -50,7 +51,6 @@
     wx.setNavigationBarTitle({
       title: '璧勬簮璇︽儏'
     });
-    console.log(options);
     const systInfo = wx.getSystemInfoSync();
     const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅
     const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴�
@@ -105,7 +105,7 @@
     this.setData({
       pauseTime: Date.now()
     })
-    if (wx.getStorageSync(app.config.tokenKey) && epubObj && epubObj.bookBuy) {
+    if (wx.getStorageSync(app.config.tokenKey)) {
       let duration = this.data.pauseTime - this.data.startTime
       this.count(duration)
     }
@@ -118,7 +118,7 @@
     this.setData({
       pauseTime: Date.now()
     })
-    if (wx.getStorageSync(app.config.tokenKey) && epubObj && epubObj.bookBuy) {
+    if (wx.getStorageSync(app.config.tokenKey)) {
       let duration = this.data.pauseTime - this.data.startTime
       this.count(duration)
     }
@@ -195,13 +195,13 @@
       query.storeInfo = this.data.storeInfo
     }
     app.MG.store.getProductDetail(query).then((res) => {
-      console.log(res);
       res.datas.cmsDatas[0].datas.forEach((item) => {
         if (this.data.productLinkPath == item.productLinkPath) {
           this.handleTeachData(item)
           this.setData({
             titleName: item.name,
-            selectType: item.selectType
+            selectType: item.selectType,
+            learnSelectType: item.learnSelectType
           })
         }
       })
@@ -219,14 +219,15 @@
         })
       }
     }
-    if (!item || !item.file) {
+    if (!item || !item.file || !item.protectedFile) {
       wx.showToast({
         title: '鏂囦欢淇℃伅缂哄け',
         icon: 'none'
       });
       return;
     }
-    const downloadUrl = app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file;
+    let file = item.file ? item.file : item.protectedFile
+    const downloadUrl = app.config.requestCtx + '/file/api/ApiDownload?md5=' + file;
     wx.showLoading({
       title: '姝e湪涓嬭浇...',
     });
@@ -284,21 +285,22 @@
   //鍒氳繘鏉ョ殑鏃跺�欒皟鐢�
   handleTeachData(item) {
     //鍥剧墖
-    if (item.selectType == 'picture') {
+    if (item.selectType == 'picture' || item.learnSelectType == 'picture') {
+      let file = item.file ? item.file : item.protectedFile ? item.protectedFile : item.freeFile
       this.setData({
-        showData: item.file ? app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.file : app.config.requestCtx + '/file/api/ApiDownload?md5=' + item.freeFile,
+        showData: app.config.requestCtx + '/file/api/ApiDownload?md5=' + file,
       })
       wx.hideLoading();
     }
     // 涓嬭浇鏂囦欢zip
-    if (item.selectType == 'zip') {
+    if (item.selectType == 'zip' || item.learnSelectType == 'zip') {
       this.setData({
         zipData: item
       })
       wx.hideLoading();
     }
     //缃戦〉
-    if (item.selectType == 'webpage') {
+    if (item.selectType == 'webpage' || item.learnSelectType == 'webpage') {
       this.setData({
         webpageSrc: item.jsek_link
       })
@@ -314,8 +316,8 @@
     //   })
     // }
     //鏂囨。绛�
-    if (item.selectType == 'document' || item.selectType == 'pdf') {
-      let md5 = item.file ? item.file : item.freeFile
+    if (item.selectType == 'document' || item.selectType == 'pdf' || item.learnSelectType == 'document' || item.learnSelectType == 'pdf') {
+      let md5 = item.file ? item.file : item.protectedFile ? item.protectedFile : item.freeFile
       app.MG.file.getPdfInfo({
         md5: md5
       }).then((res) => {
@@ -337,9 +339,7 @@
 
   handleTap: function () {
     const naturalResources = this.data.naturalResources;
-    naturalResources.forEach(function (item) {
-      // console.log(item);
-    });
+    naturalResources.forEach(function (item) {});
   },
 
   onClick() {
@@ -375,7 +375,6 @@
     const {
       trigger
     } = e.detail;
-    console.log(trigger);
     this.setData({
       visible: false,
     });

--
Gitblit v1.9.1