Commit b047f4b7 authored by ziyu's avatar ziyu

improvement: youhua

parent c0414228
......@@ -52,7 +52,8 @@ wepy.app({
'pages/prize',
'pages/myraffles',
'pages/help',
'pages/search'
'pages/search',
'pages/agreement'
],
window: {
backgroundTextStyle: 'light',
......
<wxs module="video" src="../../common/common.wxs"></wxs>
<!--<wxs module="video" src="../../common/common.wxs"></wxs>-->
<template>
<view class="container">
<swiper
class="video-swiper"
duration="600"
duration="700"
circular="{{circular}}"
vertical
current="0"
current="1"
bindchange="moveSwiper"
bindanimationfinish="animationfinish">
<swiper-item wx:for="{{curQueue}}" wx:key="index">
......@@ -19,7 +19,7 @@
enable-progress-gesture
show-center-play-btn="{{false}}"
controls="{{false}}"
src="{{video.showVideo(item,currentIndex,index)?item.videoUrl:null}}"
src="{{item.videoUrl}}"
data-id="{{item.id}}"
object-fit="contain"
data-index="{{index}}"
......@@ -67,10 +67,10 @@
nextQueue: [],
prevQueue: [],
curQueue: [],
circular: false,
_last: 0,
circular: true,
_last: 1,
_invalidUp: 0,
_invalidDown: 1,
_invalidDown: 0,
_videoContexts: [],
currentIndex:0,
videoPause: false,
......@@ -112,14 +112,19 @@
_videoListChanged (newVal) {
const _this = this;
if (this.curQueue.length === 0) {
//因为列表默认展示1的位置,而后端逻辑会把要展示的放在0的位置,所以交换位置,展示出来
newVal.forEach(function (item,index) {
if(index < 3) {
_this.curQueue.push(item);
}else {
if(index === 1) {
_this.curQueue[0] = item;
}else if (index === 0){
_this.curQueue[1] = item;
}else if (index === 2) {
_this.curQueue[2] = item;
} else {
_this.nextQueue.push(item);
}
});
this.playCurrent(0);
this.playCurrent(1);
}else{
//新进入的数组要去重
const curIds = this.curQueue.map(item => item.id);
......@@ -211,6 +216,7 @@
index !== current ? ctx.pause() : ctx.play();
}
});
this.updateAwardsInfo(current)
},
videoTap(e) {
const current = e.currentTarget.dataset.index;
......@@ -224,13 +230,15 @@
}
},
updateAwardsInfo(current) {
const { id, photoUrl, name, probability } = this.curQueue[current];
this.$emit('getAwardsInfo', {
id,
photoUrl: encodeURIComponent(photoUrl),
name,
chance: probability
});
if(this.curQueue[current]) {
const { id, photoUrl, name, probability } = this.curQueue[current];
this.$emit('getAwardsInfo', {
id,
photoUrl: encodeURIComponent(photoUrl),
name,
chance: probability
});
}
},
async getProgress(id) {
if (id <= 0) return;
......
<template>
<web-view src="https://luckii.q-gp.com/agreement.html"></web-view>
</template>
<script>
import wepy from '@wepy/core';
wepy.page({
data: {
}
});
</script>
<config>
{
}
</config>
......@@ -221,7 +221,7 @@
<!--活动图片弹窗-->
<van-popup show="{{ avtivityModal }}" bind:close="ModalClose" round closeable>
<view class="img-wrapper">
<van-image use-loading-slot src="https://luckiistatic.q-gp.com/product-1.png" width="400rpx" fit="widthFix" radius="10rpx">
<van-image use-loading-slot src="{{ mainInfo.activity }}" width="400rpx" fit="widthFix" radius="10rpx">
<van-loading slot="loading" type="spinner" size="30" vertical />
</van-image>
</view>
......@@ -407,12 +407,16 @@
this.mainInfo = await getMainInfo();
this.sign = this.mainInfo && this.mainInfo.signin;
wx.setStorageSync('hasPhone', this.mainInfo.phone);
const show = wx.getStorageSync('hasShowActivity');
if (this.mainInfo && this.mainInfo.innerActivity) {
wx.setStorageSync('innerActivity', this.mainInfo.innerActivity);
} else {
wx.setStorageSync('innerActivity', '');
}
if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
// 弹窗有多个,展示顺序 1、活动弹窗 2、邀请好友 3、购买获得克币 4、开奖宝箱
if(this.mainInfo.activity && !show) {
this.avtivityModal = true;
} else if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
this.showModal = 1;
} else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {
//购买获得金币
......@@ -449,8 +453,19 @@
this.cornModal = true;
},
ModalClose() {
this.cornModal = false;
this.avtivityModal = false;
this.cornModal && (this.cornModal = false);
if(this.avtivityModal) {
wx.setStorageSync('hasShowActivity', 1);
this.avtivityModal = false;
if (this.mainInfo.inviteRecord && this.mainInfo.inviteRecord.length) {
this.showModal = 1;
} else if (this.mainInfo.buyRecord && this.mainInfo.buyRecord.length) {
//购买获得金币
this.showModal = 4;
} else if (this.mainInfo.joinRecord && this.mainInfo.joinRecord.id) {
this.showModal = 2;
}
}
},
checkCode() {
if (this.cornCode === '') {
......
......@@ -110,6 +110,9 @@
margin-left:10rpx;
position: relative;
top:3rpx;
&.red {
color:@maincolor
}
}
}
.joinin {
......@@ -227,7 +230,9 @@
<view class="checkimg {{isCheck?'checked':''}}">
<van-icon name="success" color="#fff" size="24rpx" class="checkicon {{isCheck?'':'hide'}}"/>
</view>
<text class="checktext">我同意花费所有克币参与抽奖,并承诺商品不退货。</text>
<text class="checktext">阅读</text>
<text class="checktext red" catchtap="toAgreement">《隐私协议》</text>
<text class="checktext">并同意花费所有克币参与抽奖且商品不退货</text>
</view>
<button class="joinin" open-type="{{opentype}}" bindtap="joinin" bindgetphonenumber="getPhoneNumber">{{btnfont}}</button>
<van-notify id="van-notify" />
......@@ -380,6 +385,9 @@
this.isError = false;
this.code = '';
},
toAgreement() {
wx.navigateTo({url:'/pages/agreement'});
},
checkCode () {
if (this.code === '') {
this.errorText = '请输入邀请码';
......
......@@ -55,6 +55,7 @@
},
getList(val) {
this.isLoading = true;
this.isDone = false;
getSearchList({keyword:val,page:page}).then(data=>{
this.isLoading = false;
if(!data.hasMore) {
......
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