From b55024ee2f42aa93e0ecaa3113bdeb286f6e59ac Mon Sep 17 00:00:00 2001
From: QYF-GitLab1 <1940665526@qq.com>
Date: 星期二, 29 七月 2025 18:01:55 +0800
Subject: [PATCH] 优化按钮显示,教学互动

---
 packagePersonal/pages/activateProduct/index.js |   74 +++++++++++++++++++++++++-----------
 1 files changed, 51 insertions(+), 23 deletions(-)

diff --git a/packagePersonal/pages/activateProduct/index.js b/packagePersonal/pages/activateProduct/index.js
index b55e0d0..70f5e84 100644
--- a/packagePersonal/pages/activateProduct/index.js
+++ b/packagePersonal/pages/activateProduct/index.js
@@ -94,26 +94,43 @@
             oldlist.forEach(istrue => {
               istrue.icon = getPublicImage(istrue.icon, "", 400)
             })
+            item.typeList = []
             item.saleMethodList.forEach(async (i) => {
-              if (i.type != 'defaultSaleMethod') {
-                var index = i.name.indexOf('-')
-                if (index !== -1) {
-                  item.type = i.name.substring(0, index)
-                } else {
-                  item.type = i.name
-                }
-              } else {
-                let parentData = await app.MG.store.getProductBySaleMethod({
-                  saleMethodId: i.id
-                })
-                console.log(parentData, 111)
-                if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') {
-                  item.type = '鏁板瓧璇剧▼'
-                }
-                if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') {
-                  item.type = '鏁板瓧鏁欐潗'
-                }
+              // if (i.type != 'defaultSaleMethod') {
+              //   var index = i.name.indexOf('-')
+              //   if (index !== -1) {
+              //     item.type = i.name.substring(0, index)
+              //   } else {
+              //     item.type = i.name
+              //   }
+              // } else {
+              //   let parentData = await app.MG.store.getProductBySaleMethod({
+              //     saleMethodId: i.id
+              //   })
+              //   if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') {
+              //     item.type = '鏁板瓧璇剧▼'
+              //   }
+              //   if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') {
+              //     item.type = '鏁板瓧鏁欐潗'
+              //   }
+              // }
+              const obj = {
+                icon: item.productList[0]?.icon,
+                id: item.productList[0]?.id,
+                name: item.productList[0]?.name,
+                type: i.type == 'defaultSaleMethod' ? '鐢靛瓙涔�' : i.name.split('-')[0],
+                defaultSaleMethodId: item.productList[0]?.defaultSaleMethodId
               }
+              let parentData = await app.MG.store.getProductBySaleMethod({
+                saleMethodId: i.id
+              })
+              if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalCourses') {
+                obj.type = '鏁板瓧璇剧▼'
+              }
+              if (parentData.storeLinks[0].storeRefCode == 'jsek_digitalTextbooks') {
+                obj.type = '鏁板瓧鏁欐潗'
+              }
+              item.typeList.push(obj)
             })
           })
           setTimeout(() => {
@@ -143,14 +160,25 @@
 
     })
   },
-  goBookDetails(e) {
+  async goBookDetails(e) {
     const {
       book
     } = e.currentTarget.dataset;
-    console.log(book)
-    wx.navigateTo({
-      url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`,
-    });
+    let type = e.currentTarget.dataset.type
+    if (type == '鏁板瓧璇剧▼') {
+      wx.navigateTo({
+        url: `/pages/digitalCourses/digitalCoursesDetails/index?id=${book.id}`,
+      });
+    } else if (type == '鏁板瓧鏁欐潗') {
+      wx.navigateTo({
+        url: `/pages/digitalTextbooks/digitalTextbooksDetails/index?id=${book.id}`,
+      });
+    } else {
+      let tabValue = type == '棰樺簱' ? 'questionBank' : type == '浜戝涔�' ? 'jsek_cloudLearning' : ''
+      wx.navigateTo({
+        url: `/packageBookService/pages/bookServices/detail/index?id=${book.id}&name=${book.name}&tabValue=${tabValue}`,
+      });
+    }
   },
   /**
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔

--
Gitblit v1.9.1