From 3e30f5e18f9a520aa4f081793061b9d0e5acc2ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Tue, 10 May 2022 12:06:28 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=88=91=E7=9A=84=E8=B6=B3?= =?UTF-8?q?=E8=BF=B9=E5=88=86=E9=A1=B5bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/m-city/m-city.vue | 2 +- pages/mine/myTracks.vue | 40 ++++++++++++++---------------------- 2 files changed, 16 insertions(+), 26 deletions(-) diff --git a/components/m-city/m-city.vue b/components/m-city/m-city.vue index c4cd959..b24fe46 100644 --- a/components/m-city/m-city.vue +++ b/components/m-city/m-city.vue @@ -200,7 +200,7 @@ export default { this.tabCurrentIndex++; // 当前距离重新为最上面 - this.scrollTop = 0; + this.$set(this,'scrollTop',0) } } else { this.$emit("funcValue", this.tabbars); diff --git a/pages/mine/myTracks.vue b/pages/mine/myTracks.vue index a7da248..b485793 100644 --- a/pages/mine/myTracks.vue +++ b/pages/mine/myTracks.vue @@ -1,19 +1,16 @@ @@ -49,7 +46,7 @@ export default { data() { return { - loadStatus: "more", //底部下拉加载状态 + whetherEmpty: false, //是否数据为空 params: { pageNumber: 1, @@ -57,14 +54,12 @@ order: "desc", sort: "updateTime", }, - options: [ - { - text: '删除', - style: { - backgroundColor: '#dd524d' - } + options: [{ + text: '删除', + style: { + backgroundColor: '#dd524d' } - ], + }], trackList: [], //足迹列表 }; }, @@ -73,12 +68,11 @@ * 滑到底部加载下一页数据 */ onReachBottom() { - if (this.loadStatus != "noMore") { - this.params.pageNumber++; - this.getList(); - } + this.params.pageNumber++; + this.getList(); }, - onLoad() { + onShow() { + this.trackList = []; this.getList(); }, onPullDownRefresh() { @@ -130,12 +124,8 @@ let data = res.data.result; if (data.total == 0) { this.whetherEmpty = true; - } else if (data.total < 10) { - this.loadStatus = "noMore"; - this.trackList.push(...data); } else { this.trackList.push(...data); - if (data.length < 10) this.loadStatus = "noMore"; } } });