From 6a3445a0ccd5898334fc2850f1e6d756cfefa0f6 Mon Sep 17 00:00:00 2001 From: modendeveloper Date: Thu, 19 Dec 2024 00:14:12 +0800 Subject: [PATCH] =?UTF-8?q?Fix=EF=BC=9A2881=20=E3=80=90=E5=8D=83=E5=8E=BF?= =?UTF-8?q?=E5=90=8D=E5=93=81=E3=80=91=E5=8D=83=E5=8E=BF=EF=BC=8C=E5=8E=BF?= =?UTF-8?q?=E5=9F=8E=E8=B5=84=E8=AE=AF=E9=9C=80=E8=A6=81=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E8=A7=86=E9=A2=91=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pkg_product/views/famousQianxianShop.vue | 41 +++++++++++++++++++++++- 1 file changed, 40 insertions(+), 1 deletion(-) diff --git a/pkg_product/views/famousQianxianShop.vue b/pkg_product/views/famousQianxianShop.vue index 5f0691f..b488cde 100644 --- a/pkg_product/views/famousQianxianShop.vue +++ b/pkg_product/views/famousQianxianShop.vue @@ -33,6 +33,7 @@ object-fit="contain" play-btn-position="center" class="video" + id="coverVideo" /> @@ -171,12 +172,24 @@ + @@ -704,6 +717,7 @@ export default { // 产品 leftList: [], rightList: [], + videoPlayers:[] } }, // 必须在页面加 onPageScroll(e){} ,才能滑动显示背景 @@ -1050,7 +1064,27 @@ export default { infoClick(info) { // this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id) }, - infoItemViewClick(item) { + infoItemViewClick(item, index) { + if(item.type === 2) { + const coverCtx = uni.createVideoContext('coverVideo', this) + coverCtx.pause() + const playerId = 'video-item' + index + if(this.videoPlayers.includes(playerId)) { + this.videoPlayers.forEach(player => { + if(player === playerId) return + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + } { + this.videoPlayers.push(playerId) + this.videoPlayers.forEach(player => { + if(player === playerId) return + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + } + this.$emit('video') + } uni.$u.debounce(() => { postCountyFamousNewsView({ countyFamousNewsId: item.id }).finally(() => { this.infoArray.map(info => { @@ -1156,6 +1190,11 @@ export default {