From d9a89d83c2048a964f16ca179feb2b7f21b9d33a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 29 七月 2024 16:28:47 +0800
Subject: [PATCH] 提交

---
 wechat_jiaxuan/pages/userinfo/collect.js |   29 ++++++++++++++++-------------
 1 files changed, 16 insertions(+), 13 deletions(-)

diff --git a/wechat_jiaxuan/pages/userinfo/collect.js b/wechat_jiaxuan/pages/userinfo/collect.js
index 48a16c4..2e40648 100644
--- a/wechat_jiaxuan/pages/userinfo/collect.js
+++ b/wechat_jiaxuan/pages/userinfo/collect.js
@@ -11,18 +11,29 @@
 
     dataList: [],
     total: 0,
-    pageNum: 1,
+    pageNum: 1, 
     pageSize: 10,
   },
   onLoad(options) {
     this.getList()
   },
+  onPullDownRefresh: function () {
+    console.log('涓嬫媺鍒锋柊');
+    this.setData({ dataList: [], pageNum: 1, total: 0 })
+    this.getList()
+  },
   onReachBottom() {
-    if(this.data.total > this.data.dataset.length){
-      this.setData({ pageNum: this.data.pageNum + 1 })
+    console.log('瑙﹀簳浜嬩欢');
+    const { total, dataList, pageNum } = this.data
+    if(total > dataList.length){
+      this.setData({ pageNum: pageNum + 1 })
       this.getList()
+    }else{
+      wx.showToast({
+        title: '鏆傛棤鏇村鏁版嵁',
+        icon: 'none'
+      })
     }
-    // this.pageN
   },
   tabsChange(e) {
     const activeTabs = e.currentTarget.dataset.val
@@ -61,7 +72,7 @@
     }).then(res => {
       if (res.data) {
         this.setData({
-          dataList: [...this.data.dataset, ...res.data.records || []],
+          dataList: [...this.data.dataList, ...res.data.records || []],
           total: res.data.total
         })
       }
@@ -95,14 +106,6 @@
   onUnload() {
 
   },
-
-  /**
-   * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
-   */
-  onPullDownRefresh() {
-
-  },
-
   /**
    * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
    */

--
Gitblit v1.9.3