广告观看限制

This commit is contained in:
GaoHao
2024-12-25 18:21:34 +08:00
parent 2d1ccf6793
commit 646379471f
2 changed files with 22 additions and 17 deletions

View File

@@ -1,10 +1,10 @@
// const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; // const ROOTPATH1 = "https://dj-api.hnsiyao.cn/sqx_fast/"; //
// const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名 const ROOTPATH = "https://dj-api.hnsiyao.cn/sqx_fast/"; //后台服务域名
// const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名 const ROOTPATH2 = "https://dj-h5.hnsiyao.cn"; //后台服务域名
const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; // // const ROOTPATH1 = "https://video.hnsiyao.cn/sqx_fast/"; //
const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名 // const ROOTPATH = "https://video.hnsiyao.cn/sqx_fast/"; //后台服务域名
const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名 // const ROOTPATH2 = "https://video-h5.hnsiyao.cn"; //后台服务域名
// const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; // // const ROOTPATH1 = "http://192.168.1.5:8100/sqx_fast/"; //
// const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名 // const ROOTPATH = "http://192.168.1.5:8100/sqx_fast/"; //后台服务域名

View File

@@ -119,13 +119,12 @@
isAndroid: false, isAndroid: false,
adRewardedVideo: true, adRewardedVideo: true,
urlCallback: null, urlCallback: null,
isTooltipVisible: false, isTooltipVisible: false,
tooltipTimeout: null, tooltipTimeout: null,
} }
}, },
onShow() { onShow() {
this.signInList = [] this.signInList = []
this.adRewardedVideo = true;
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 => {
@@ -160,6 +159,7 @@
* @param {Object} e * @param {Object} e
*/ */
onadload(e) { onadload(e) {
this.adRewardedVideo = true;
console.log('广告数据加载成功'); console.log('广告数据加载成功');
}, },
/** /**
@@ -243,17 +243,17 @@
// jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 , // jumpType (integer, optional): 跳转类型 1 内部路径 2 外部路径 ,
// type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 , // type (integer, optional): 任务类型 1 普通任务 2 打卡任务 9 其它 ,
// buttonUrl // buttonUrl
uni.showToast({
title: this.adRewardedVideo,
icon: 'none'
})
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)
} else if (item.buttonTitle.indexOf("观看视频") != -1) { } else if (item.buttonTitle.indexOf("观看视频") != -1) {
// 首次加载广告 // 首次加载广告
// uni.showToast({
// title: this.adRewardedVideo,
// icon: 'none'
// })
this.urlCallback = { this.urlCallback = {
userId: uni.getStorageSync('userId'), userId: uni.getStorageSync('userId'),
extra: uni.getStorageSync('userId') + "" + new Date().getTime(), extra: uni.getStorageSync('userId') + "" + new Date().getTime(),
@@ -328,13 +328,18 @@
this.list.map(item=>{ this.list.map(item=>{
item.show = true item.show = true
}) })
// #ifdef H5 console.log(this.adRewardedVideo)
this.list.map(item=>{ this.list.map(item=>{
if(item.title.indexOf("观看视频") != -1&&this.adRewardedVideo) { if(item.title.indexOf("观看视频") != -1&&!this.adRewardedVideo) {
item.show = false
}
// #ifdef H5
if(item.title.indexOf("观看视频") != -1) {
item.show = false item.show = false
} }
// #endif
}) })
// #endif
} }
uni.stopPullDownRefresh(); uni.stopPullDownRefresh();