提现广告优化

This commit is contained in:
GaoHao
2025-01-09 15:27:39 +08:00
parent c686a02931
commit 381d801611

View File

@@ -25,7 +25,7 @@
</view>
</view>
<view class="witBtn" @click="goWithdraw"> {{!data.isWithdraw?'观看广告提现':'立即提现'}} </view>
<view class="witBtn" @click="goWithdraw"> {{data.isWithdraw?'立即提现':'观看广告提现'}} </view>
<view class="tab" style="">
<view @click="linkTo('/pages/me/withdraw/realName')">实名认证</view>
@@ -75,11 +75,13 @@
</up-modal>
<!-- 激励视频广告 -->
<!-- <ad-rewarded-video v-if="data.adRewardedVideo" ref="adRewardedVideo" adpid="1531580352" :loadnext="true" v-slot:default="{loading, error}"
:url-callback="data.urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
<view class="ad-error" v-if="error">{{error}}</view>
</ad-rewarded-video> -->
<view style="width: 0;height: 0;overflow: hidden;">
<!-- 激励视频广告 -->
<ad-rewarded-video v-if="data.adRewardedShow" ref="adRewarded" adpid="1507000689" :loadnext="true"
:url-callback="data.urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
</ad-rewarded-video>
</view>
</view>
</template>
@@ -116,26 +118,26 @@
limit: 10,
totalCount: 0,
cashMoney: 0,
urlCallback: null,
adRewardedVideo: true,
urlCallback: {},
adRewardedShow: true,
adRewardedVideoloadNum: 0,
isWithdraw: false,
userInfo: null,
})
const adRewardedVideo = ref(null);
const adRewarded = ref(null);
onLoad(() => {
getExtractFei();
getMoneyDetail();
})
onShow(() => {
console.log(uni.getStorageSync('userInfo'))
getcashMoney()
getUserInfo();
})
onReady(() => {
nextTick(()=>{
data.adRewardedVideoloadNum = 0
adRewardedVideo.value.load();
adRewarded.value.load();
})
getCanCash()
})
@@ -163,7 +165,7 @@
*/
async function getCanCash() {
canCash().then(res => {
// data.isWithdraw = res;
data.isWithdraw = !res;
})
}
@@ -172,7 +174,7 @@
* @param {Object} e
*/
function onadload(e) {
data.adRewardedVideo = true;
data.adRewardedShow = true;
console.log('广告数据加载成功');
}
@@ -182,12 +184,12 @@
*/
function onaderror(e) {
if ( data.adRewardedVideoloadNum >=3 ) {
data.adRewardedVideo = false;
data.adRewardedShow = false;
return
}
data.adRewardedVideoloadNum++
setTimeout(() => {
// adRewardedVideo.value.load();
adRewarded.value.load();
}, 1000); // 10
console.log("广告加载失败")
}
@@ -224,7 +226,7 @@
userId: uni.getStorageSync('userInfo').userId,
extra: 'cash:'+uni.getStorageSync('userInfo').userId + "" + new Date().getTime(),
}
adRewardedVideo.value.show();
adRewarded.value.show();
} else {
getOut()
}
@@ -276,7 +278,6 @@
*/
function getcashMoney() {
selectUserMoney().then(res => {
console.log(res)
data.mayMoney = res.amount || 0
})
}