From 985f70ad180b1ce396cf03e29cc2551a0bd892a2 Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 25 三月 2024 18:28:48 +0800
Subject: [PATCH] 删除多余文件

---
 packageBookService/pages/bookServices/detail/buyResource/index.js |   55 ++++++++++++++++++++++++++++++++++++++++++++++++-------
 1 files changed, 48 insertions(+), 7 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/buyResource/index.js b/packageBookService/pages/bookServices/detail/buyResource/index.js
index 39062f7..bcefddd 100644
--- a/packageBookService/pages/bookServices/detail/buyResource/index.js
+++ b/packageBookService/pages/bookServices/detail/buyResource/index.js
@@ -12,6 +12,8 @@
     openLearnids: [],
     bookId: '',
     loading: false,
+    shoppingList: [],
+    shoppingCartGetId: [],
   },
 
   /**
@@ -29,6 +31,8 @@
     this.getResourceClass()
     console.log(options);
     this.getResourceData({ productLinkPath: options.productLinkPath, refCode: options.refCode })
+    this.getShoppingCartProductGet()
+    this.getBookInfo(options.bookId)
   },
 
   /**
@@ -270,15 +274,52 @@
     });
 
   },
-    // 鍒ゆ柇璧勬簮鏄惁璐拱
-    resourceIsBuy(data) {
-      if (data.saleMethod && data.saleMethod.length) {
-        const isSHow = this.data.buyIdList.some((item) => item == data.saleMethod[0].Id)
-        return !isSHow
-      } else {
+  // 鑾峰彇宸茶喘涔板晢鍝�
+  getShoppingCartProductGet() {
+    let query = {
+      start: 0,
+      size: 999,
+      filterList: [],
+      searchList: []
+    }
+    app.MG.store.getShoppingCartProductList(query).then((res) => {
+      const list = []
+      res.datas.forEach((item) => {
+        list.push(item.saleMethod.id)
+      })
+      this.setData({
+        shoppingList: res.datas,
+        shoppingCartGetId: list
+      })
+    })
+  },
+  // 鍒ゆ柇璧勬簮鏄惁璐拱
+  resourceIsBuy(data) {
+    if (data.saleMethod && data.saleMethod.length) {
+      const isSHow = this.data.buyIdList.some((item) => item == data.saleMethod[0].Id)
+      return !isSHow
+    } else {
+      return false
+    }
+  },
+  // 鍒ゆ柇璧勬簮鍔犲叆璐墿杞︽寜閽槸鍚︽樉绀�
+  isShoppingCart(data) {
+    if (data.saleMethod && data.saleMethod.length) {
+      if (data.saleMethod[0].Price <= 0) return false
+      // 鍐嶅垽鏂槸鍚﹁喘涔�
+      const isBuy = this.data.buyIdList.some((item) => item == data.saleMethod[0].Id)
+      if (isBuy) {
+        // 璐拱浜�
         return false
+      } else {
+        // 鍒ゆ柇鏄惁鍔犲叆璐墿杞�
+        const isSHow = this.data.shoppingCartGetId.some((item) => item == data.saleMethod[0].Id)
+        return !isSHow
       }
-    },
+    } else {
+      return false
+    }
+  },
   // 鑾峰彇灞曞紑椤�
   findChildIds(data, result) {
     let index = 0

--
Gitblit v1.9.1