From 706cee2240abc16e4ab904d40291beccc22bbf70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B0=8F=E8=8E=AB=E5=94=90=E5=B0=BC?= <1431128779@qq.com> Date: Sun, 18 Aug 2024 20:41:03 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=9B=BE=E5=BA=93?= =?UTF-8?q?=E7=80=91=E5=B8=83=E6=B5=81=E6=A8=A1=E5=BC=8F=E6=97=A0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE=E4=B8=8B=EF=BC=8C=E5=88=87=E6=8D=A2=E5=85=B6=E4=BB=96?= =?UTF-8?q?=E5=88=86=E7=B1=BB=E6=9C=89=E6=95=B0=E6=8D=AE=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E6=95=B0=E6=8D=AEbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/tabbar/gallery/gallery.vue | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/pages/tabbar/gallery/gallery.vue b/pages/tabbar/gallery/gallery.vue index e32a677..4c056b6 100644 --- a/pages/tabbar/gallery/gallery.vue +++ b/pages/tabbar/gallery/gallery.vue @@ -111,13 +111,13 @@ export default { this.dataList = [] this.isLoadMore = false; this.queryParams.page = 1; - this.fnGetData(); + this.fnGetData(true); }, onReachBottom(e) { if (this.hasNext) { this.queryParams.page += 1; this.isLoadMore = true; - this.fnGetData(); + this.fnGetData(false); } else { uni.showToast({ icon: 'none', @@ -130,17 +130,9 @@ export default { this.fnResetSetAniWaitIndex(); this.queryParams.group = this.category.list[index].name; this.queryParams.page = 1; - this.fnToTopPage(); - if (this.galleryConfig.useWaterfall) { - this.$nextTick(() => { - this.$refs.wafll.clear(); - this.dataList = []; - this.fnGetData(); - }) - } else { - this.dataList = []; - this.fnGetData(); - } + this.fnToTopPage(); + this.dataList = []; + this.fnGetData(true); }, fnGetCategory() { this.$httpApi.v2.getPhotoGroupList({ @@ -155,11 +147,11 @@ export default { }); if (this.category.list.length !== 0) { this.queryParams.group = this.category.list[0].name; - this.fnGetData(); + this.fnGetData(true); } }); }, - fnGetData() { + fnGetData(isClearWallfull = false) { // 设置状态为加载中 if (!this.isLoadMore) { this.loading = 'loading'; @@ -182,6 +174,9 @@ export default { } if (this.galleryConfig.useWaterfall) { this.$nextTick(() => { + if(isClearWallfull){ + this.$refs.wafll.clear() + } this.$refs.wafll.pushData(_list) }) }