From 1c938e00077e0747e62283c62b20f250d87242fe Mon Sep 17 00:00:00 2001 From: Yer <17633066053@163.com> Date: Wed, 24 May 2023 16:54:15 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20:art:=20=E4=BC=98=E5=8C=96=E6=88=91?= =?UTF-8?q?=E7=9A=84=E6=94=B6=E8=97=8F=E5=92=8C=E8=B6=B3=E8=BF=B9=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/mine/myCollect.vue | 31 ++++++++++++++++++++++--------- pages/mine/myTracks.vue | 1 + 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/pages/mine/myCollect.vue b/pages/mine/myCollect.vue index 9a207c5..e10766f 100644 --- a/pages/mine/myCollect.vue +++ b/pages/mine/myCollect.vue @@ -107,20 +107,33 @@ }; }, onShow() { - this.getGoodList(); - this.getStoreList(); + this.fetchReloadOrNextPage('reload') }, onReachBottom() { - if (this.tabCurrentIndex == 0) { - this.navList[0].params.pageNumber++; - this.getGoodList(); - } else { - this.navList[1].params.pageNumber++; - this.getStoreList(); - } + this.fetchReloadOrNextPage('next') }, methods: { + // 刷新或者下一页 + fetchReloadOrNextPage(type) { + if(type == 'next'){ + this.navList[this.tabCurrentIndex].params.pageNumber ++; + if (this.tabCurrentIndex == 0) { + this.getGoodList(); + } else { + this.getStoreList(); + } + } + else{ + this.navList[0].params.pageNumber = 1; + this.navList[1].params.pageNumber = 1; + this.goodList = []; + this.storeList = []; + this.getGoodList(); + this.getStoreList(); + } + }, + /** * 打开商品左侧取消收藏 */ diff --git a/pages/mine/myTracks.vue b/pages/mine/myTracks.vue index 1f712da..300a222 100644 --- a/pages/mine/myTracks.vue +++ b/pages/mine/myTracks.vue @@ -77,6 +77,7 @@ this.getList(); }, onShow() { + this.params.pageNumber = 1 this.trackList = []; this.getList(); },