From b4b6fed1abbf260c913467e2269fe6df945e1c8a Mon Sep 17 00:00:00 2001 From: linxi <957440651@qq.com> Date: Wed, 22 Apr 2026 15:19:51 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A5173=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=E7=94=84?= =?UTF-8?q?=E9=80=89=E5=A5=BD=E7=A4=BC=E7=9A=84=E8=BD=AE=E6=92=AD=EF=BC=8C?= =?UTF-8?q?=E9=95=BF=E6=97=B6=E9=97=B4=E7=86=84=E5=B1=8F=E5=86=8D=E6=89=93?= =?UTF-8?q?=E5=BC=80=EF=BC=8C=E9=A6=96=E9=A1=B5=E7=94=84=E9=80=89=E5=A5=BD?= =?UTF-8?q?=E7=A4=BC=E7=9A=84=E8=BD=AE=E6=92=AD=E4=BC=9A=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E5=8D=A1=E9=A1=BF=EF=BC=8C=E7=9B=AE=E5=89=8D=E5=8F=91=E7=8E=B0?= =?UTF-8?q?=E6=9C=89=E8=BF=99=E4=B8=AA=E7=8E=B0=E8=B1=A1=E7=9A=84=E6=9C=BA?= =?UTF-8?q?=E5=9E=8B=EF=BC=9AiPhone=20XR=E3=80=81iPhone=2016Pro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/home/index.vue | 32 +++++++++++++++++++++++++++++--- 1 file changed, 29 insertions(+), 3 deletions(-) diff --git a/pages/home/index.vue b/pages/home/index.vue index 02c5256..5b9db8b 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -200,7 +200,7 @@ - + @@ -476,6 +476,8 @@ export default { keywordIndex: 0, shareData: {}, currentIndex: 0, + newZoneSwiperKey: 0, + newZoneResumeTimer: null, // 轮播组件实例 swiperInstances: { productSwiper: true, @@ -543,17 +545,33 @@ export default { }, // 页面显示时恢复轮播 pageToShowHandle() { - // 恢复所有轮播组件的自动播放 + // 恢复所有轮播组件的自动播放,甄选好礼轮播先停后启,避免 iOS 熄屏恢复后卡顿 + if (this.newZoneResumeTimer) { + clearTimeout(this.newZoneResumeTimer) + this.newZoneResumeTimer = null + } this.swiperInstances = { productSwiper: true, homestay: true, banner: true, festival: true, - newZone: true, + newZone: false, } + this.currentIndex = 0 + this.newZoneSwiperKey += 1 + this.$nextTick(() => { + this.newZoneResumeTimer = setTimeout(() => { + this.swiperInstances.newZone = true + this.newZoneResumeTimer = null + }, 120) + }) }, // 页面隐藏时暂停轮播 pageToHideHandle() { + if (this.newZoneResumeTimer) { + clearTimeout(this.newZoneResumeTimer) + this.newZoneResumeTimer = null + } this.swiperInstances = { productSwiper: false, homestay: false, @@ -566,6 +584,12 @@ export default { bindSwiperInstance(e, key) { // this.swiperInstances[key] = e.detail }, + resetNewZoneCurrentIndex() { + const products = (this.newZone && this.newZone.indexProducts) || [] + if (!products.length || this.currentIndex >= products.length) { + this.currentIndex = 0 + } + }, changeRecommendKeyword(e) { this.keywordIndex = e }, @@ -1459,6 +1483,7 @@ export default { _this.$set(_this, 'contentHomestay', data.contentHomestayV2 || []) _this.$set(_this, 'contentFestival', data.contentFestivalV2 || []) _this.$set(_this, 'newZone', data.newGoods || []) + _this.resetNewZoneCurrentIndex() _this.$set(_this, 'hasExperienceCoupon', data.hasExperienceCoupon || 0) _this.$set(_this, 'hasUnusedExperienceCoupon', data.hasUnusedExperienceCoupon || 0) _this.$set(_this, 'experienceCouponImage', data.experienceCouponImage || '') @@ -1512,6 +1537,7 @@ export default { this.$set(this, 'contentHomestay', data.contentHomestayV2 || []) this.$set(this, 'contentFestival', data.contentFestivalV2 || []) this.$set(this, 'newZone', data.newGoods || []) + this.resetNewZoneCurrentIndex() this.$set(this, 'hasExperienceCoupon', data.hasExperienceCoupon || 0) this.$set(this, 'hasUnusedExperienceCoupon', data.hasUnusedExperienceCoupon || 0) this.$set(this, 'experienceCouponImage', data.experienceCouponImage || '')