From 14de3e90ae29af2ccfd51b08c6a11ab02fe8f8e7 Mon Sep 17 00:00:00 2001 From: 闫增涛 <1829501689@qq.com> Date: 星期二, 05 三月 2024 19:02:35 +0800 Subject: [PATCH] feat(合并代码): 和冰帝阿 --- pages/bookServices/list/index.js | 54 +++++++++++++++++++++++++++++++++++++++++++----------- 1 files changed, 43 insertions(+), 11 deletions(-) diff --git a/pages/bookServices/list/index.js b/pages/bookServices/list/index.js index 7388ef4..890c3b9 100644 --- a/pages/bookServices/list/index.js +++ b/pages/bookServices/list/index.js @@ -39,6 +39,10 @@ stairCode: '', // 涓�绾у垎绫婚�変腑椤� secondCode: '', // 浜岀骇鍒嗙被閫変腑椤� sort: '', // 鎺掑簭 + enable: false, + loadingProps: { + size: '50rpx', + }, }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 @@ -74,10 +78,20 @@ this.setData({ 'stairList.value': options.stairCode, stairCode: options.stairCode, - secondCode: options.secondCode, - 'secondList.value': options.secondCode, path: `${options.assortCode}\\${options.stairCode}`, }); + } + // 浜岀骇鍒嗙被璧嬪�� + if (options.secondCode) { + this.setData({ + secondCode: options.secondCode, + pathList: [{ + Path: options.secondCode, + Type: '*', + StoreRefCode: app.config.goodsStore, + } + ], + }) } // 鑾峰彇浜岀骇鍒嗙被 this.getSecondList(`${options.assortCode}\\${options.stairCode}`); @@ -90,37 +104,43 @@ /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚 */ - onReady() {}, + onReady() { + }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず */ - onShow() {}, + onShow() { + }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌 */ - onHide() {}, + onHide() { }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇 */ - onUnload() {}, + onUnload() { }, /** * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔 */ - onPullDownRefresh() {}, + onPullDownRefresh() { + console.log('涓嬫媺'); + }, /** * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� */ - onReachBottom() {}, + onReachBottom(e) { + console.log('搴曢儴'); + }, /** * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜� */ - onShareAppMessage() {}, + onShareAppMessage() { }, goBack() { wx.navigateBack(); }, @@ -179,8 +199,11 @@ } this.setData({ 'secondList.options': options, - 'secondList.value': this.data.secondCode, }); + const second = [this.data.secondCode] + this.setData({ + 'secondList.value': second + }) }); }, // 鑾峰彇閲嶇偣椤圭洰 @@ -290,6 +313,7 @@ app.MG.store.getProductList(query).then((res) => { this.setData({ bookList: res.datas, + enable: false }); }); }, @@ -299,6 +323,7 @@ ? `${this.data.assortCheck.code}\\${e.detail.value}` : this.data.assortCheck.code; this.setData({ + pathList: [], stairCode: e.detail.value, secondCode: '', path: path, @@ -309,7 +334,6 @@ }, // 浜岀骇鍒嗙被鍒囨崲 onChangeSecond(e) { - console.log(e); const pathList = []; for (let index = 0; index < e.detail.value.length; index++) { const element = e.detail.value[index]; @@ -323,6 +347,10 @@ pathList: pathList, 'secondList.value': e.detail.value, }); + + }, + // + onConfirmSecond() { this.getBookList(this.data.path); }, // 閲嶇偣椤圭洰鏀瑰彉 @@ -394,4 +422,8 @@ url: `/pages/bookServices/detail/index?id=${book.id}&name=${book.name}`, }); }, + onRefresh() { + this.setData({ enable: true }); + this.getBookList(this.data.path) + }, }); -- Gitblit v1.9.1