From 04c7b0163caeae4ab1c5da62e301fa993101cfad Mon Sep 17 00:00:00 2001
From: 闫增涛 <1829501689@qq.com>
Date: 星期一, 31 三月 2025 10:40:45 +0800
Subject: [PATCH] bug修改

---
 pages/study/index.js |   83 +++++++++++++++++++++++++++++++++++++++--
 1 files changed, 78 insertions(+), 5 deletions(-)

diff --git a/pages/study/index.js b/pages/study/index.js
index 490a6ae..fcd584b 100644
--- a/pages/study/index.js
+++ b/pages/study/index.js
@@ -63,13 +63,18 @@
           this.getUserInfo()
           this.getStaticsSum();
           this.getDataList(false);
+          this.getListCount()
+        } else {
+          wx.switchTab({
+            url: '/pages/home/home',
+          })
         }
       })
     } else {
       this.getUserInfo()
       this.getStaticsSum();
       this.getDataList(false);
-
+      this.getListCount()
     }
 
   },
@@ -112,6 +117,61 @@
       }
     })
   },
+  getListCount() {
+    let that = this;
+    let data = {
+      Size: 9999,
+      Start: 0,
+      sort: {
+        type: "Desc",
+        field: "CreateDate",
+      },
+      searchList: [{
+        keywords: 'jsek_mediaBook',
+        field: "ProductType",
+      }],
+    }
+    app.MG.store.getPurchasedProductList(data).then((res) => {
+      that.setData({
+        titleBook: "鍥句功锛�" + res.totalSize + "鏈級",
+      })
+    })
+    let data1 = {
+      Size: 9999,
+      Start: 0,
+      sort: {
+        type: "Desc",
+        field: "CreateDate",
+      },
+      searchList: [{
+        keywords: 'jsek_digitalCourses',
+        field: "ProductType",
+      }],
+    }
+    app.MG.store.getPurchasedProductList(data1).then((res) => {
+      that.setData({
+        titleCourse: "璇剧▼锛�" + res.totalSize + "闂級",
+      })
+    })
+    let data2 = {
+      Size: 9999,
+      Start: 0,
+      sort: {
+        type: "Desc",
+        field: "CreateDate",
+      },
+      searchList: [{
+        keywords: 'jsek_digitalTextbooks',
+        field: "ProductType",
+      }],
+    }
+    app.MG.store.getPurchasedProductList(data2).then((res) => {
+      that.setData({
+        titleTextBook: "鏁板瓧鏁欐潗锛�" + res.totalSize + "鏈級",
+      })
+    })
+  },
+
 
   tabClick(item) {
     let that = this;
@@ -163,7 +223,6 @@
           this.setData({
             list: dataList,
             pageTotalCount: res.totalSize,
-            titleBook: "鍥句功锛�" + res.totalSize + "鏈級",
             bottomLoading: false,
             isMoreData: dataList.length > 0 ? false : true,
             skeletonLoding: false,
@@ -186,9 +245,23 @@
     const {
       book
     } = e.currentTarget.dataset;
-    wx.navigateTo({
-      url: `/packageBookService/pages/bookServices/detail/index?id=${book.product.id}&name=${book.product.name}`,
-    });
+    console.log(book);
+    if (this.data.active == 0) {
+      wx.navigateTo({
+        url: `/packageBookService/pages/bookServices/detail/index?id=${book.product.id}&name=${book.product.name}`,
+      });
+    }
+    if (this.data.active == 1) {
+      wx.navigateTo({
+        url: `/pages/digitalCourses/digitalCoursesDetails/index?id=${book.product.id}&path=${book.product.linkPathList[1] + '\\' + book.product.id}`,
+      });
+    }
+    if (this.data.active == 2) {
+      wx.navigateTo({
+        url: `/pages/digitalTextbooks/digitalTextbooksDetails/index?id=${book.product.id}`,
+      });
+    }
+
   },
   /**
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔

--
Gitblit v1.9.1