增加激励视频广告

This commit is contained in:
唐明明
2022-06-29 18:08:50 +08:00
parent 8235720d27
commit f2e01ae412
14 changed files with 13022 additions and 12723 deletions

View File

@@ -104,6 +104,7 @@
<script>
import { life, sign } from '@/apis/interfaces/life.js'
import AD from '@/utils/ad.js'
var account;
export default {
data() {
@@ -201,19 +202,38 @@
this.$Router.push({name: 'Capacity'})
return
}
uni.showLoading({
title: '签到中..'
})
sign().then(res => {
// 激励视频广告
AD.show({
adpid : 1428308887,
adType : 'RewardedVideo',
urlCallback : {
userId: 'TMMM',
}
},(res) => {
const detail = e.detail
if (detail && detail.isEnded) {
uni.showLoading({
title: '签到中..'
})
sign().then(res => {
uni.showToast({
title: '签到成功',
icon : 'none'
})
this.getLife()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
})
})
} else {
console.log('用户主动关闭')
console.log("onadclose " + detail.isEnded);
}
},(err) => {
uni.showToast({
title: '签到成功',
icon : 'none'
})
this.getLife()
}).catch(err => {
uni.showToast({
title: err.message,
icon : 'none'
title: e.detail
})
})
},