<video class=“wxParse-video-video” wx:if="{{item.isPlay}}" src="{{item.videoUrl}}" initial-time="{{item.currentTime}}" controls="{{!false}}" autoplay="{{true}}" loop="{{true}}" bindtimeupdate=“eventPlayupdate” bindfullscreenchange=“eventFullScreen” data-index="{{index}}" id=“myVideo”>
<cover-view class=“cover-view” bindtap=“eventPlay” data-index="{{index}}" wx:if="{{!item.isPlay}}">
<cover-image src="{{item.productDetailImage[0]}}" mode=‘widthFix’ class=‘img’></cover-image>
</cover-view>
</video>
<image wx:if="{{!item.isPlay}}" class=“video-cover” mode=“aspectFill” src="{{item.productDetailImage[0]}}" bindtap=“eventPlay” data-index="{{index}}"></image>
<block wx:for="{{item.productDetailImage}}" wx:for-item=“item” wx:for-index=‘idx’ wx:key=“index”>
<image class=“weui-uploader__img” src="{{item}}" data-index="{{index}}" data-id="{{idx}}" data-src="{{item}}" bindtap=“previewImage” mode=“aspectFill”></image>
</block>
previewImage: function(e) {
console.log(e)
var that = this;
var id = e.currentTarget.dataset.id;
var index = e.currentTarget.dataset.index;
var productDetailImage = that.data.mapList[index].productDetailImage;
wx.previewImage({
current: productDetailImage[id],
urls: productDetailImage,
success:(e)=>{
console.log(e)
},
});
},
video视频播放的时候预览图片会冲突,会暂停当前的视频播放去播放默认的第一个视频,我是做的是默认播放第一个时候,滚动的时候滚动到当前视频就播放