From 9cbf35d6931dcd08146fde948fae33a6aa055d30 Mon Sep 17 00:00:00 2001 From: linxi <957440651@qq.com> Date: Mon, 13 Apr 2026 18:41:39 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A5145=20=E3=80=90=E5=95=86=E5=9F=8E?= =?UTF-8?q?=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E9=A6=96=E9=A1=B5=E6=B5=B7?= =?UTF-8?q?=E6=8A=A5=E7=8A=B6=E6=80=81=E6=9C=AA=E5=AE=9E=E6=97=B6=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=EF=BC=8C=E9=9C=80=E9=87=8D=E5=90=AF=E5=B0=8F=E7=A8=8B?= =?UTF-8?q?=E5=BA=8F=E6=89=8D=E7=94=9F=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index.vue | 52 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) diff --git a/pages/home/index.vue b/pages/home/index.vue index d8d5bdb..02c5256 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -429,6 +429,7 @@ export default { mixins: [pageListenMixins, goCartMixin, GuideMixins], data() { return { + isFirstLoad: true, isOldUserPopupShow: 0, webUrl: this.$VUE_APP_RESOURCES_URL, // 状态栏高度 @@ -514,6 +515,10 @@ export default { onShow() { this.pageToShowHandle() uni.$emit('updateUnreadMessageCount') + if (!this.isFirstLoad) { + this.refreshPageData() + } + this.isFirstLoad = false }, onHide() { this.pageToHideHandle() @@ -1495,6 +1500,53 @@ export default { uni.hideLoading() }) }, + refreshPageData() { + getHomeData({ cityName: this.cityName }).then(res => { + const { success, data } = res + if (success && data) { + this.$set(this, 'banner', data.banner || []) + this.$set(this, 'menus', data.menus || []) + this.$set(this, 'landmarkGoodsImage', data.landmarkGoodsImage || {}) + this.$set(this, 'countyFamousImage', data.countyFamousImage || {}) + this.$set(this, 'oldUserPopup', data.oldUserPopup || {}) + this.$set(this, 'contentHomestay', data.contentHomestayV2 || []) + this.$set(this, 'contentFestival', data.contentFestivalV2 || []) + this.$set(this, 'newZone', data.newGoods || []) + this.$set(this, 'hasExperienceCoupon', data.hasExperienceCoupon || 0) + this.$set(this, 'hasUnusedExperienceCoupon', data.hasUnusedExperienceCoupon || 0) + this.$set(this, 'experienceCouponImage', data.experienceCouponImage || '') + this.$set(this, 'isOldUserPopupShow', data.isOldUserPopupShow || 0) + this.indexVideo = data.indexVideo ? data.indexVideo.videoUrl : '' + this.lotteryCanDraw = data.lotteryCanDraw || false + if (data.bastList) { + const newBastLeftList = [] + const newBastRightList = [] + for (let i = 0; i < data.bastList.length; i++) { + if (i % 2 === 0) { + if (i === 4 && data.hotelList.length > 0) { + newBastLeftList.push({ + type: 'hotel', + list: data.hotelList + }) + } + newBastLeftList.push(data.bastList[i]) + } + if (i % 2 === 1) { + if (i === 3 && data.contentBest.length > 0) { + newBastRightList.push({ + type: 'swiper', + list: data.contentBest + }) + } + newBastRightList.push(data.bastList[i]) + } + } + this.bastLeftList = newBastLeftList + this.bastRightList = newBastRightList + } + } + }).catch(() => {}) + }, goRoll(item) { if (item.uniapp_url) { this.$yrouter.push(item.uniapp_url)