From b4ac08ab9b237e42d01a95d310a650b8d32dbff6 Mon Sep 17 00:00:00 2001 From: wangdong <1551135706@qq.com> Date: Wed, 19 Jun 2024 13:40:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=A8=E8=8D=90=E5=95=86=E5=93=81=E5=88=B7?= =?UTF-8?q?=E6=96=B0=E6=97=B6=E6=9C=BA=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/cart/index.vue | 13 +++++++------ pages/index/index.vue | 10 +++++----- pages/user/index.vue | 12 +++++++----- 3 files changed, 19 insertions(+), 16 deletions(-) diff --git a/pages/cart/index.vue b/pages/cart/index.vue index 4fddaa0..b78f5a3 100644 --- a/pages/cart/index.vue +++ b/pages/cart/index.vue @@ -277,6 +277,13 @@ setCartTabBadge() } }, + onLoad() { + this.recommendPage = 1; + this.recommendFinish = false; + this.recommendLoadTitle = ''; + this.goodsRecommend = []; + this.getSuggest() + }, /** * 生命周期函数--监听页面显示 */ @@ -285,12 +292,6 @@ this.checkedIds = uni.getStorageSync(CartIdsIndex) // 获取购物车商品列表 checkLogin() ? this.getCartList() : this.isLoading = false - - this.recommendPage = 1; - this.recommendFinish = false; - this.recommendLoadTitle = ''; - this.goodsRecommend = []; - this.getSuggest() }, onReachBottom() { if (!this.recommendFinish) { diff --git a/pages/index/index.vue b/pages/index/index.vue index 52bd337..416fbe3 100644 --- a/pages/index/index.vue +++ b/pages/index/index.vue @@ -1188,6 +1188,11 @@ this.queryBannerList(); this.getStore(); this.getAuthorize(); + this.recommendPage = 1; + this.recommendFinish = false; + this.recommendLoadTitle = ''; + this.goodsRecommend = []; + this.getSuggest() }, onShow() { if (this.list[this.current].name === '广场') { @@ -1195,11 +1200,6 @@ } this.getWxAppStyle(); this.isLogin = uni.getStorageSync("AccessToken") ? true : false - this.recommendPage = 1; - this.recommendFinish = false; - this.recommendLoadTitle = ''; - this.goodsRecommend = []; - this.getSuggest() }, onPageScroll(e) { if (e.scrollTop <= 200) { // 当滚动到顶部且向下滑动时为true diff --git a/pages/user/index.vue b/pages/user/index.vue index 3b8e350..2f67a76 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -695,6 +695,13 @@ recommendLoadTitle: '' } }, + onLoad() { + this.recommendPage = 1; + this.recommendFinish = false; + this.recommendLoadTitle = ''; + this.goodsRecommend = []; + this.getSuggest() + }, onShow(options) { if (uni.getStorageSync("userInfo").user_id) { this.isLogin = true @@ -710,11 +717,6 @@ recovery_order: {} } } - this.recommendPage = 1; - this.recommendFinish = false; - this.recommendLoadTitle = ''; - this.goodsRecommend = []; - this.getSuggest() }, onReachBottom() { if (!this.recommendFinish) {