|
|
|
@ -325,6 +325,45 @@ |
|
|
|
|
|
|
|
}, |
|
|
|
methods: { |
|
|
|
isVideo() { |
|
|
|
this.video = true |
|
|
|
}, |
|
|
|
|
|
|
|
// 侧滑 |
|
|
|
/** |
|
|
|
* 触摸开始 |
|
|
|
* @param {Object} e |
|
|
|
*/ |
|
|
|
touchStart(e) { |
|
|
|
if (e.touches.length == 1) { |
|
|
|
//设置触摸起始点水平方向位置 |
|
|
|
this.startX = e.touches[0].clientX; |
|
|
|
} |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 触摸结束 |
|
|
|
* @param {Object} e |
|
|
|
*/ |
|
|
|
touchEnd(e) { |
|
|
|
if (e.changedTouches.length == 1) { |
|
|
|
//手指移动结束后水平位置 |
|
|
|
var endX = e.changedTouches[0].clientX; |
|
|
|
let diff = endX - this.startX; |
|
|
|
if (Math.abs(diff) > 20) { |
|
|
|
if (diff > 0) { |
|
|
|
//console.log("左滑..."); |
|
|
|
|
|
|
|
} else { |
|
|
|
//console.log("右滑..."); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 视频停止 |
|
|
|
VideoPuse() { |
|
|
|
this.video = false |
|
|
|
}, |
|
|
|
checkNetwork() { |
|
|
|
uni.getNetworkType({ |
|
|
|
complete: function(res) { |
|
|
|
@ -341,6 +380,7 @@ |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
}, |
|
|
|
handlechange(e) { |
|
|
|
this.mycurrent = e.detail.current |
|
|
|
@ -1596,10 +1636,10 @@ |
|
|
|
<view v-for="(item,index) in leftList" :key="index"> |
|
|
|
<block v-if="item.goods_video"> |
|
|
|
<scroll-view style="position: relative;"> |
|
|
|
<video preload="true" webkit-playsinline="true" x5-video-player-type="h5" x5-video-orientation="portraint" controls :autoplay="true" :enable-progress-gesture="true" muted="" style="width: 100%;" |
|
|
|
:mobilenet-hint-type="1" class="video_play" :http-cache="true" @pause="VideoPuse()" |
|
|
|
<video :autoplay="true" :enable-progress-gesture="true" muted="" style="width: 100%;" |
|
|
|
:mobilenet-hint-type="1" class="video_play" :http-cache="true" |
|
|
|
object-fit="contain" :direction="0" :src="item.goods_video" :show-mute-btn="true" |
|
|
|
@touchstart="touchStart" @touchend="touchEnd"> |
|
|
|
@touchstart="touchStart" @touchend="touchEnd" @pause="VideoPuse()"> |
|
|
|
</video> |
|
|
|
</scroll-view> |
|
|
|
<view class="play_icon" v-show="!video" @click="isVideo"></view> |
|
|
|
@ -1626,7 +1666,7 @@ |
|
|
|
<view v-for="(item1,index1) in rightList" :key="index1"> |
|
|
|
<block v-if="item1.goods_video"> |
|
|
|
<scroll-view style="position: relative;"> |
|
|
|
<video preload="true" webkit-playsinline="true" x5-video-player-type="h5" x5-video-orientation="portraint" controls :autoplay="true" :enable-progress-gesture="true" muted="" style="width: 100%;" |
|
|
|
<video x5-video-player-type="h5-page" :autoplay="true" :enable-progress-gesture="true" muted="" style="width: 100%;" |
|
|
|
:mobilenet-hint-type="1" class="video_play" :http-cache="true" @pause="VideoPuse()" |
|
|
|
object-fit="contain" :direction="0" :src="item1.goods_video" :show-mute-btn="true" |
|
|
|
@touchstart="touchStart" @touchend="touchEnd"> |
|
|
|
|