-
-
-
+
+
+
+
-
-
-
-
-
-
@@ -32,42 +24,63 @@
newHeight:uni.getSystemInfoSync().windowHeight,
newwidth:uni.getSystemInfoSync().windowWidth,
videoSrc:'https://video.shipin520.com/videos/17/97/40/a_yiPIEXbE43Tm1559179740.mp4',
- isPlayImg:false,
- autoplay:true,
+ videoList:[],
+ currentIndex:0,
videoContext:'',
title:'',//视频的标题,全屏时在顶部展示
posterSrc:'',//视频封面的图片网络资源地址,如果 controls 属性值为 false 则设置 poster 无效
- isControls: false,//是否显示默认播放控件(播放/暂停按钮、播放进度、时间)
dans:true,//是否开启播放手势,即双击切换播放/暂停
isCenterImg:false,//是否显示视频中间的播放按钮
isBottomImg:true,//是否显示视频底部控制栏的播放按钮
- isFull:true//是否显示全屏按钮
+ isFull:true,//是否显示全屏按钮
+ count:0
}
},
- onReady: function (res) {
- this.videoContext = uni.createVideoContext('myVideo', this)
+ onReady: (res)=> {
+
},
- onLoad(options) {
- this.videoSrc = options.src
- this.posterSrc = options.posterSrc
+ onLoad(op) {
+ this.currentIndex = op.current;
+ this.videoList = uni.getStorageSync('videoList');
+ this.videoContext = uni.createVideoContext(`video${this.currentIndex}`, this)
},
methods:{
+ // 双击
+ doubleClick(index){
+ this.count++;
+ setTimeout(()=>{
+ if(this.count>2 && this.videoList[index].isPlayImg == true){
+ this.playCurrentVideo(index);
+ this.count = 0;
+ } else {
+ this.videoList[index].isPlayImg = true;
+ }
+ },1000)
+ },
+ // 播放当前视频
+ playCurrentVideo(index){
+ this.videoContext.pause();
+ this.videoContext = uni.createVideoContext(`video${index}`, this)
+ this.videoList[index].isPlayImg = false;
+ },
backEv(){
uni.navigateBack({
delta:1
})
},
- playEv(){
- this.isPlayImg = false;
- this.autoplay = false;
+ playEv(index){
+ this.playCurrentVideo(index);
this.videoContext.play();
},
- comePlay(){//当开始/继续播放时触发play事件
- this.isControls = true;
+ // 视频播放
+ comePlay(index){//当开始/继续播放时触发play事件
+ this.videoList[index].isPlayImg = false;
+ this.videoList[index].isControls = true;
},
- comePause(){
- this.isPlayImg = true;
- this.isControls = false;
+ // 视频暂停
+ comePause(index){
+ this.videoList[index].isPlayImg = true;
+ this.videoList[index].isControls = false;
}
}
}
diff --git a/pagesB/shop-detail/shop-detail.vue b/pagesB/shop-detail/shop-detail.vue
index acd96ba..357092e 100644
--- a/pagesB/shop-detail/shop-detail.vue
+++ b/pagesB/shop-detail/shop-detail.vue
@@ -3,7 +3,7 @@
-
+
{{shopInfo.name}}
@@ -19,13 +19,13 @@
-
+
+
+
-
-
- ¥189.00
+ ¥{{shopInfo.price}}
加入购物车
立即购买
@@ -33,6 +33,8 @@
+
+
@@ -49,6 +51,7 @@
richText:'',
shopId:'',//产品id
shopInfo:'',//产品详情
+ bannerList:[],//产品轮播
}
},
onShow() {
@@ -73,6 +76,22 @@
this.shopInfo = res.data.detail;
// 富文本
this.richText = this.$toolAll.tools.escape2Html(this.shopInfo.content);
+ // 产品详情
+ let newImg = [];
+ if(this.shopInfo.images){
+ newImg = this.shopInfo.images.split(',');
+ }
+ if(newImg.length){
+ newImg.forEach(item=>{
+ let obj = {
+ imgSrc:item,
+ url:'',
+ isVideo:false,
+ poster:''
+ }
+ this.bannerList.push(obj);
+ })
+ }
}
})
},