From 7846f8224cf0bf2119116e853e2da3969d3f7774 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期四, 21 三月 2024 09:31:18 +0800
Subject: [PATCH] Merge refs/remotes/origin/master into refs/heads/master

---
 packageBookService/pages/bookServices/detail/index.js |   58 +++++++++++++++++++++++++++++++++++++---------------------
 1 files changed, 37 insertions(+), 21 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js
index 0b617e4..6231fb5 100644
--- a/packageBookService/pages/bookServices/detail/index.js
+++ b/packageBookService/pages/bookServices/detail/index.js
@@ -51,7 +51,8 @@
       residue: 0, // 缁勫嵎鍓╀綑娆℃暟
       mockList: [] // 鐢ㄦ埛缁勫嵎鎻愪氦淇℃伅
     },
-    flag: true
+    flag: true,
+    applyResourceLoading: false
   },
 
 
@@ -262,7 +263,6 @@
           })
         }
       }
-      console.log('缁勫嵎淇℃伅', this.data.mockData);
       this.setData({
         'bookDetail.publicationDate': this.formatDate(this.data.bookDetail.publicationDate),
         'bookDetail.class': className,
@@ -270,6 +270,7 @@
         'bookDetail.oldPrice': this.numFormat(this.data.bookDetail.oldPrice),
         'bookDetail.paperPrice': this.numFormat(this.data.bookDetail.paperPrice),
       });
+      console.log('鍥句功淇℃伅', this.data.bookDetail);
     });
 
   },
@@ -417,20 +418,23 @@
         //鏁欏璧勬簮 浜戝涔�
         if (type.refCode == 'jsek_teachingResources' || type.refCode == 'jsek_cloudLearning') {
           if (res.datas.cmsDatas[0].datas.length > 0) {
+            res.datas.cmsDatas[0].datas.forEach(item => {
+              item.checked = false
+            })
+            const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
             if (type.refCode == 'jsek_teachingResources') {
-              res.datas.cmsDatas[0].datas.forEach(item => {
-                item.checked = false
-              })
-              const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
-
-              console.log(list, 'list');
               this.setData({
                 teach: list,
                 loading: false
               })
+              console.log('鏁欏璧勬簮', this.data.teach);
               this.findChildIds(this.data.teach, this.data.openTeachids = [])
             } else if (type.refCode == 'jsek_cloudLearning') {
+              res.datas.cmsDatas[0].datas.forEach(item => {
+                item.checked = false
+              })
               const list = await this.getAllResource(res.datas.cmsDatas[0].datas)
+              console.log(list, 'list');
               this.setData({
                 learn: list,
                 loading: false
@@ -515,6 +519,7 @@
       if (this.data.tabValue == 'jsek_teachingResources') {
         item.checked = false
       } else if (this.data.tabValue == 'jsek_cloudLearning') {
+        item.checked = false
         item.isbuy = this.resourceIsBuy(item)
         item.isShopCar = this.isShoppingCart(item)
       }
@@ -703,10 +708,15 @@
         })
       }
     })
-    console.log('鏈夋晥鏃ユ湡', this.data.deadline);
+    this.setData({
+      applyResourceLoading: false
+    })
   },
   // 鐢宠鏁欏璧勬簮
   applyResource() {
+    this.setData({
+      applyResourceLoading: true
+    })
     // let role = userStore.userInfo ? userStore.userInfo.role : null
     // if (role) {
     //   if (role == 'Teacher') {
@@ -729,7 +739,9 @@
     }
     app.MG.ugc.newTopicMessage(query).then((res) => {
       if (res) {
-        Message.success('鐢宠宸叉彁浜わ紝璇峰緟瀹℃牳閫氳繃鍚庝笅杞�')
+        wx.showToast({
+          title: '鐢宠宸叉彁浜わ紝璇峰緟瀹℃牳閫氳繃鍚庝笅杞�',
+        })
       }
       this.getApplyInfo(this.data.bookDetail.id)
     })
@@ -991,14 +1003,14 @@
   async allAddShoppiingCar() {
     const child = this.selectComponent('#learn-resource')
     const token = wx.getStorageSync('jsek-token')
-    if (!token) {
-      return wx.getUserProfile({
-        desc: '鐢ㄦ埛鐧诲綍',
-        success: (res) => {
-          console.log(res);
-        }
-      })
-    }
+    // if (!token) {
+    //   return wx.getUserProfile({
+    //     desc: '鐢ㄦ埛鐧诲綍',
+    //     success: (res) => {
+    //       console.log(res);
+    //     }
+    //   })
+    // }
     let shopList = this.handleTreeData(this.data.learn).filter((item) => this.resourceIsBuy(item))
     this.getShoppingCartProductGet()
     if (!shopList.length) return wx.showToast({
@@ -1143,7 +1155,6 @@
         })
         res = await app.MG.store.initOrder(query)
       }
-
       if (res.orderNumber && this.data.mockData.price) {
         wx.navigateTo({
           url: `/pages/cart/paymentPage/index?orderNumber=${res.orderNumber}`,
@@ -1194,11 +1205,16 @@
       this.buyBook()
     }
     else if (this.data.tabValue == 'jsek_cloudLearning') {
-      console.log('浜戝涔�');
+      const tree = this.selectComponent('#tree')
+      
+      tree.onCloudShoppingCart()
+
+
     } else if (this.data.tabValue == 'questionBank') {
       this.buyMock()
     } else {
       console.log(this.data.tabValue);
     }
-  }
+  },
+
 })

--
Gitblit v1.9.1