From 122ca12cbb46a7fe9fc3489ad8310a6f3991fcfb Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期五, 30 八月 2024 10:21:43 +0800 Subject: [PATCH] image --- pages/digitalCourses/index.js | 28 +++++++++++++++------------- 1 files changed, 15 insertions(+), 13 deletions(-) diff --git a/pages/digitalCourses/index.js b/pages/digitalCourses/index.js index 0f69f19..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,15 +124,19 @@ 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]) + } + }) }, @@ -184,7 +193,6 @@ } } app.MG.store.getProductList(obj).then((res) => { - console.log(res, '7895') res.datas.forEach(item => { item.price = item.price.toFixed(2) }) @@ -193,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