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 | 21 +++++++++++++++------ 1 files changed, 15 insertions(+), 6 deletions(-) diff --git a/pages/digitalCourses/index.js b/pages/digitalCourses/index.js index f4ea7cc..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]) + } + }) }, -- Gitblit v1.9.1