From c33712665ad4ee5d8d48625ebdc316581bb7948e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=94=90=E6=98=8E=E6=98=8E?= <970899069@qq.com> Date: Tue, 25 Apr 2023 15:32:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=90=88=E5=90=8C=E8=AE=B0=E5=BD=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- manifest.json | 2 +- pages/user/signLog.vue | 68 ++++++++++++++++++++++++++++++++---------- 2 files changed, 53 insertions(+), 17 deletions(-) diff --git a/manifest.json b/manifest.json index 52e1489..1140d8b 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "name" : "抖火", "appid" : "__UNI__C305C03", "description" : "纵有疾风起,人生不言弃", - "versionName" : "1.4.2", + "versionName" : "1.4.3", "versionCode" : 104, "transformPx" : false, /* 5+App特有相关 */ diff --git a/pages/user/signLog.vue b/pages/user/signLog.vue index 1213dd3..a192594 100644 --- a/pages/user/signLog.vue +++ b/pages/user/signLog.vue @@ -1,21 +1,36 @@ @@ -24,7 +39,10 @@ export default { data() { return { - logs: [], + status : 'loading', + isLoding: false, + logs : [], + page : { current : 0 } }; }, created() { @@ -37,10 +55,14 @@ mask : true }) getSignLogs({ - page: 1 + page: this.page.current }).then(res => { - this.logs = res.data - this.page = res.page + let { data, page } = res; + let atArr = page.current == 1 ? [] : this.getLog + this.logs = atArr.concat(data) + this.page = page + this.status = !page.has_more ? 'nomore': 'loading' + this.isLoding = !page.has_more uni.hideLoading() }).catch(err => { uni.showToast({ @@ -55,6 +77,13 @@ params : { id } }) } + }, + onReachBottom(){ + this.isLoding = true + if(this.page.has_more){ + this.page.current++ + this.getLog() + } } } @@ -68,6 +97,7 @@ border-radius: $radius; padding: $padding; position: relative; + margin-bottom: 20rpx; // .log-icon{ position: absolute; right: $margin; top: 50%; margin-top: -14rpx; } .flex{ display: flex; @@ -77,4 +107,10 @@ label{ color: gray; } } } + + // 分页加载 + .pages-loding{ padding: 10rpx; } + + // 记录为空 + .null-pages{ display: flex; align-items: center; justify-content: space-around; height: 80vh;}