From 86cbb2a45a153a704bcc0d63697f83d2832caa71 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期二, 09 七月 2024 09:51:15 +0800
Subject: [PATCH] css,token

---
 packageBookService/pages/bookServices/detail/components/tree/index.js |   87 ++++++++++++++++++++++---------------------
 1 files changed, 44 insertions(+), 43 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index a877b45..0fbed14 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -208,7 +208,9 @@
         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}`,
         });
-        if (item.selectType == "pdf") {
+
+        // debugger
+        if (item.selectType == "pdf" || item.selectType == "document") {
           const fileLink = item.file ? item.file : item.freeFile
           console.log(fileLink);
           wx.navigateTo({
@@ -216,50 +218,49 @@
               fileLink +
               "&fileName=" +
               item.name +
-              "&fileType=" +
-              item.selectType + "&bookBuy=true"
+              "&fileType=pdf" + "&bookBuy=true"
           });
         }
-        if (item.selectType == "document") {
-          // freeFile
-          if (item.selectType == "document") {
-            item.selectType = "pptx";
-          }
-          const fileLink = item.file ?
-            app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file :
-            app.config.requestCtx +
-            "/file/api/ApiDownload?md5=" +
-            item.freeFile;
-          console.log(fileLink, "fileLink");
-          //鎻愮ず鍔犺浇涓�
-          // 鍗曟涓嬭浇鍏佽鐨勬渶澶ф枃浠朵负 200MB
-          wx.downloadFile({
-            url: fileLink,
-            // filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`,
-            filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`,
-            success: function (res) {
-              console.log(res, "wx.downloadFile success res");
-              if (res.statusCode != 200) {
-                util.hideLoadingWithErrorTips();
-                return false;
-              }
-              var Path = res.tempFilePath; //杩斿洖鐨勬枃浠朵复鏃跺湴鍧�锛岀敤浜庡悗闈㈡墦寮�鏈湴棰勮鎵�鐢�
-              let data = res.filePath;
-              wx.openDocument({
-                filePath: data,
-                showMenu: true,
-                success: function (res) {
-                  console.log("鎵撳紑鎴愬姛");
-                  util.hideLoading();
-                },
-              });
-            },
-            fail: function (err) {
-              console.log(err, "wx.downloadFile fail err");
-              util.hideLoadingWithErrorTips();
-            },
-          });
-        }
+        // if (item.selectType == "document") {
+        //   // freeFile
+        //   // if (item.selectType == "document") {
+        //   //   item.selectType = "pptx";
+        //   // }
+        //   const fileLink = item.file ?
+        //     app.config.requestCtx + "/file/api/ApiDownload?md5=" + item.file :
+        //     app.config.requestCtx +
+        //     "/file/api/ApiDownload?md5=" +
+        //     item.freeFile;
+        //   console.log(fileLink, "fileLink");
+        //   //鎻愮ず鍔犺浇涓�
+        //   // 鍗曟涓嬭浇鍏佽鐨勬渶澶ф枃浠朵负 200MB
+        //   wx.downloadFile({
+        //     url: fileLink,
+        //     // filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`,
+        //     filePath: wx.env.USER_DATA_PATH + `/${item.name}.${item.selectType}`,
+        //     success: function (res) {
+        //       console.log(res, "wx.downloadFile success res");
+        //       if (res.statusCode != 200) {
+        //         util.hideLoadingWithErrorTips();
+        //         return false;
+        //       }
+        //       var Path = res.tempFilePath; //杩斿洖鐨勬枃浠朵复鏃跺湴鍧�锛岀敤浜庡悗闈㈡墦寮�鏈湴棰勮鎵�鐢�
+        //       let data = res.filePath;
+        //       wx.openDocument({
+        //         filePath: data,
+        //         showMenu: true,
+        //         success: function (res) {
+        //           console.log("鎵撳紑鎴愬姛");
+        //           util.hideLoading();
+        //         },
+        //       });
+        //     },
+        //     fail: function (err) {
+        //       console.log(err, "wx.downloadFile fail err");
+        //       util.hideLoadingWithErrorTips();
+        //     },
+        //   });
+        // }
         if (item.selectType == "webpage") {
           this.setData({
             webpageSrc: item.jsek_link,

--
Gitblit v1.9.1