广告修改参数
This commit is contained in:
parent
c11ccf9e6b
commit
d312b614d7
|
|
@ -81,7 +81,7 @@
|
|||
</view>
|
||||
<!-- 激励视频广告 -->
|
||||
<ad-rewarded-video ref="adRewardedVideo" adpid="1531580352" :preload="false" :loadnext="false"
|
||||
:disabled="true" v-slot:default="{loading, error}" @load="onadload" @close="onadclose"
|
||||
:disabled="true" v-slot:default="{loading, error}" :url-callback="urlCallback" @load="onadload" @close="onadclose"
|
||||
@error="onaderror">
|
||||
<view class="ad-error" v-if="error">{{error}}</view>
|
||||
</ad-rewarded-video>
|
||||
|
|
@ -129,6 +129,7 @@
|
|||
isIos: false,
|
||||
isLoading: false,
|
||||
isAndroid: false,
|
||||
urlCallback: null,
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
|
@ -148,18 +149,23 @@
|
|||
this.isShowMoneyPay = !(res.data.value == '1' && isIos)
|
||||
}
|
||||
});
|
||||
|
||||
},
|
||||
async onReady() {
|
||||
this.urlCallback = {
|
||||
userId: uni.getStorageSync('userId'),
|
||||
extra: uni.getStorageSync('userId')+""+new Date().getTime(),
|
||||
}
|
||||
|
||||
this.isLoading = true;
|
||||
console.log(1)
|
||||
// 首次加载广告
|
||||
// 首次加载广告
|
||||
setTimeout(() => {
|
||||
this.$refs.adRewardedVideo.load();
|
||||
}, 1000)
|
||||
|
||||
},
|
||||
methods: {
|
||||
showAd() {
|
||||
console.log(this.isLoading)
|
||||
if (this.isLoading) {
|
||||
return
|
||||
}
|
||||
|
|
@ -167,7 +173,6 @@
|
|||
},
|
||||
onadload(e) {
|
||||
this.isLoading = false;
|
||||
console.log(2)
|
||||
console.log('广告数据加载成功');
|
||||
},
|
||||
async onadclose(e) {
|
||||
|
|
@ -175,8 +180,9 @@
|
|||
if (detail && detail.isEnded) {
|
||||
// 正常播放结束
|
||||
// /sqx_fast/app/ad/state
|
||||
console.log(this.urlCallback.extra)
|
||||
let res = await this.$Request.getT('app/ad/state', {
|
||||
extraKey: 1
|
||||
extraKey: this.urlCallback.extra
|
||||
})
|
||||
this.$Request.getT('/app/common/type/921').then(res => {
|
||||
if (res.code == 0) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue