Fix:3132 【商城小程序】店铺视频资讯内容无法显示,安卓(小米,vivo)
This commit is contained in:
@@ -225,16 +225,33 @@
|
|||||||
</view>
|
</view>
|
||||||
<view class="info-item-body">
|
<view class="info-item-body">
|
||||||
<view v-if="item.type === 2" class="video">
|
<view v-if="item.type === 2" class="video">
|
||||||
<video
|
<view @click="infoItemViewClick(item, index)" v-if="activeVideo !== 'video-item' + index" class="play-icon">
|
||||||
:src="item.video"
|
<u-icon name="play-right-fill" color="#fff" size="48"></u-icon>
|
||||||
|
</view>
|
||||||
|
<image
|
||||||
|
v-if="activeVideo !== 'video-item' + index"
|
||||||
|
:src="item.video + '?vframe/jpg/offset/1'"
|
||||||
:poster="item.video + '?vframe/jpg/offset/1'"
|
:poster="item.video + '?vframe/jpg/offset/1'"
|
||||||
controls
|
controls
|
||||||
play-btn-position="center"
|
play-btn-position="center"
|
||||||
:show-fullscreen-btn="false"
|
:show-fullscreen-btn="false"
|
||||||
|
:id="'video-item' + index"
|
||||||
|
class="video-item"
|
||||||
|
@click="infoItemViewClick(item, index)"
|
||||||
|
/>
|
||||||
|
<video
|
||||||
|
v-else
|
||||||
|
:src="item.video"
|
||||||
|
controls
|
||||||
|
autoplay
|
||||||
|
play-btn-position="center"
|
||||||
|
:show-fullscreen-btn="false"
|
||||||
class="video-item"
|
class="video-item"
|
||||||
:id="'video-item' + index"
|
:id="'video-item' + index"
|
||||||
@play="infoItemViewClick(item, index)"
|
@play="infoItemViewClick(item, index)"
|
||||||
/>
|
>
|
||||||
|
|
||||||
|
</video>
|
||||||
</view>
|
</view>
|
||||||
<view v-else>
|
<view v-else>
|
||||||
<img-box
|
<img-box
|
||||||
@@ -367,7 +384,8 @@ export default {
|
|||||||
isLoadInfoListSuccess: false,
|
isLoadInfoListSuccess: false,
|
||||||
picColumnWidth: '325rpx',
|
picColumnWidth: '325rpx',
|
||||||
infoArray: [],
|
infoArray: [],
|
||||||
videoPlayers: []
|
videoPlayers: [],
|
||||||
|
activeVideo: 'coverVideo',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onPageScroll(e) {
|
onPageScroll(e) {
|
||||||
@@ -445,6 +463,7 @@ export default {
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
coverPlay(){
|
coverPlay(){
|
||||||
|
this.activeVideo = 'coverVideo'
|
||||||
this.videoPlayers.forEach(player => {
|
this.videoPlayers.forEach(player => {
|
||||||
const playerCtx = uni.createVideoContext(player, this)
|
const playerCtx = uni.createVideoContext(player, this)
|
||||||
playerCtx.pause()
|
playerCtx.pause()
|
||||||
@@ -455,6 +474,7 @@ export default {
|
|||||||
const coverCtx = uni.createVideoContext('coverVideo', this)
|
const coverCtx = uni.createVideoContext('coverVideo', this)
|
||||||
coverCtx.pause()
|
coverCtx.pause()
|
||||||
const playerId = 'video-item' + index
|
const playerId = 'video-item' + index
|
||||||
|
this.activeVideo = 'video-item' + index
|
||||||
if(this.videoPlayers.includes(playerId)) {
|
if(this.videoPlayers.includes(playerId)) {
|
||||||
this.videoPlayers.forEach(player => {
|
this.videoPlayers.forEach(player => {
|
||||||
if(player === playerId) return
|
if(player === playerId) return
|
||||||
@@ -616,6 +636,17 @@ export default {
|
|||||||
padding: 0 20rpx 20rpx 20rpx;
|
padding: 0 20rpx 20rpx 20rpx;
|
||||||
.video {
|
.video {
|
||||||
padding: 20rpx 0 0 0;
|
padding: 20rpx 0 0 0;
|
||||||
|
position: relative;
|
||||||
|
.play-icon {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
margin: auto;
|
||||||
|
width: 80rpx;
|
||||||
|
height: 80rpx;
|
||||||
|
}
|
||||||
.video-item {
|
.video-item {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 400rpx;
|
height: 400rpx;
|
||||||
|
|||||||
Reference in New Issue
Block a user