From c6c73b7d709322052b9cd6777b3d6657e0d43d30 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期六, 07 九月 2024 14:37:32 +0800
Subject: [PATCH] bug

---
 packageBookService/pages/bookServices/detail/components/tree/index.js |   55 ++++++++++++++++++++++++++++++-------------------------
 1 files changed, 30 insertions(+), 25 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index 1c287fe..332d2d4 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -96,6 +96,7 @@
     },
     // 鑺傜偣灞曞紑
     handleChange(e) {
+      console.log(e.detail.value);
       this.setData({
         openIds: e.detail.value,
       });
@@ -145,7 +146,18 @@
           wx.getStorageSync("teachResourcesPath");
         const parentName = parent ? parent.name : "鏁欏璧勬簮";
         let url;
-        if (item.selectType == 'zip') {
+        if (item.selectType == "webpage") {
+          // 缃戦〉绫诲瀷璺宠浆鍒扮綉鍧�澶嶅埗椤碉紝鍥犱负url浼犲弬涓嶈兘浼� 甯﹀弬鏁扮殑缃戠粶鍦板潃锛屾墍浠ユ澶勮鎶婄綉缁滃湴鍧�閲岀殑浼犲弬鎽樺嚭鏉ワ紝鏀惧埌url閲�
+          let urlData = ''
+          const flags = item.jsek_link.indexOf("?")
+          if (flags > -1) {
+            urlData = item.jsek_link.slice(flags + 1, item.jsek_link.length)
+          }
+          url = '/packageBookService/pages/bookServices/linkPage/index'
+          return wx.navigateTo({
+            url: urlData ? url + `?path=${item.jsek_link.slice(0,flags)}` + '&' + urlData : url + `?path=${item.jsek_link}`
+          })
+        } else if (item.selectType == 'zip') {
           if (this.properties.applyState == 'Normal') {
             return wx.showToast({
               icon: 'error',
@@ -168,12 +180,13 @@
           item.learnSelectType == "audio"
         ) {
           url = "/packageDomain/pages/resourceDetails/myAudio/index";
-        } else if (item.selectType == "picture" || item.selectType == "zip") {
+        } else if (item.selectType == "picture") {
           url = "/packageDomain/pages/resourceDetails/document/index";
         }
         if (
           this.properties.tab == "jsek_cloudLearning" &&
           this.resourceIsBuy(item)
+          // item.saleMethod.length > 0
         ) {
           return wx.showToast({
             icon: "error",
@@ -181,16 +194,16 @@
               "璇峰厛璐拱璇ヨ祫婧�" : "璇峰厛鐐瑰嚮棰嗗彇鏌ョ湅鎸夐挳",
           });
         }
-        if (
-          item.saleMethod.length == 0 &&
-          item.sysType == "CmsItem" &&
-          this.properties.tab == "jsek_cloudLearning"
-        ) {
-          return wx.showToast({
-            icon: "error",
-            title: "鏆傛湭寮�濮嬮攢鍞紝璇疯仈绯荤鐞嗗憳",
-          });
-        }
+        // if (
+        //   item.saleMethod.length == 0 &&
+        //   item.sysType == "CmsItem" &&
+        //   this.properties.tab == "jsek_cloudLearning"
+        // ) {
+        //   return wx.showToast({
+        //     icon: "error",
+        //     title: "鏆傛湭寮�濮嬮攢鍞紝璇疯仈绯荤鐞嗗憳",
+        //   });
+        // }
         if (this.properties.tab == "jsek_teachingResources" && (item.file || item.freeFile)) {
           let file = item.fileMap[item.file] ? item.fileMap[item.file] : item.fileMap[item.freeFile]
           if (file && file.protectType !== "Public") {
@@ -208,11 +221,8 @@
         wx.navigateTo({
           url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parentProductLinkPath}&parentName=${parentName}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}&applyState=${this.properties.applyState}&deadline=${this.properties.deadline}`,
         });
-<<<<<<< Updated upstream
-=======
 
         // debugger
->>>>>>> Stashed changes
         if (item.selectType == "pdf" || item.selectType == "document") {
           const fileLink = item.file ? item.file : item.freeFile
           console.log(fileLink);
@@ -221,12 +231,7 @@
               fileLink +
               "&fileName=" +
               item.name +
-<<<<<<< Updated upstream
-              "&fileType=pdf" +
-              "&bookBuy=true"
-=======
               "&fileType=pdf" + "&bookBuy=true"
->>>>>>> Stashed changes
           });
         }
         // if (item.selectType == "document") {
@@ -269,11 +274,11 @@
         //     },
         //   });
         // }
-        if (item.selectType == "webpage") {
-          this.setData({
-            webpageSrc: item.jsek_link,
-          });
-        }
+        // if (item.selectType == "webpage") {
+        //   this.setData({
+        //     webpageSrc: item.jsek_link,
+        //   });
+        // }
       }
     },
 

--
Gitblit v1.9.1