From 230c0da617bed5093b3b2832d9b53962bb5c6781 Mon Sep 17 00:00:00 2001 From: yiming <m13691596795@163.com> Date: 星期五, 22 三月 2024 10:46:39 +0800 Subject: [PATCH] 上拉刷新下拉加载 --- pages/retrievalPage/index.js | 26 ++++++++++++++++++++------ 1 files changed, 20 insertions(+), 6 deletions(-) diff --git a/pages/retrievalPage/index.js b/pages/retrievalPage/index.js index 9039b9a..3524d4a 100644 --- a/pages/retrievalPage/index.js +++ b/pages/retrievalPage/index.js @@ -41,7 +41,6 @@ const menu = wx.getMenuButtonBoundingClientRect(); // 鑳跺泭淇℃伅 const navBarHeight = (menu.top - systInfo.statusBarHeight) * 2 + menu.height; // 瀵艰埅鏍忛珮搴� this.setData({ - navBarHeight: navBarHeight, barHeight: systInfo.statusBarHeight, searchVal: options.searchVal @@ -492,7 +491,7 @@ }) - + wx.stopPullDownRefresh() }, bibliographyGet() { let bibliographyObj = {} @@ -533,6 +532,7 @@ }) }) + wx.stopPullDownRefresh() }, downloadData(event) { console.log(111); @@ -585,10 +585,7 @@ url: '/pages/bookExhibitionDetails/index?id=' + item.id + '&bookName=' + item.name // 鍋囪璺宠浆鍒拌鎯呴〉闈紝骞朵紶閫掍簡id鍙傛暟 }); }, - //瑙﹀簳鍑芥暟 - onReachBottom() { - console.log("涓婃媺鍔犺浇...."); - }, + //涓婃媺鍑芥暟 onPullDownRefresh() { console.log("涓嬫媺鍒锋柊..."); @@ -717,5 +714,22 @@ }, + // 涓嬫媺鍑芥暟 + onPullDownRefresh() { + if (this.data.tabValue == 4) { + this.setData({ + "pageCount.page": 1 + }) + this.bibliographyGet() + } else { + this.setData({ + "pageCount.page": 1 + }) + this.retrievalPageGet() + } + + + + }, }) \ No newline at end of file -- Gitblit v1.9.1