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

complete video task and video rewards

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