From 4eaf6d8835d4e9b204f13d012f13bbd8a94a21cc Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期日, 21 七月 2024 22:52:37 +0800
Subject: [PATCH] lll
---
wechat_jiaxuan/pages/userinfo/mysub.js | 73 +++++++++---------------------------
1 files changed, 18 insertions(+), 55 deletions(-)
diff --git a/wechat_jiaxuan/pages/userinfo/mysub.js b/wechat_jiaxuan/pages/userinfo/mysub.js
index 8d090c3..c545e33 100644
--- a/wechat_jiaxuan/pages/userinfo/mysub.js
+++ b/wechat_jiaxuan/pages/userinfo/mysub.js
@@ -9,15 +9,24 @@
dataList: [],
total: 0,
- page: 0,
+ page: 1,
capacity: 10,
},
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
- */
onLoad(options) {
this.getList()
+ },
+ onReachBottom() {
+ console.log('瑙﹀簳浜嬩欢');
+ const { total, dataList, page } = this.data
+ if(total > dataList.length){
+ this.setData({ page: page + 1 })
+ this.getList()
+ }else{
+ wx.showToast({
+ title: '鏆傛棤鏇村鏁版嵁',
+ icon: 'none'
+ })
+ }
},
getList() {
const { page, capacity, activeTabs} = this.data
@@ -26,61 +35,15 @@
type: activeTabs
},page,capacity
}).then(res => {
- this.setData({ dataList: res.data.records })
+ this.setData({
+ dataList: res.data.records,
+ total: res.data.total,
+ })
})
},
tabsChange(e) {
const activeTabs = e.currentTarget.dataset.val
this.setData({ activeTabs, dataList: [], total: 0, page: 0, })
this.getList()
- },
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
- */
- onReady() {
-
- },
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
- */
- onShow() {
-
- },
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰闅愯棌
- */
- onHide() {
-
- },
-
- /**
- * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍗歌浇
- */
- onUnload() {
-
- },
-
- /**
- * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
- */
- onPullDownRefresh() {
-
- },
-
- /**
- * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�
- */
- onReachBottom() {
-
- },
-
- /**
- * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
- */
- onShareAppMessage() {
-
}
})
\ No newline at end of file
--
Gitblit v1.9.3