Fix:2889 【商城小程序】优化当寻趣味店铺封面为视频时,视频资讯和视频封面不能同时播放
This commit is contained in:
@@ -31,6 +31,7 @@
|
|||||||
:autoplay="true"
|
:autoplay="true"
|
||||||
:controls="true"
|
:controls="true"
|
||||||
:loop="false"
|
:loop="false"
|
||||||
|
id="coverVideo"
|
||||||
object-fit="contain"
|
object-fit="contain"
|
||||||
play-btn-position="center"
|
play-btn-position="center"
|
||||||
class="video"
|
class="video"
|
||||||
@@ -232,8 +233,8 @@
|
|||||||
controls
|
controls
|
||||||
play-btn-position="center"
|
play-btn-position="center"
|
||||||
class="video-item"
|
class="video-item"
|
||||||
:autoplay="inn.coverType !== 2"
|
:id="'video-item' + index"
|
||||||
@play="infoItemViewClick(item)"
|
@play="infoItemViewClick(item, index)"
|
||||||
/>
|
/>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
@@ -666,7 +667,26 @@ export default {
|
|||||||
infoClick: function (info) {
|
infoClick: function (info) {
|
||||||
// this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
|
// this.$yrouter.push('/pagesInn/inn/innInfoDetail?id=' + info.id)
|
||||||
},
|
},
|
||||||
infoItemViewClick(item) {
|
infoItemViewClick(item, index) {
|
||||||
|
if(item.type === 'NT_VIDEO') {
|
||||||
|
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()
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
uni.$u.debounce(() => {
|
uni.$u.debounce(() => {
|
||||||
hotelNewsView({ id: item.id }).finally(() => {
|
hotelNewsView({ id: item.id }).finally(() => {
|
||||||
this.infoArray.map(info => {
|
this.infoArray.map(info => {
|
||||||
|
|||||||
Reference in New Issue
Block a user