Commit dc03e799 authored by AU-Pro-mac's avatar AU-Pro-mac

complete video task and video rewards

parent 2446377f
......@@ -18,10 +18,10 @@
.jiang_li_dan_chuang {
width: 500rpx;
height: 523rpx;
height: 668rpx;
opacity: 1;
left: 125rpx;
top: calc(50% - 261rpx);
top: calc(50% - 334rpx);
position: absolute;
}
......@@ -38,7 +38,7 @@
height: 88rpx;
opacity: 1;
left: 31rpx;
bottom: 36rpx;
bottom: 30rpx;
position: absolute;
}
.ji_xu_guan_kan {
......@@ -46,7 +46,7 @@
height: 88rpx;
opacity: 1;
left: 262rpx;
bottom: 36rpx;
bottom: 30rpx;
position: absolute;
}
.kan_shi_pin_jiang_li {
......@@ -55,7 +55,7 @@
line-height: 56rpx;
opacity: 1;
left: 0;
top: 100rpx;
top: 70rpx;
position: absolute;
display: inline-block;
font-size: 50rpx;
......@@ -71,7 +71,7 @@
line-height: 32rpx;
opacity: 1;
left: 0;
top: 230rpx;
top: 150rpx;
text-align: center;
position: absolute;
font-size: 32rpx;
......@@ -99,3 +99,18 @@
top: -50rpx;
position: absolute;
}
.commonT2-modal_rewards {
width: 240rpx;
height: 240rpx;
top: 222rpx;
left: 130rpx;
position: absolute;
z-index: 5;
}
.commonT2-modal_rewards_image {
width: 100%;
height: 100%;
}
......@@ -3,21 +3,25 @@
<view class="jiang_li_dan_chuang">
<image class="dan_chuang_bei_jing2" src="{{resList['7203516e-8791-4974-955e-c8a044e16c80'].url}}"/>
<image class="qu_chou_jiang" src="{{resList['b71e74b5-16ad-4260-a382-8cf200e9e5a7'].url}}" />
<image class="ji_xu_guan_kan" src="{{resList['8da146cc-69cd-41fa-bed3-e7194ce037aa'].url}}" />
<image class="dan_chuang_bei_jing2" src="//yun.duiba.com.cn/spark/assets/弹窗背景.55cabcd27f981e4a20db75b0b9b34069ca196b3a.png"/>
<image onTap="onModalOne" class="qu_chou_jiang" src="{{btnImg1}}" />
<image onTap="onModalTwo" class="ji_xu_guan_kan" src="{{btnImg2}}" />
<text class="kan_shi_pin_jiang_li">{{title}}</text>
<view class="flex_content">
<view class="huo_de_ya_dun_bi">
<text decode="{{true}}">{{detail}}</text>
<view class="huo_de_ya_dun_bi" style="top: {{ rewardsImg ? '150rpx' : '270rpx'}}">
<text decode="{{true}}">{{content}}</text>
</view>
<view class="tu_ceng40" a:if="{{}}">
<image class="flex_content_image" src="{{}}" />
<text>+{{coins}}</text>
</view>
</view>
<view a:if="{{rewardsImg}}" class="commonT2-modal_rewards">
<image class="commonT2-modal_rewards_image" src="{{rewardsImg}}" mode="aspectFill" />
</view>
<image
class="an_niu_guan_bi_dan_chuang_kao_bei23" onTap="onModalClose"
src="{{resList['4abc8bb6-5779-49ad-84b4-b4ade4f51fcb'].url}}"
......
......@@ -4,36 +4,37 @@ Component({
data: {
resList: resList,
title: '',
detail: '',
hasYDCoin: false,
coins: 0
content: '',
coins: 0,
btnImg1: '',
btnImg2: '',
rewardsImg: ''
},
props: {
title: '',
detail: '',
hasYDCoin: false,
content: '',
coins: 0
},
didMount () {
this.setData({
title: this.props.data.title,
detail: this.props.data.detail,
hasYDCoin: this.props.data.hasYDCoin
content: this.props.data.content,
btnImg1: this.props.data.btnImg1,
btnImg2: this.props.data.btnImg2,
rewardsImg: this.props.data.rewardsImg
})
},
didUpdate (prevProps, prevData) {
if (this.props.data.title !== prevData.data.title || this.props.data.detail !== prevData.data.detail) {
if (this.props.data.title !== prevData.title || this.props.data.content !== prevData.content) {
this.setData({
title: this.props.data.title,
detail: this.props.data.detail
})
}
if (this.props.data.hasYDCoin !== prevData.data.hasYDCoin) {
this.setData({
hasYDCoin: this.props.data.hasYDCoin
content: this.props.data.content,
btnImg1: this.props.data.btnImg1,
btnImg2: this.props.data.btnImg2,
rewardsImg: this.props.data.rewardsImg
})
}
},
......@@ -43,9 +44,13 @@ Component({
const { onModalClose } = this.props;
onModalClose && onModalClose();
},
onModalConfirm() {
const { onModalConfirm } = this.props;
onModalConfirm && onModalClose();
}
onModalOne () {
const { onModalOne } = this.props;
onModalOne && onModalOne();
},
onModalTwo () {
const { onModalTwo } = this.props;
onModalTwo && onModalTwo();
},
}
});
\ No newline at end of file
......@@ -111,7 +111,7 @@
<!-- 弹窗部分 -->
<common-modal-t1 a:if="{{commonModalVisibleT1}}" data="{{commonModalDataT1}}" onModalClose="closeCommonModalT1" onModalConfirm="confirmCommonModalT1" />
<common-modal-t2 a:if="{{commonModalVisibleT2}}" data="{{commonModalDataT2}}" onModalClose="closeCommonModalT2" onModalConfirm="confirmCommonModalT2" />
<common-modal-t2 a:if="{{commonModalVisibleT2}}" data="{{commonModalDataT2}}" onModalClose="closeCommonModalT2" onModalOne="onModalT2One" onModalTwo="onModalT2Two"/>
<rule-modal a:if="{{ruleModalVisible}}" onModalClose="closeRuleModal" text="{{rule}}"></rule-modal>
<rewards-modal a:if="{{rewardsModalVisible}}" onModalClose="closeRewardsModal"></rewards-modal>
......
......@@ -80,7 +80,8 @@ Page({
gameType: 0,
commonModalConfirmT1: null,
commonModalVisibleT1: false,
commonModalConfirmT2: null,
onModalT2One: null,
onModalT2Two: null,
commonModalVisibleT2: false,
ruleModalVisible: false,
rewardsModalVisible: false,
......@@ -173,26 +174,27 @@ Page({
}
})
.catch(res => { console.warn(res); commonToast(res && res.message); }) || {};
this.checkDohelp();
},
this.checkDohelp();
},
checkDohelp(){
if(this.inviteId) {
//是分享落地页,可以助力
//todo 需要判断是不是会员
commonToast('准备5秒后给邀请者助力~');
setTimeout(() => {
API.doHelp({activityId: app.activityId,inviteId:this.inviteId}).then(res=>{
commonToast('助力成功~');
}).catch(err=>{
commonToast(JSON.stringify(err));
});
}, 5000);
}else{
commonToast('不是分享落地页,不需要走助力~')
}
},
// 助力
checkDohelp(){
if (this.inviteId) {
//是分享落地页,可以助力
//todo 需要判断是不是会员
commonToast('准备5秒后给邀请者助力~');
setTimeout(() => {
API.doHelp({activityId: app.activityId,inviteId:this.inviteId}).then(res=>{
commonToast('助力成功~');
}).catch(err=>{
commonToast(JSON.stringify(err));
});
}, 5000);
} else {
commonToast('不是分享落地页,不需要走助力~')
}
},
// 新用户/被邀请的 逻辑
......@@ -260,9 +262,6 @@ Page({
// 页面显示
onShow() {
if (this.userLogin) this.getGameInfo()
if (this.isNewUser && this.inviteId && this.isVip) {
}
},
// 获取 游戏门票 抽奖次数 今日是否首次登陆
......@@ -403,7 +402,8 @@ Page({
videoHideFunc() {
console.log('videoHideFunc')
this.setData({ videoShow: false })
if (this.videoSrcArr[this.data.videoActiveIndex].timeStamp >= 15) {
if (this.videoSrcArr[this.data.videoActiveIndex].timeStamp >= 15 && !this.videoSrcArr[this.data.videoActiveIndex].completed) {
this.videoSrcArr[this.data.videoActiveIndex].completed = true
this.getWatchRewards()
}
},
......@@ -418,16 +418,17 @@ Page({
title: '看视频奖励',
content: `抽奖次数+${data.lotteryTimes}`,
confirmCallback1: () => {
navigateToOutside(app.vipUrl)
this.gotoTurnTable()
},
confirmCallback2: () => {
navigateToOutside(app.vipUrl)
this.closeCommonModalT2()
},
btnImg1: '//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png',
btnImg2: '//yun.duiba.com.cn/spark/assets/一秒成为会员.10be8a8ede8f6c62eadb005744dc54ae182911d9.png',
btnImg1: '//yun.duiba.com.cn/spark/assets/3d33327ff5974c06f1be66942b315339f310fac9.png',
btnImg2: '//yun.duiba.com.cn/spark/assets/b64ab7dbde250c686b9cc8346509ea6fc23e2a99.png',
rewardsImg: ''
})
} else {
commonToast('网络开小差啦')
}
})
},
......@@ -442,9 +443,7 @@ Page({
// video - onLoading
onLoading (e) { console.log(e) },
gotoMyPrizePage() {
my.navigateTo({url: '../myprize/myprize'})
},
gotoMyPrizePage() { my.navigateTo({url: '../myprize/myprize'}) },
// 跳转到天猫页面
goTmallPage() { navigateToOutside(REDIRECT_URL['tmall']); },
......@@ -476,21 +475,21 @@ Page({
})
},
// 显示通用弹层
showCommonMoadalT2 ({
title = 'test- title',
content = 'test- content',
confirmCallback,
btnImg = '//yun.duiba.com.cn/spark/assets/32d8536184c3539c0d9655d03c1b60f3d5e1f60a.png' }) {
showCommonMoadalT2 (obj) {
let { title, content, confirmCallback1, confirmCallback2, btnImg1, btnImg2, rewardsImg } = obj
this.setData({
commonModalVisibleT2: true,
commonModalDataT2: { title, content, btnImg },
confirmCommonModalT2: () => {
confirmCallback()
this.closeCommonModalT2()
}
commonModalDataT2: { title, content, btnImg1, btnImg2, rewardsImg },
onModalT2One: () => { confirmCallback1() },
onModalT2Two: () => { confirmCallback2() }
})
},
onModalT2One () { this.data.onModalT2One() },
onModalT2Two () { this.data.onModalT2Two() },
confirmCommonModalT1 () { this.data.confirmCommonModalT1() },
// 弹窗控制 - 关闭
closeRuleModal() { this.setData({ ruleModalVisible: false }) },
closeRewardsModal () { this.setData({ rewardsModalVisible: false}) },
......
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