1
This commit is contained in:
@@ -4,7 +4,8 @@
|
|||||||
<view class="task_bg u-absolute">
|
<view class="task_bg u-absolute">
|
||||||
<image class="task_bg" src="../../static/images/me/task_bg.png"></image>
|
<image class="task_bg" src="../../static/images/me/task_bg.png"></image>
|
||||||
</view>
|
</view>
|
||||||
<u-navbar v-if="!isIos" :background="background" :is-back="false" :title="title" :border-bottom="false"></u-navbar>
|
<u-navbar v-if="!isIos" :background="background" :is-back="false" :title="title"
|
||||||
|
:border-bottom="false"></u-navbar>
|
||||||
<view class="navTitle" v-else>
|
<view class="navTitle" v-else>
|
||||||
<view></view>
|
<view></view>
|
||||||
<view class="title">任务大厅</view>
|
<view class="title">任务大厅</view>
|
||||||
@@ -32,12 +33,12 @@
|
|||||||
v-for="(item,index) in signInList" :key="index">
|
v-for="(item,index) in signInList" :key="index">
|
||||||
<image class="signIn_icon" v-if="item.showText == '未签到'" src="../../static/images/signIn_icon2.png"
|
<image class="signIn_icon" v-if="item.showText == '未签到'" src="../../static/images/signIn_icon2.png"
|
||||||
mode="" />
|
mode="" />
|
||||||
<image class="signIn_icon" v-if="item.showText == '已签到'"
|
<image class="signIn_icon" v-if="item.showText == '已签到'" src="../../static/images/signIn_icon3.png"
|
||||||
src="../../static/images/signIn_icon3.png" mode="" />
|
mode="" />
|
||||||
<image class="signIn_icon" v-if="item.showText != '未签到'&&item.showText != '已签到'"
|
<image class="signIn_icon" v-if="item.showText != '未签到'&&item.showText != '已签到'"
|
||||||
src="../../static/images/signIn_icon1.png" mode="" />
|
src="../../static/images/signIn_icon1.png" mode="" />
|
||||||
<view class="radius"></view>
|
<view class="radius"></view>
|
||||||
<view class="_label">{{item.showText}}</view>
|
<view class="_label">{{item.showText}}</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
@@ -79,14 +80,12 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
<!-- 激励视频广告 -->
|
|
||||||
<ad-rewarded-video ref="adRewardedVideo" adpid="1531580352" :preload="false" :loadnext="false"
|
|
||||||
: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>
|
|
||||||
</view>
|
</view>
|
||||||
|
<!-- 激励视频广告 -->
|
||||||
|
<ad-rewarded-video 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>
|
||||||
</view>
|
</view>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -127,13 +126,11 @@
|
|||||||
signInBtn: '点击签到',
|
signInBtn: '点击签到',
|
||||||
isShowMoneyPay: true,
|
isShowMoneyPay: true,
|
||||||
isIos: false,
|
isIos: false,
|
||||||
isLoading: false,
|
isAndroid: true,
|
||||||
isAndroid: false,
|
|
||||||
urlCallback: null,
|
urlCallback: null,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
|
||||||
this.getTaskdata()
|
this.getTaskdata()
|
||||||
this.getsignIn()
|
this.getsignIn()
|
||||||
this.$Request.getT("app/common/type/919", {}).then(res => {
|
this.$Request.getT("app/common/type/919", {}).then(res => {
|
||||||
@@ -150,29 +147,9 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
},
|
|
||||||
async onReady() {
|
|
||||||
this.urlCallback = {
|
|
||||||
userId: uni.getStorageSync('userId'),
|
|
||||||
extra: uni.getStorageSync('userId')+""+new Date().getTime(),
|
|
||||||
}
|
|
||||||
|
|
||||||
this.isLoading = true;
|
|
||||||
// 首次加载广告
|
|
||||||
setTimeout(() => {
|
|
||||||
this.$refs.adRewardedVideo.load();
|
|
||||||
}, 1000)
|
|
||||||
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
showAd() {
|
|
||||||
if (this.isLoading) {
|
|
||||||
return
|
|
||||||
}
|
|
||||||
this.$refs.adRewardedVideo.show();
|
|
||||||
},
|
|
||||||
onadload(e) {
|
onadload(e) {
|
||||||
this.isLoading = false;
|
|
||||||
console.log('广告数据加载成功');
|
console.log('广告数据加载成功');
|
||||||
},
|
},
|
||||||
async onadclose(e) {
|
async onadclose(e) {
|
||||||
@@ -180,7 +157,6 @@
|
|||||||
if (detail && detail.isEnded) {
|
if (detail && detail.isEnded) {
|
||||||
// 正常播放结束
|
// 正常播放结束
|
||||||
// /sqx_fast/app/ad/state
|
// /sqx_fast/app/ad/state
|
||||||
console.log(this.urlCallback.extra)
|
|
||||||
let res = await this.$Request.getT('app/ad/state', {
|
let res = await this.$Request.getT('app/ad/state', {
|
||||||
extraKey: this.urlCallback.extra
|
extraKey: this.urlCallback.extra
|
||||||
})
|
})
|
||||||
@@ -188,7 +164,7 @@
|
|||||||
if (res.code == 0) {
|
if (res.code == 0) {
|
||||||
console.log(res)
|
console.log(res)
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: '获得'+res.data.value+'分钟免费时长',
|
title: '获得' + res.data.value + '分钟免费时长',
|
||||||
icon: 'none'
|
icon: 'none'
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@@ -196,13 +172,9 @@
|
|||||||
} else {
|
} else {
|
||||||
// 播放中途退出
|
// 播放中途退出
|
||||||
}
|
}
|
||||||
//this.isLoading = true;
|
|
||||||
//this.$refs.adRewardedVideo.load();
|
|
||||||
},
|
},
|
||||||
onaderror(e) {
|
onaderror(e) { // 广告加载失败
|
||||||
// 广告加载失败
|
|
||||||
console.log("广告加载失败")
|
console.log("广告加载失败")
|
||||||
this.isLoading = false;
|
|
||||||
},
|
},
|
||||||
/**
|
/**
|
||||||
* 获取签到数据
|
* 获取签到数据
|
||||||
@@ -255,8 +227,14 @@
|
|||||||
if (item.jumpType == 0) {
|
if (item.jumpType == 0) {
|
||||||
if (item.buttonTitle.indexOf("领取") != -1) {
|
if (item.buttonTitle.indexOf("领取") != -1) {
|
||||||
this.taskReceive(item.id)
|
this.taskReceive(item.id)
|
||||||
}if (item.buttonTitle.indexOf("观看视频") != -1) {
|
}
|
||||||
this.showAd()
|
if (item.buttonTitle.indexOf("观看视频") != -1) {
|
||||||
|
// 首次加载广告
|
||||||
|
this.urlCallback = {
|
||||||
|
userId: uni.getStorageSync('userId'),
|
||||||
|
extra: uni.getStorageSync('userId') + "" + new Date().getTime(),
|
||||||
|
}
|
||||||
|
this.$refs.adRewardedVideo.show();
|
||||||
} else {
|
} else {
|
||||||
uni.switchTab({
|
uni.switchTab({
|
||||||
url: "/pages/index/index"
|
url: "/pages/index/index"
|
||||||
|
|||||||
Reference in New Issue
Block a user