diff --git a/pages/home/components/information.vue b/pages/home/components/information.vue index c047ce4..0579b5d 100644 --- a/pages/home/components/information.vue +++ b/pages/home/components/information.vue @@ -20,13 +20,25 @@ + + @@ -101,7 +113,8 @@ export default { data() { return { webUrl: this.$VUE_APP_RESOURCES_URL, - infoArray: [] + infoArray: [], + videoPlayers:[] } }, watch: { @@ -138,6 +151,26 @@ export default { }) }, infoItemViewClick(item) { + 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(() => { hadView({ landmarkNewsId: item.id }).finally(() => { this.infoArray.map(info => { @@ -152,6 +185,11 @@ export default { };