Commit fb5e0046 authored by ziyu's avatar ziyu

合并

parents 2f5706ae 3c3f216e
......@@ -16,8 +16,17 @@ function getClass (status) {
console.log(status)
return cls[index]
};
function showVideo(item,current,index) {
if(item.showType && item.showType.value ==2) {
if(current === index) {
return true
} else {
return false;
}
}
}
module.exports = {
computClass:computClass,
getClass:getClass
getClass:getClass,
showVideo:showVideo
}
......@@ -8,6 +8,7 @@
height:100%;
width:100%;
position: absolute;
background-color: #000;
z-index: 1;
}
......@@ -65,6 +66,7 @@
width: 100%;
}
</style>
<wxs module="video" src="../../common/common.wxs"></wxs>
<template>
<view class="container">
<swiper
......@@ -74,6 +76,7 @@
vertical
current="0"
bindanimationfinish="bindanimationfinish"
bindchange="moveSwiper"
>
<swiper-item :class="{'image-item': item.showType && item.showType.value === 1}" v-for="(item, idx) in curQueue" :key="item.id">
<view class="video-wrapper">
......@@ -84,20 +87,20 @@
show-center-play-btn="{{false}}"
enable-progress-gesture="{{false}}"
controls="{{false}}"
src="{{item.videoUrl}}"
src="{{video.showVideo(item,currentIndex,idx)?item.videoUrl:null}}"
data-id="{{item.id}}"
object-fit="{{item.objectFit || 'contain'}}"
data-index="{{idx}}"
binderror="onError"
bindtimeupdate="onTimeUpdate"
@tap="videoTap"
custom-cache="{{false}}"
v-if="item.showType && item.showType.value === 2"
object-fit="contain"
wx:if="{{item.showType && item.showType.value ==2}}"
>
<video-loading v-if="item.time === 0" :snapshot="item.videoSnapUrl"/>
<video-pause :pause="pause"></video-pause>
</video>
<image v-if="item.showType && item.showType.value === 1" lazy-load class="images" :src="item.photoUrl" mode="widthFix" bindload="imageLoad(item.id)">
<image wx:if="{{item.showType && item.showType.value ==1}}" lazy-load class="images" :src="item.photoUrl" mode="widthFix" bindload="imageLoad(item.id)">
<image-loading v-if="item.time === 0"/>
</image>
<view class="rightcont" v-show="item.id > 0">
......@@ -132,6 +135,7 @@
data: {
pause: false,
curQueue: [],
currentIndex:0,
},
watch: {
videoList () {
......@@ -155,6 +159,12 @@
this.curQueue = [...this.curQueue];
this.updateAwardsInfo(videoCurrent);
},
moveSwiper(e) {
if (e.$wx.detail.source === 'touch') {
let current = e.$wx.detail.current;
this.currentIndex = current;
}
},
async getProgress(id) {
if (id <= 0) return;
let detail = await getAwardsDetail({ prizeId: id });
......@@ -223,6 +233,8 @@
if (index !== current) {
ctx && ctx.pause();
} else {
//将视频重置到最开始的位置并播放
// ctx && ctx.seek(0);
ctx && ctx.play();
}
});
......
......@@ -57,7 +57,6 @@
share: '/static/images/share@2x.png',
lottery: '/static/images/lottery@2x.png'
};
let isFirst = true;
let addGoldTimer = null;
wepy.component({
store,
......@@ -74,6 +73,7 @@
lotteryUrl: '/static/images/lottery@2x.png',
containerStyle: '',
flyAnimation: false,
isFirst:true,
},
props: {
title: '',
......@@ -144,8 +144,8 @@
if (v) {
this.addCount = 0;
}
if (isFirst) {
isFirst = false;
if (this.isFirst) {
this.isFirst = false;
return;
}
setTimeout(() => {
......@@ -153,11 +153,11 @@
}, 1500);
},
sign(v) {
if (isFirst) {
if (this.isFirst) {
this.signComplete = false;
this.flyAnimation = false;
this.addsunshine = false;
isFirst = false;
this.isFirst = false;
return;
}
if (v) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment