zhengshuiqi 3 years ago
parent
commit
d08eeaac9c
  1. 48
      pages/index/index.vue

48
pages/index/index.vue

@ -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">

Loading…
Cancel
Save