From 3ec10b0c2654e1243e42a5ad563d088ac89c87fe Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期五, 27 九月 2024 14:06:56 +0800
Subject: [PATCH] zf

---
 packageBookService/pages/bookServices/detail/index.js |   24 +++++++++++++++++++-----
 1 files changed, 19 insertions(+), 5 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js
index e9d8451..1b9e298 100644
--- a/packageBookService/pages/bookServices/detail/index.js
+++ b/packageBookService/pages/bookServices/detail/index.js
@@ -50,10 +50,12 @@
     resourceClassList: [], // 璧勬簮鎵�灞炲垎绫�
     applyState: "", // 鏁欏璧勬簮鐢宠鐘舵��
     deadline: "", // 鏁欏璧勬簮鐢宠鏈夋晥鏃ユ湡,
+    isShowBuyCloundBtn: false,
     isshowDrawBtn: true, // 浜戝涔犻鍙栨煡鐪嬫寜閽槸鍚︽樉绀�
     isShowBuyCloundMenu: false, //   浜戝涔犲叏閮ㄨ喘涔版寜閽槸鍚︽樉绀�
     isCloundHaveSaleMethod: false, // 浜戝涔犳槸鍚︽湁閿�鍞柟寮� 
     cloundMenuIsBuy: false,
+    learnTaskData: {},
     rejectCause: "", // 涓嬭浇鎷掔粷鍘熷洜
     buyIdList: [],
     shoppingCartGetId: [], // 宸茶喘涔癷d鍒楄〃
@@ -206,7 +208,8 @@
     fileList: [],
     isShowUp: true,
     protocolShow: false,
-    protocolTxt: ''
+    protocolTxt: '',
+    learnMenu: null
   },
 
   resetTree: function (e) {
@@ -524,8 +527,11 @@
     app.MG.store.getProductDetail(query).then((res) => {
       this.setData({
         resourceCodeList: res.datas.cmsDatas[0].datas,
+        learnTaskData: res.datas.cmsDatas[0].datas.filter((item) => item.refCode == 'jsek_learningTasks')[0]
       })
-      console.log('refcode', this.data.resourceCodeList);
+      if (res.datas.cmsDatas[0].datas.length) this.setData({
+        learnMenu: res.datas.cmsDatas[0].datas.find(item => item.refCode == 'jsek_cloudLearning')
+      })
     })
   },
   //璇锋眰瀛愬晢鍝佺殑鏂囦欢
@@ -1038,7 +1044,9 @@
           new Date(item.saleMethod.find((citem) => citem.SaleType == 'Normal').BeginDate).getTime() <= new Date().getTime()
         ) || (flags && cloundSaleMethod.Price == 0)
         // 鍒ゆ柇浜戝涔犲叏閮ㄨ喘涔版寜閽槸鍚︽樉绀�
-        let isShowBuyCloundMenu = flags && cloundSaleMethod.Price >= 0
+        let isShowBuyCloundMenu = flags && cloundSaleMethod.Price >= 0 && !this.data.buyIdList.includes(cloundSaleMethod.Id)
+        // 鍒ゆ柇璧勬簮璐拱鎸夐挳鏄惁鏄剧ず
+        let isShowBuyCloundBtn = !flags && res.datas.cmsDatas[0].datas.some(citem => citem.saleMethod.length != 0)
         // 鍒ゆ柇璐墿杞︽寜閽拰閿佹寜閽槸鍚︽樉绀�
         this.handleTreeData(list).forEach(item => {
           item.isbuy = this.resourceIsBuy(item);
@@ -1048,6 +1056,7 @@
         this.setData({
           isshowDrawBtn,
           isShowBuyCloundMenu,
+          isShowBuyCloundBtn,
           isCloundHaveSaleMethod: flags,
           learn: list,
           loading: false,
@@ -2800,7 +2809,7 @@
     }
     app.MG.ugc.newTopicMessage(query).then((res) => {
       wx.showToast({
-        icon: "success",
+        icon: "error",
         title: "璇蜂笂浼犺祫婧愭枃浠�",
       });
       this.closeDialog()
@@ -2816,5 +2825,10 @@
     this.setData({
       cloundMenuIsBuy: flag
     })
-  }
+  },
+  /**
+   * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
+   */
+  onShareAppMessage() {},
+  onShareTimeline() {}
 })
\ No newline at end of file

--
Gitblit v1.9.1