diff --git a/pages/town/components/information.vue b/pages/town/components/information.vue index 0a8ac02..5b6bc95 100644 --- a/pages/town/components/information.vue +++ b/pages/town/components/information.vue @@ -102,6 +102,12 @@ export default { } }, methods: { + coverPlay(){ + this.videoPlayers.forEach(player => { + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + }, infoItemViewClick(item, index) { if(item.contentType === 2) { // const coverCtx = uni.createVideoContext('coverVideo', this) diff --git a/pagesInn/inn/farmerStore.vue b/pagesInn/inn/farmerStore.vue index b2366e1..c7457ff 100644 --- a/pagesInn/inn/farmerStore.vue +++ b/pagesInn/inn/farmerStore.vue @@ -34,6 +34,7 @@ play-btn-position="center" id="coverVideo" class="video" + @play="coverPlay" /> @@ -443,6 +444,12 @@ export default { } }) }, + coverPlay(){ + this.videoPlayers.forEach(player => { + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + }, infoItemViewClick(item, index) { if(item.type === 2) { const coverCtx = uni.createVideoContext('coverVideo', this) diff --git a/pagesInn/inn/innHome.vue b/pagesInn/inn/innHome.vue index b6dace8..c2805f9 100644 --- a/pagesInn/inn/innHome.vue +++ b/pagesInn/inn/innHome.vue @@ -35,6 +35,7 @@ object-fit="contain" play-btn-position="center" class="video" + @play="coverPlay" /> @@ -668,6 +669,12 @@ export default { infoClick: function (info) { // this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id) }, + coverPlay(){ + this.videoPlayers.forEach(player => { + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + }, infoItemViewClick(item, index) { if(item.type === 'NT_VIDEO') { const coverCtx = uni.createVideoContext('coverVideo', this) diff --git a/pkg_product/views/famousQianxianShop.vue b/pkg_product/views/famousQianxianShop.vue index b488cde..0004bdf 100644 --- a/pkg_product/views/famousQianxianShop.vue +++ b/pkg_product/views/famousQianxianShop.vue @@ -34,6 +34,7 @@ play-btn-position="center" class="video" id="coverVideo" + @play="coverPlay" /> @@ -1064,6 +1065,12 @@ export default { infoClick(info) { // this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id) }, + coverPlay(){ + this.videoPlayers.forEach(player => { + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + }, infoItemViewClick(item, index) { if(item.type === 2) { const coverCtx = uni.createVideoContext('coverVideo', this) diff --git a/pkg_product/views/famousQianxianVillageShop.vue b/pkg_product/views/famousQianxianVillageShop.vue index 56a11ad..eb6043d 100644 --- a/pkg_product/views/famousQianxianVillageShop.vue +++ b/pkg_product/views/famousQianxianVillageShop.vue @@ -34,6 +34,7 @@ play-btn-position="center" class="video" id="coverVideo" + @play="coverPlay" /> @@ -256,6 +257,12 @@ export default { this.getInfoReq() }, methods: { + coverPlay(){ + this.videoPlayers.forEach(player => { + const playerCtx = uni.createVideoContext(player, this) + playerCtx.pause() + }) + }, handleVideo(item, index) { if(item.type === 2) { const coverCtx = uni.createVideoContext('coverVideo', this)