Commit 6b6bf237 authored by jyx's avatar jyx

添加看广告逻辑

parent c3f6b8e2
......@@ -149,7 +149,7 @@
success() {
message.notify('分享成功');
if (that.signData.list[signData.todayMsgIndexInWeek].rewardMoreType) {
that.reportTaskPointMore(that.signData.list[signData.todayMsgIndexInWeek], true)
that.reportTaskPointMore(that.signData.list[signData.todayMsgIndexInWeek])
}
},
fail() {
......@@ -179,14 +179,18 @@
// 预加载资源
this.ad.load();
},
showAd(item) {
showAd(item, isSign) {
this.ad.show();
let that = this
// 监听视频播放完成
this.ad.onClose((data) => {
tt.hideLoading();
if (data.isEnded) {
that.reportTaskPointMore(item, true)
if (isSign) {
that.reportTaskPointMore(item)
} else {
that.reportCompleteTask(item.taskId)
}
} else {
message.notify('未观看完视频');
}
......@@ -309,7 +313,7 @@
},
});
},
reportTaskPointMore(item, isSign) {
reportTaskPointMore(item) {
// 领取奖励
let that = this
......@@ -355,9 +359,13 @@
})
},
doTask(item) {
console.log(item)
if (item.status == 2) {
if (item.status == 3) {
// 已领取金币
message.notify('请稍后再试')
return
} else if (item.status == 2) {
// 已领取金币
message.notify('已领取金币')
return
} else if (item.status == 1) {
// 已完成任务,领取看点
......@@ -401,7 +409,7 @@
item.listCode == TaskConstant.seeAd
) {
// TODO 看广告
this.showAd(item, false)
} else {
redirectTo(`/pages/home`)
}
......
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