This commit is contained in:
duan
2025-01-15 17:24:32 +08:00
9 changed files with 1161 additions and 23 deletions

View File

@@ -83,7 +83,7 @@
<view style="width: 0;height: 0;overflow: hidden;">
<!-- 激励视频广告 -->
<ad-rewarded-video v-if="data.adRewardedShow" ref="adRewarded" adpid="1507000689" :loadnext="true"
<ad-rewarded-video v-if="data.adRewardedShow" ref="adRewarded" :adpid="data.adpid" :loadnext="true"
:url-callback="data.urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
</ad-rewarded-video>
</view>
@@ -112,6 +112,7 @@
totalCount: 0,
cashMoney: 0,
urlCallback: {},
adpid: null,
adRewardedShow: true,
adRewardedVideoloadNum: 0,
isWithdraw: false,
@@ -122,6 +123,12 @@
const adRewarded = ref(null);
onLoad(() => {
if ( uni.getSystemInfoSync().platform == 'android' ) {
data.adpid = 1531580352
}
if ( uni.getSystemInfoSync().platform == 'ios' ) {
data.adpid = 1373604770
}
getExtractFei();
getMoneyDetail();

View File

@@ -17,6 +17,7 @@
const state = reactive({
orderId: '',
timer: null,
timer1: null,
maxAjaxNum: 5,
ajaxNum: 0,
url: null, //要打开的外部链接
@@ -31,6 +32,8 @@
getOrderInfo({
orderId: state.orderId
}).then(res => {
state.ajaxNum+=1
console.log(res);
if (res == 1) {
uni.hideLoading()
@@ -50,31 +53,56 @@
title: '支付成功',
icon: 'none'
})
state.timer = setTimeout(() => {
clearTimeout(state.timer)
state.timer1 = setTimeout(() => {
cleartimer()
uni.navigateBack()
}, 500)
}
} else {
// #ifdef APP
uni.showLoading({
title: '支付中'
})
// #endif
}
if(state.ajaxNum>=state.maxAjaxNum){
uni.navigateBack()
cleartimer()
}
});
}
function cleartimer(){
console.log('cleartimer');
uni.hideLoading()
clearInterval(state.timer)
clearTimeout(state.timer1)
state.timer=null
state.timer1=null
state.ajaxNum=0
}
onShow(() => {
// #ifdef APP
uni.showLoading({
title: '支付中'
})
// #endif
state.ajaxNum=0;
getOrder()
clearInterval(state.timer)
state.timer=setInterval(()=>{
getOrder()
},2000)
})
onHide(() => {
console.log('onHide');
cleartimer()
uni.hideLoading()
})
onUnload(() => {
console.log('onUnload');
cleartimer()
uni.hideLoading()
uni.hideLoading()
})
onLoad((option) => {
console.log(option);
state.url = option.url
state.orderId = option.orderId
})

View File

@@ -62,7 +62,7 @@
<!-- 激励视频广告 -->
<view style="width: 0;height: 0;overflow: hidden;">
<!-- 激励视频广告 -->
<ad-rewarded-video v-if="datas.adRewardedShow" ref="adRewarded" adpid="1507000689" :loadnext="true"
<ad-rewarded-video v-if="datas.adRewardedShow" ref="adRewarded" :adpid="datas.adpid" :loadnext="true"
:url-callback="datas.urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
</ad-rewarded-video>
</view>
@@ -103,12 +103,19 @@
signInList: [],
list: [],
urlCallback: {},
adpid: null,
adRewardedShow: true,
adRewardedVideoloadNum: 0,
})
const adRewarded = ref(null);
onShow(() => {
if ( uni.getSystemInfoSync().platform == 'android' ) {
datas.adpid = 1531580352
}
if ( uni.getSystemInfoSync().platform == 'ios' ) {
datas.adpid = 1373604770
}
if (uni.getStorageSync("token")) {
getTaskdata()
getsignIn()