From b0128497cea9d7ce703e02652a884e250db4de04 Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期二, 02 四月 2024 15:06:58 +0800 Subject: [PATCH] 检索bug2 --- pages/bookExhibitionList/index.js | 42 ++++++++++++++++++++++++++++++++++++------ 1 files changed, 36 insertions(+), 6 deletions(-) diff --git a/pages/bookExhibitionList/index.js b/pages/bookExhibitionList/index.js index a16ce9e..6e7bee3 100644 --- a/pages/bookExhibitionList/index.js +++ b/pages/bookExhibitionList/index.js @@ -8,6 +8,9 @@ * 椤甸潰鐨勫垵濮嬫暟鎹� */ data: { + totalSize: '', + start: 0, + isMore: null, keynoteDisabled: true, value: '', keyword: '', @@ -164,9 +167,32 @@ onPullDownRefresh() { }, - onPullDownRefresh() { - this.data.page.size = 16 //鏇存敼鏄剧ず鐨勫�� - this.bookExhibitionGet(); // 璋冪敤鏂规硶鍔犺浇鏇村鏁版嵁 + // onPullDownRefresh() { + // this.data.page.size = 16 //鏇存敼鏄剧ず鐨勫�� + // this.bookExhibitionGet(); // 璋冪敤鏂规硶鍔犺浇鏇村鏁版嵁 + // }, + + onScrollToLower() { + console.log(789); + console.log(this.data.bookExhibitionList.length); + console.log(this.data.totalSize); + if (this.data.bookExhibitionList.length < this.data.totalSize) { + this.setData({ + isMore: true, + start: this.data.start + 1 + }) + this.bookExhibitionGet() + } else { + this.setData({ + isMore: true, + }) + setTimeout(() => { + this.setData({ + isMore: false + }) + console.log('300'); + }, 300) + } }, /** * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁� @@ -251,7 +277,10 @@ 'bookClassification*': this.data.keynoteValue || [], ...searchObj }, - paging: this.data.page, + paging: { + start: '0', + size: this.data.start * 10 + }, sort: sort, // coverSize: { // width: 100 @@ -277,9 +306,10 @@ } const list = [...res.datas] - + console.log(res); this.setData({ - bookExhibitionList: list + bookExhibitionList: list, + totalSize: res.total }) // 鍒ゆ柇鏁版嵁闀垮害 console.log(list.length, 'list.length'); -- Gitblit v1.9.1