From 56be3d07c58f3122ce252cf65c68da7821e0970e Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 26 七月 2024 17:02:52 +0800
Subject: [PATCH] 提交

---
 wechat_staff/pages/userinfo/collect.js |   20 +++++++++++++-------
 1 files changed, 13 insertions(+), 7 deletions(-)

diff --git a/wechat_staff/pages/userinfo/collect.js b/wechat_staff/pages/userinfo/collect.js
index 2ff7453..55c2bcd 100644
--- a/wechat_staff/pages/userinfo/collect.js
+++ b/wechat_staff/pages/userinfo/collect.js
@@ -15,7 +15,6 @@
     pageSize: 10,
   },
   onLoad(options) {
-    this.getList()
   },
   onReachBottom() {
     console.log('瑙﹀簳浜嬩欢');
@@ -66,10 +65,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 +89,9 @@
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
    */
-  onShow() {
-
+  onShow() { 
+    this.setData({pageNum:1})
+    this.getList()
   },
 
   /**

--
Gitblit v1.9.3