From 7eea32a9a7a034e951468bea279688e8db5c1c98 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期一, 09 九月 2024 14:31:51 +0800 Subject: [PATCH] bug --- pages/digitalCourses/index.js | 38 ++++++++++++++++++++++++-------------- 1 files changed, 24 insertions(+), 14 deletions(-) diff --git a/pages/digitalCourses/index.js b/pages/digitalCourses/index.js index 4abba99..e7d403b 100644 --- a/pages/digitalCourses/index.js +++ b/pages/digitalCourses/index.js @@ -20,6 +20,7 @@ active: 0, activeItem: null, loading: false, + contentLoading: false, shoppingCartGetId: [], sorter: { value: "*", @@ -45,7 +46,7 @@ }, ], }, - sortActive: '' + sortActive: '', }, /** @@ -119,6 +120,9 @@ }, onTabsChange(event) { const value = event.detail.value + this.setData({ + contentLoading: true + }) this.getCourseList(this.data.tabList[value]) }, @@ -132,10 +136,10 @@ }) const data = { path: '*', - filterList: [{ - value: 'Normal', - field: 'state' - }], + // filterList: [{ + // value: 'Normal', + // field: 'state' + // }], queryType: '\\', searchList: [], size: '20', @@ -147,8 +151,12 @@ } } app.MG.store.getStoreChannelList(data).then((res) => { - // 鍘婚櫎鏁扮粍鏈�鍚庝竴涓厓绱� const newData = res.datas.slice(0, res.datas.length - 1) + newData.unshift({ + name: "鍏ㄩ儴", + pathList: newData[0].pathList[0], + id: "" + }) this.setData({ tabList: newData, loading: false @@ -172,8 +180,8 @@ if (this.data.searchValue) { searchObj = { 'Name*': this.data.searchValue.trim(), - '||isbn*': searchInputValue.value.trim(), - '||courseLeader*': searchInputValue.value.trim() + '||isbn*': this.data.searchValue.trim(), + '||courseLeader*': this.data.searchValue.trim() } } @@ -197,7 +205,9 @@ // // 缁勫悎鐨勫啓娉� 瑕佹煡璇㈢殑瀛楁:鍗囧簭鍜岄檷搴� const obj = { storeInfo: app.config.goodsStore, - path: item.pathList + '\\' + item.id, + // path: item.pathList + '\\' + item.id, + path: item.id ? item.pathList + '\\' + item.id : item.pathList, + queryType: "*", coverSize: { width: 260 }, @@ -222,12 +232,13 @@ app.MG.store.getProductList(obj).then((res) => { res.datas.forEach(item => { item.price = item.price.toFixed(2) + item.productLinkInfo = JSON.parse(item.productLinkInfo) }) - + // 鎺掗櫎鍏朵粬鍒嗙被閲岀殑鏁版嵁 this.setData({ - courseList: res.datas + courseList: res.datas, + contentLoading: false, }) - }) }, searchBook() { @@ -237,7 +248,6 @@ this.setData({ "sortActive": e.detail.value, }); - console.log(e) this.getCourseList(this.data.activeItem); }, courseDetail(e) { @@ -245,7 +255,7 @@ setNewView('productId', item.id) this.getCourseTypeListList() wx.navigateTo({ - url: '/pages/digitalCourses/digitalCoursesDetails/index?id=' + item.id, + url: '/pages/digitalCourses/digitalCoursesDetails/index?id=' + item.id + '&path=' + item.idPath }) }, -- Gitblit v1.9.1