From e38c14de9637d22d0a35ae06bede82dcf31b64ec Mon Sep 17 00:00:00 2001
From: YM <479443481@qq.com>
Date: 星期二, 10 九月 2024 16:52:58 +0800
Subject: [PATCH] 1

---
 packageBookService/pages/bookServices/detail/buyResource/index.js |   42 ++++++++++++++++++++++++++++++------------
 1 files changed, 30 insertions(+), 12 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/buyResource/index.js b/packageBookService/pages/bookServices/detail/buyResource/index.js
index b4032b9..a074c5d 100644
--- a/packageBookService/pages/bookServices/detail/buyResource/index.js
+++ b/packageBookService/pages/bookServices/detail/buyResource/index.js
@@ -19,8 +19,8 @@
     checkAllState: true,
     productLinkPath: '',
     refCode: '',
-    haider: false,
-    naData: false
+    naData: false,
+    bookRefCode: []
   },
 
   /**
@@ -127,7 +127,7 @@
   // 鎵佸钩鍖栨暟鎹浆鎹ree
   getTreeList(rootList, pathLength, newArr, path) {
     for (const item of rootList) {
-      if (item.productLinkPath.length == pathLength && item.productLinkPath.includes(path)) {
+      if ((pathLength - item.productLinkPath.length >= 0 && pathLength - item.productLinkPath.length <= 3) && item.productLinkPath.includes(path)) {
         if (item.sysType == 'CmsItem') {
           if (item.selectType == 'webpage') {
             item.disabled = true
@@ -234,6 +234,7 @@
       itemFields: {
         SysType: 'CmsFolder',
         // 璧勬簮绫诲瀷锛岃瘯璇绘枃浠讹紝鏄惁鍏佽涓嬭浇绛夊弬鏁�
+        learnSelectType: [],
         selectType: [],
         freeFile: [],
         file: [],
@@ -254,7 +255,6 @@
         return this.setData({
           noResources: true,
           loading: false,
-          haider: true,
         });
       }
       let list = []
@@ -287,8 +287,8 @@
         //     noData: true
         //   })
         // }
-        // debugger
-        this.getTreeList(res.datas.cmsDatas[0].datas, 17, list, '\\')
+        const num = query.cmsPath.length + 6
+        this.getTreeList(res.datas.cmsDatas[0].datas, num, list, '\\')
         list = this.ensureTreeConsistency(list)
         list = this.changeResourceChildren(list)
         console.log('淇敼鍚庝簯', list);
@@ -316,7 +316,6 @@
             learn: list,
             loading: false,
             openLearnids: result,
-            haider: true,
           });
         }
       }
@@ -358,7 +357,6 @@
           return this.setData({
             noResources: true,
             loading: false,
-            haider: true,
           });
         }
         //鏁欏璧勬簮 浜戝涔�
@@ -375,7 +373,6 @@
               this.setData({
                 teach: list,
                 loading: false,
-                haider: true
               });
               this.findChildIds(this.data.teach, (this.data.openTeachids = []));
             } else if (type.refCode == "jsek_cloudLearning") {
@@ -388,7 +385,6 @@
                 learn: list,
                 loading: false,
                 openLearnids: result,
-                haider: true
               });
             }
             console.log(list, '浜戝缈�');
@@ -400,7 +396,6 @@
           this.setData({
             test: res.datas.cmsDatas[0].datas,
             loading: false,
-            haider: true
           });
         } else {
           console.log("鍏朵粬");
@@ -524,12 +519,34 @@
       //   productLinkPath: this.data.productLinkPath,
       //   refCode: this.data.refCode,
       // });
+      // this.getResourceCode(
+      //   res.datas.id,
+      //   res.datas.rootCmsItemId
+      // )
       this.getResourceDataList({
         productLinkPath: this.data.productLinkPath,
         refCode: this.data.refCode,
       })
     });
 
+  },
+  getResourceCode(bookId, cmsId) {
+    let query = {
+      path: '*',
+      queryType: '*',
+      productId: bookId,
+      cmsPath: cmsId,
+      itemFields: {
+        SysType: 'Cms'
+      },
+      pading: {
+        start: 99,
+        size: 0
+      }
+    }
+    app.MG.store.getProductDetail(query).then(res => {
+      console.log('鍥句功璧勬簮', res.datas.cmsDatas[0].datas);
+    })
   },
   // 鑾峰彇宸茶喘涔板晢鍝�
   getShoppingCartProductGet() {
@@ -570,7 +587,7 @@
       if (isSHow) {
         return false;
       } else {
-        return data.saleMethod[0].price > 0 ? true : false;
+        return data.saleMethod[0].Price > 0 ? true : false;
       }
       return !isSHow;
     } else {
@@ -636,6 +653,7 @@
       this.setData({
         resourceClassList: JSON.parse(res[0].config).option,
       });
+
     });
   },
   checkAll() {

--
Gitblit v1.9.1