广告加载失败隐藏,兑换按钮条件修改

This commit is contained in:
GaoHao
2024-12-24 17:57:49 +08:00
parent 70594ec8cb
commit fef62822c3
2 changed files with 9 additions and 4 deletions

View File

@@ -15,14 +15,15 @@
<view class="color-666 u-font-24">{{tabIndex==1?'中奖时间':'兑换时间'}} {{item.createTime}}</view>
<view class="u-m-t-24 u-flex u-row-between">
<view class="u-flex-1 u-flex u-col-top">
<!-- <u-image width="128rpx" height="128rpx" src="/static/red-pack.png"></u-image> -->
<u-image width="128rpx" height="128rpx" v-if="item.type == 2 " src="/static/red-pack.png"></u-image>
<u-image width="128rpx" height="128rpx" v-else :src="item.imgUrl"></u-image>
<view class="u-m-l-16">
<view v-if="tabIndex == 1">{{item.name}}</view>
<view v-else>{{item.prizeName}}</view>
<view v-if="tabIndex == 1" class="color-999 u-font-24 u-m-t-16">×{{item.number}}</view>
</view>
</view>
<view class="" v-if="tabIndex==1&&item.targetId&&item.type==3">
<view class="" v-if="tabIndex==1&&!item.targetId&&item.type==3">
<view class="btn-circle duihuan" @click="toDuiHuan(item)">立即兑换</view>
<!-- <view class="btn-circle duihuan finish">已完成</view> -->
</view>

View File

@@ -82,7 +82,7 @@
</view>
</view>
<!-- 激励视频广告 -->
<ad-rewarded-video ref="adRewardedVideo" adpid="1531580352" :loadnext="true" v-slot:default="{loading, error}"
<ad-rewarded-video v-if="adRewardedVideo" ref="adRewardedVideo" adpid="1531580352" :loadnext="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>
@@ -127,10 +127,12 @@
isShowMoneyPay: true,
isIos: false,
isAndroid: true,
adRewardedVideo: true,
urlCallback: null,
}
},
onShow() {
this.adRewardedVideo = true;
this.getTaskdata()
this.getsignIn()
this.$Request.getT("app/common/type/919", {}).then(res => {
@@ -176,6 +178,7 @@
}
},
onaderror(e) { // 广告加载失败
this.adRewardedVideo = false;
console.log("广告加载失败")
},
/**
@@ -319,7 +322,8 @@
<style lang="scss">
.container {
width: 100%;
height: 100vh;
background-color: #F3F4F8;
.task_bg {
width: 100% !important;
height: 494rpx !important;