From d9a89d83c2048a964f16ca179feb2b7f21b9d33a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 29 七月 2024 16:28:47 +0800
Subject: [PATCH] 提交
---
wechat_staff/pages/userinfo/collect.js | 23 +++++++++++++++++------
1 files changed, 17 insertions(+), 6 deletions(-)
diff --git a/wechat_staff/pages/userinfo/collect.js b/wechat_staff/pages/userinfo/collect.js
index 2ff7453..76e8ca9 100644
--- a/wechat_staff/pages/userinfo/collect.js
+++ b/wechat_staff/pages/userinfo/collect.js
@@ -15,6 +15,10 @@
pageSize: 10,
},
onLoad(options) {
+ },
+ onPullDownRefresh: function () {
+ console.log('涓嬫媺鍒锋柊');
+ this.setData({ dataList: [], pageNum: 1, total: 0 })
this.getList()
},
onReachBottom() {
@@ -66,10 +70,16 @@
pageNum
}).then(res => {
if (res.data) {
- this.setData({
- dataList: [...this.data.dataList, ...res.data.records || []],
- total: res.data.total
- })
+ res.data.pageNum = res.data.pageNum <=0?1: res.data.pageNum
+ if(pageNum == res.data.pageNum){
+ if(pageNum == 1){
+ this.setData({dataList:[],total:0})
+ }
+ this.setData({
+ dataList: [...this.data.dataList, ...res.data.records || []],
+ total: res.data.total
+ })
+ }
}
})
},
@@ -84,8 +94,9 @@
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
*/
- onShow() {
-
+ onShow() {
+ this.setData({pageNum:1})
+ this.getList()
},
/**
--
Gitblit v1.9.3