Commit b047f4b7 authored by ziyu's avatar ziyu

improvement: youhua

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