Commit 6b6bf237 authored by jyx's avatar jyx

添加看广告逻辑

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