From 7adfe5210fad2b4ab1b1be41e2d58eb3dd9b2b1a Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期二, 02 四月 2024 09:38:22 +0800
Subject: [PATCH] 代码合并

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

diff --git a/packageBookService/pages/bookServices/detail/components/tree/index.js b/packageBookService/pages/bookServices/detail/components/tree/index.js
index d6814f5..89245ce 100644
--- a/packageBookService/pages/bookServices/detail/components/tree/index.js
+++ b/packageBookService/pages/bookServices/detail/components/tree/index.js
@@ -50,7 +50,8 @@
     activeValues: [1, 2],
     webpageSrc: '',
     cloudShoppingCart: [],
-    selectAll: []
+    selectAll: [],
+    shoppingCart: true
   },
   ready() {
     this.setData({
@@ -141,10 +142,15 @@
           }
         })
       } else {
-        if (this.properties.isShowCheck) return true
         const item = e.currentTarget.dataset.item
         const parent = e.currentTarget.dataset.parent
         let url
+        if (this.properties.isShowCheck && this.resourceIsBuy(item)) {
+          return wx.showToast({
+            icon: 'error',
+            title: "璇峰厛璐拱璧勬簮"
+          })
+        }
         if (item.selectType == 'video' || item.learnSelectType == 'video') {
           url = '/packageDomain/pages/resourceDetails/myVideo/index'
         } else if (item.selectType == 'audio' || item.learnSelectType == 'audio') {
@@ -352,7 +358,6 @@
           })
         }
       })
-
     },
     // 瀛愰」鍕鹃��
     checkResource(e) {
@@ -402,6 +407,14 @@
       })
       if (shoppingCartGetId.includes(saleMethodId)) {
         console.log(111);
+
+        wx.showToast({
+          icon: 'error',
+          title: '宸叉坊鍔�',
+        })
+        this.setData({
+          shoppingCart: false
+        })
       } else {
         let query = {
           requests: [{
@@ -412,6 +425,10 @@
         }
         const addRes = await app.MG.store.addShoppingCart(query)
         console.log(addRes, 'addRes');
+        wx.showToast({
+          icon: 'success',
+          title: '娣诲姞鎴愬姛',
+        })
       }
 
     },
@@ -422,5 +439,5 @@
     // this.setData({
     //   checkAllValues: event.detail,
     // });
-  }
+  },
 })
\ No newline at end of file

--
Gitblit v1.9.1