This commit is contained in:
YeMingfei666 2024-12-24 16:13:23 +08:00
commit 08c1deb4dc
2 changed files with 35 additions and 52 deletions

View File

@ -575,8 +575,10 @@
//播放时的回掉 //播放时的回掉
videoPlay(videoId, courseDetailsId) { videoPlay(videoId, courseDetailsId) {
console.log(courseDetailsId) console.log(courseDetailsId)
console.log(this.playFlag)
// this.courseDetailsId = courseDetailsId // this.courseDetailsId = courseDetailsId
if (!this.playFlag) { if (!this.playFlag) {
this.getDataList(this.courseId, this.videoList[this.current].courseDetailsId,true);
this.playFlag = true this.playFlag = true
httpsRequest.getT('app/course/viewCourse', { httpsRequest.getT('app/course/viewCourse', {
courseId: this.courseId, courseId: this.courseId,
@ -606,6 +608,7 @@
}, },
appear(e, index) { appear(e, index) {
this.playFlag = false
this.courseDetailsId = e; this.courseDetailsId = e;
// 清除已经设置的定时器 // 清除已经设置的定时器
clearTimeout(this.appearTimeout); clearTimeout(this.appearTimeout);
@ -1288,6 +1291,7 @@
}; };
httpsRequest.getT('/app/course/selectCourseDetailsById', data).then(res => { httpsRequest.getT('/app/course/selectCourseDetailsById', data).then(res => {
if (res.code == 0) { if (res.code == 0) {
console.log(res)
if (res.data.listsDetail) { if (res.data.listsDetail) {
this.info = res.data; this.info = res.data;
this.title = this.info.title; this.title = this.info.title;

View File

@ -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,8 +33,8 @@
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>
@ -79,15 +80,13 @@
</view> </view>
</view> </view>
</view> </view>
</view>
<!-- 激励视频广告 --> <!-- 激励视频广告 -->
<ad-rewarded-video ref="adRewardedVideo" adpid="1531580352" :preload="false" :loadnext="false" <ad-rewarded-video ref="adRewardedVideo" adpid="1531580352" :loadnext="true" v-slot:default="{loading, error}"
:disabled="true" v-slot:default="{loading, error}" @load="onadload" @close="onadclose" :url-callback="urlCallback" @load="onadload" @close="onadclose" @error="onaderror">
@error="onaderror">
<view class="ad-error" v-if="error">{{error}}</view> <view class="ad-error" v-if="error">{{error}}</view>
</ad-rewarded-video> </ad-rewarded-video>
</view> </view>
</view>
</template> </template>
<script> <script>
@ -127,12 +126,11 @@
signInBtn: '点击签到', signInBtn: '点击签到',
isShowMoneyPay: true, isShowMoneyPay: true,
isIos: false, isIos: false,
isLoading: false, isAndroid: true,
isAndroid: false, 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 => {
@ -148,26 +146,12 @@
this.isShowMoneyPay = !(res.data.value == '1' && isIos) this.isShowMoneyPay = !(res.data.value == '1' && isIos)
} }
}); });
}, },
async onReady() {
this.isLoading = true;
console.log(1)
// 广
setTimeout(() => {
this.$refs.adRewardedVideo.load();
}, 1000)
},
methods: { methods: {
showAd() {
console.log(this.isLoading)
if (this.isLoading) {
return
}
this.$refs.adRewardedVideo.show();
},
onadload(e) { onadload(e) {
this.isLoading = false;
console.log(2)
console.log('广告数据加载成功'); console.log('广告数据加载成功');
}, },
async onadclose(e) { async onadclose(e) {
@ -176,20 +160,13 @@
// //
// /sqx_fast/app/ad/state // /sqx_fast/app/ad/state
let res = await this.$Request.getT('app/ad/state', { let res = await this.$Request.getT('app/ad/state', {
extraKey: 1 extraKey: this.urlCallback.extra
})
this.$Request.get('/app/common/type/813').then(res => {
if (res.code == 0 && res.data.value) {
if (res.data.value == '是') {
this.getActivitys()
}
}
}) })
this.$Request.getT('/app/common/type/921').then(res => { this.$Request.getT('/app/common/type/921').then(res => {
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'
}) })
} }
@ -197,13 +174,9 @@
} else { } else {
// 退 // 退
} }
//this.isLoading = true;
//this.$refs.adRewardedVideo.load();
}, },
onaderror(e) { onaderror(e) { // 广
// 广
console.log("广告加载失败") console.log("广告加载失败")
this.isLoading = false;
}, },
/** /**
* 获取签到数据 * 获取签到数据
@ -256,8 +229,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"