From cb6bb8bda31df75afe5a5bd50fe8e3ff6a3d34e2 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 15 四月 2024 09:31:39 +0800
Subject: [PATCH] 详情页bug修改,资源购买页添加骨架屏

---
 packageBookService/pages/bookServices/detail/components/tree/index.js |   22 +++++++++++++++++-----
 1 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index b8a0bf3..5d4a08b 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -58,6 +58,7 @@
     selectAll: [],
     shoppingCart: true,
     stop: false,
+    cart: true
   },
   ready() {},
 
@@ -131,9 +132,12 @@
     goPlayer(e) {
       // 妫�鏌ョ櫥褰曠姸鎬�
       const token = wx.getStorageSync(app.config.tokenKey);
+
       if (token) {
         const item = e.currentTarget.dataset.item;
         const parent = e.currentTarget.dataset.parent;
+        const parentProductLinkPath = parent ? parent.productLinkPath : wx.getStorageSync('teachResourcesPath')
+        const parentName = parent ? parent.name : '鏁欏璧勬簮'
         let url;
         if (this.properties.isShowCheck && this.resourceIsBuy(item)) {
           return false;
@@ -159,7 +163,7 @@
           });
         }
         wx.navigateTo({
-          url: `${url}?productLinkPath=${item.productLinkPath}&parentProductLinkPath=${parent.productLinkPath}&parentName=${parent.name}&activeId=${item.id}&bookId=${this.properties.bookInfo.id}&bookName=${this.properties.bookInfo.name}&cmsId=${this.properties.bookInfo.rootCmsItemId}&formPath=${this.properties.tab}`,
+          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}`,
         });
         if (item.selectType == "document" || item.selectType == "pdf") {
           const fileLink =
@@ -469,6 +473,9 @@
     // 鍔犲叆璐墿杞�
     async onCloudShoppingCart(e) {
       let shoppingCartGetId = [];
+
+      const item = e.currentTarget.dataset.item
+      console.log(item.isShopCar);
       const saleMethodId = e.currentTarget.dataset.item.saleMethod[0].Id;
       console.log(saleMethodId);
       let query = {
@@ -504,10 +511,15 @@
         };
         const addRes = await app.MG.store.addShoppingCart(query);
         console.log(addRes, "addRes");
-        wx.showToast({
-          icon: "success",
-          title: "娣诲姞鎴愬姛",
-        });
+        if (addRes) {
+          wx.showToast({
+            icon: "success",
+            title: "娣诲姞鎴愬姛",
+          });
+          item.isShopCar = false
+          this.triggerEvent("updateCloudLearning")
+        }
+
       }
     },
     sadd() {

--
Gitblit v1.9.1