From e7b28656801d4ff8284e0c43deddf0a6953b08ae Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期四, 24 十月 2024 15:36:17 +0800
Subject: [PATCH] 云学习判断

---
 packageBookService/pages/bookServices/detail/index.js |   34 ++++++++++++++++++++++++++++------
 1 files changed, 28 insertions(+), 6 deletions(-)

diff --git a/packageBookService/pages/bookServices/detail/index.js b/packageBookService/pages/bookServices/detail/index.js
index 2815779..68ed718 100644
--- a/packageBookService/pages/bookServices/detail/index.js
+++ b/packageBookService/pages/bookServices/detail/index.js
@@ -55,6 +55,7 @@
     isShowBuyCloundMenu: false, //   浜戝涔犲叏閮ㄨ喘涔版寜閽槸鍚︽樉绀�
     isCloundHaveSaleMethod: false, // 浜戝涔犳槸鍚︽湁閿�鍞柟寮� 
     cloundMenuIsBuy: false,
+    learnTaskData: {},
     rejectCause: "", // 涓嬭浇鎷掔粷鍘熷洜
     buyIdList: [],
     shoppingCartGetId: [], // 宸茶喘涔癷d鍒楄〃
@@ -207,7 +208,9 @@
     fileList: [],
     isShowUp: true,
     protocolShow: false,
-    protocolTxt: ''
+    protocolTxt: '',
+    learnMenu: null,
+    md5List: []
   },
 
   resetTree: function (e) {
@@ -525,8 +528,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')
+      })
     })
   },
   //璇锋眰瀛愬晢鍝佺殑鏂囦欢
@@ -989,8 +995,19 @@
         cloundSaleMethod &&
         new Date().getTime() <= new Date(cloundSaleMethod.EndDate).getTime() &&
         new Date().getTime() >= new Date(cloundSaleMethod.BeginDate).getTime()
+      let md5s = []
       res.datas.cmsDatas[0].datas.forEach((item) => {
         // 浜戝涔犱笂鏈夐攢鍞柟寮忥紝鍘绘帀浜戝涔犱笅鎵�鏈夐攢鍞柟寮�
+        if (this.data.tabValue == "jsek_teachingResources") {
+
+          if (item.file || item.freeFile) {
+            let md5 = item.file ? item.file : item.freeFile
+            md5s.push(md5)
+          }
+          this.setData({
+            md5List: md5s,
+          });
+        }
         if (flags) item.saleMethod = []
         item.checked = false;
         if (item.sysType == 'CmsItem') {
@@ -1039,9 +1056,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 = res.datas.cmsDatas[0].datas.some(citem => citem.saleMethod.length != 0) || type.saleMethod.length
+        let isShowBuyCloundBtn = !flags && res.datas.cmsDatas[0].datas.some(citem => citem.saleMethod.length != 0)
         // 鍒ゆ柇璐墿杞︽寜閽拰閿佹寜閽槸鍚︽樉绀�
         this.handleTreeData(list).forEach(item => {
           item.isbuy = this.resourceIsBuy(item);
@@ -2805,7 +2822,7 @@
     app.MG.ugc.newTopicMessage(query).then((res) => {
       wx.showToast({
         icon: "success",
-        title: "璇蜂笂浼犺祫婧愭枃浠�",
+        title: "涓婁紶鎴愬姛",
       });
       this.closeDialog()
     })
@@ -2820,5 +2837,10 @@
     this.setData({
       cloundMenuIsBuy: flag
     })
-  }
+  },
+  /**
+   * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
+   */
+  onShareAppMessage() {},
+  onShareTimeline() {}
 })
\ No newline at end of file

--
Gitblit v1.9.1