From f4a2f400fdc999946e75a4322fe1ceb6e528c169 Mon Sep 17 00:00:00 2001
From: litian <C21AF165>
Date: 星期二, 27 八月 2024 19:59:46 +0800
Subject: [PATCH] xuexi

---
 pages/digitalCourses/index.js |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/pages/digitalCourses/index.js b/pages/digitalCourses/index.js
index 45505fc..f80d993 100644
--- a/pages/digitalCourses/index.js
+++ b/pages/digitalCourses/index.js
@@ -17,6 +17,7 @@
     tabList: [],
     courseList: [],
     searchValue: '',
+    active: 0,
     activeItem: null,
     loading: false,
     shoppingCartGetId: []
@@ -34,6 +35,11 @@
       barHeight: systInfo.statusBarHeight,
       navBarHeight: navBarHeight,
     });
+    if (options.courseTypeActive) {
+      this.setData({
+        active: JSON.parse(options.courseTypeActive),
+      });
+    }
     this.getCourseTypeListList()
     this.getShoppingCartList()
   },
@@ -96,7 +102,6 @@
     wx.navigateBack();
   },
   getCourseTypeListList() {
-
     this.setData({
       loading: true
     })
@@ -119,16 +124,18 @@
     app.MG.store.getStoreChannelList(data).then((res) => {
       // 鍘婚櫎鏁扮粍鏈�鍚庝竴涓厓绱�
       const newData = res.datas.slice(0, res.datas.length - 1)
-
-
-
       this.setData({
         tabList: newData,
-        activeItem: newData[0],
         loading: false
       })
-      this.getCourseList(newData[0])
-
+      if (this.data.active) {
+        this.getCourseList(newData[this.data.active])
+      } else {
+        this.setData({
+          activeItem: newData[0],
+        })
+        this.getCourseList(newData[0])
+      }
 
     })
   },
@@ -186,7 +193,6 @@
       }
     }
     app.MG.store.getProductList(obj).then((res) => {
-      console.log(res, '7895')
       res.datas.forEach(item => {
         item.price = item.price.toFixed(2)
       })
@@ -195,21 +201,15 @@
         courseList: res.datas
       })
 
-      console.log(this.data.courseList);
-
     })
   },
   searchBook() {
-    console.log(this.data.searchValue);
     this.getCourseList(this.data.activeItem)
   },
   courseDetail(e) {
-    console.log(e);
     const item = e.currentTarget.dataset.item
-
     setNewView('productId', item.id)
     this.getCourseTypeListList()
-
     wx.navigateTo({
       url: '/pages/digitalCourses/digitalCoursesDetails/index?id=' + item.id,
     })

--
Gitblit v1.9.1