From 824a9f93de6155d6cb9a71810b134f6fd8929647 Mon Sep 17 00:00:00 2001 From: linxi <957440651@qq.com> Date: Tue, 25 Nov 2025 10:18:43 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A4655=20=E3=80=90=E6=97=85=E5=B1=85?= =?UTF-8?q?=E5=95=86=E5=9F=8E=E5=B0=8F=E7=A8=8B=E5=BA=8F=E3=80=91=E5=9C=A8?= =?UTF-8?q?=E9=A6=96=E9=A1=B5=E7=86=84=E5=B1=8F=E6=88=96=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=BD=AF=E4=BB=B610=E7=A7=92=E9=92=9F=E4=BB=A5=E4=B8=8A?= =?UTF-8?q?=EF=BC=8C=E7=94=84=E9=80=89=E5=A5=BD=E7=A4=BC=E8=BD=AE=E6=92=AD?= =?UTF-8?q?=E5=95=86=E5=93=81=E4=BC=9A=E5=87=BA=E7=8E=B0=E5=BC=82=E5=B8=B8?= =?UTF-8?q?=E6=8A=96=E5=8A=A8?= 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 c6fd564..a2f9875 100644 --- a/pages/home/index.vue +++ b/pages/home/index.vue @@ -45,6 +45,8 @@ autoplay circular style="height: 510rpx;" + :duration="500" + @animationfinish="bindSwiperInstance($event, 'banner')" > - - + + @@ -301,6 +305,8 @@ circular autoplay :interval="3000" + :duration="500" + @animationfinish="bindSwiperInstance($event, 'productSwiper')" > { + swiper && swiper.autoplayStart && swiper.autoplayStart() + }) + }, + // 页面隐藏时暂停轮播 + pageToHideHandle() { + // 暂停所有轮播组件的自动播放 + Object.values(this.swiperInstances).forEach(swiper => { + swiper && swiper.autoplayStop && swiper.autoplayStop() + }) + }, + // 绑定轮播组件实例 + bindSwiperInstance(e, key) { + this.swiperInstances[key] = e.detail + }, changeRecommendKeyword(e) { this.keywordIndex = e },