From 437634b6c3f4fb1fd05a64f62feb0d8501e0360d Mon Sep 17 00:00:00 2001 From: litian <C21AF165> Date: 星期五, 29 三月 2024 16:03:20 +0800 Subject: [PATCH] yangshi --- packageBookService/pages/bookServices/list/index.js | 65 +++++++++++++++++++++++++++----- 1 files changed, 54 insertions(+), 11 deletions(-) diff --git a/packageBookService/pages/bookServices/list/index.js b/packageBookService/pages/bookServices/list/index.js index 868752e..a2bf820 100644 --- a/packageBookService/pages/bookServices/list/index.js +++ b/packageBookService/pages/bookServices/list/index.js @@ -32,7 +32,9 @@ secondList: { value: [], options: [], + disabled: false, }, + disabledSecondList: false, majorProjectList: { value: [], options: [], @@ -49,7 +51,9 @@ size: '50rpx' }, loading: false, - noData: false + noData: false, + showDropdown: false, + isRequesting: false, }, /** * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇 @@ -140,11 +144,13 @@ onReachBottom(e) { const flag = this.data.bookList.length < this.data.pageCount.total if (flag) { - this.setData({ - isMore: true, - "pageCount.page": this.data.pageCount.page + 1 - }) - this.getBookList(this.data.path) + if (!this.data.isRequesting) { + this.setData({ + isMore: true, + "pageCount.page": this.data.pageCount.page + 1 + }) + this.getBookList(this.data.path) + } } else { this.setData({ isMore: true, @@ -240,7 +246,7 @@ refCodes: [type], }; app.MG.store.getProductTypeField(query).then((res) => { - array = JSON.parse(res[0].config).option; + array = JSON.parse(res[0].config).option.filter(item => item.value == this.data.assortCheck.code); for (let index = 0; index < array.length; index++) { const element = array[index]; if (element.child) { @@ -278,9 +284,13 @@ }, // 鑾峰彇鍥句功鍒楄〃 getBookList(path) { + if (this.data.isRequesting) { + return false; + } this.setData({ loading: true, - noData: false + noData: false, + isRequesting: true }) let sort; let pathObj = {}; @@ -339,13 +349,23 @@ bookList: res.datas, enable: false, "pageCount.total": res.total, - loading: false + loading: false, + isRequesting: false }); - console.log('鍥句功鍒楄〃', res.datas); if (!res.datas.length) { this.setData({ - noData: true + noData: true, }) + if (!this.data.pathList.length) { + // 鏈�夋嫨浜岀骇鍒嗙被锛屼笖鏃犲浘涔� + this.setData({ + disabledSecondList: true + }) + } else { + this.setData({ + disabledSecondList: false + }) + } } }); }, @@ -354,6 +374,7 @@ const path = e.detail.value.length ? `${this.data.assortCheck.code}\\${e.detail.value}` : this.data.assortCheck.code; + console.log(this.data.path); this.setData({ pathList: [], stairCode: e.detail.value, @@ -363,6 +384,16 @@ }); this.getBookList(path); this.getSecondList(path); + if (e.detail.value == '') { + this.setData({ + disabledSecondList: true + }) + } else { + this.setData({ + disabledSecondList: false + }) + } + console.log(this.data.disabledSecondList); }, // 浜岀骇鍒嗙被鍒囨崲 onChangeSecond(e) { @@ -461,4 +492,16 @@ }); this.getBookList(this.data.path) }, + openDropdown() { + console.log('灞曞紑鍝�', ); + this.setData({ + showDropdown: true + }) + }, + closeDropdown() { + console.log('鍏抽棴'); + this.setData({ + showDropdown: false + }) + } }); \ No newline at end of file -- Gitblit v1.9.1