|
@@ -12,6 +12,7 @@
|
|
|
|
|
|
|
|
<template>
|
|
<template>
|
|
|
<div class="page-wrapper">
|
|
<div class="page-wrapper">
|
|
|
|
|
+ <text>{{ adListJson }}</text>
|
|
|
<ad
|
|
<ad
|
|
|
adId="{{adList.adId}}"
|
|
adId="{{adList.adId}}"
|
|
|
style="height: 250px;width: 100%;"
|
|
style="height: 250px;width: 100%;"
|
|
@@ -101,7 +102,7 @@ import router from '@system.router'
|
|
|
// import system from '@system.system'
|
|
// import system from '@system.system'
|
|
|
export default {
|
|
export default {
|
|
|
public: {
|
|
public: {
|
|
|
- tab: '',
|
|
|
|
|
|
|
+ tab: '',
|
|
|
},
|
|
},
|
|
|
private: {
|
|
private: {
|
|
|
tabList: [
|
|
tabList: [
|
|
@@ -152,13 +153,49 @@ export default {
|
|
|
adList: {},
|
|
adList: {},
|
|
|
ad: null,
|
|
ad: null,
|
|
|
clickid:'',
|
|
clickid:'',
|
|
|
|
|
+ interstitialAdMultiton:null,
|
|
|
|
|
+ adListJson:'ddd',
|
|
|
|
|
+ adLists:[], // 多例广告
|
|
|
},
|
|
},
|
|
|
async onInit() {
|
|
async onInit() {
|
|
|
|
|
+
|
|
|
|
|
+ this.interstitialAdMultiton = require("@service.ad").createInterstitialAd({
|
|
|
|
|
+ multiton: true
|
|
|
|
|
+ })
|
|
|
|
|
+ this.interstitialAdMultiton.load({
|
|
|
|
|
+ adUnitId: '6bd7f72fb64249bda8770adc0619d0cc',
|
|
|
|
|
+ channel: 'vivo',
|
|
|
|
|
+ success: (data) => {
|
|
|
|
|
+ // prompt.showToast({
|
|
|
|
|
+ // message: `interstitialAdMultiton!success`
|
|
|
|
|
+ // })
|
|
|
|
|
+ this.adListJson = JSON.stringify(data)
|
|
|
|
|
+ let list = Array.isArray(data) ? data : (typeof data === 'object' ? [data] : [])
|
|
|
|
|
+ this.adLists = this.adLists.concat(list)
|
|
|
|
|
+ this.interstitialAdMultiton.show({
|
|
|
|
|
+ adid: this.adLists[0].adid,
|
|
|
|
|
+ }).then(() => {
|
|
|
|
|
+ // this.$broadcast('logsUnshift', `ad.show 成功`)
|
|
|
|
|
+ }, () => {
|
|
|
|
|
+ // this.$broadcast('logsUnshift', `ad.show 失败, err = ${JSON.stringify(err)}`)
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ fail: (data, err) => {
|
|
|
|
|
+ if (code === 205) {
|
|
|
|
|
+ this.adLists = data.adLists // 错误码205时,表示缓存已满导致加载失败,此时从缓存返回3个广告
|
|
|
|
|
+ } else {
|
|
|
|
|
+ prompt.showToast({
|
|
|
|
|
+ message: `fail!data= ${JSON.stringify(data)}, code= ${code}`
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
// this.selectedTab = this.tab // || 0 // 带参数则跳转对应页面
|
|
// this.selectedTab = this.tab // || 0 // 带参数则跳转对应页面
|
|
|
- // 获取后台配置 判断是否屏蔽小说/工具页面
|
|
|
|
|
- $apis.common.getConfig().then(res=>{
|
|
|
|
|
|
|
+ // 获取后台配置 判断是否屏蔽小说/工具页面 getAllConfig getConfig
|
|
|
|
|
+ $apis.common.getAllConfig().then(res=>{
|
|
|
console.log('res',res)
|
|
console.log('res',res)
|
|
|
- if(res.data.status == 1){ // 屏蔽书架/书城
|
|
|
|
|
|
|
+ let status = res.data.filter(item=>{ return item.type == 2 })[0].status // 屏蔽小说/工具
|
|
|
|
|
+ if(status == 1){ // 屏蔽书架/书城
|
|
|
this.isBlock = true
|
|
this.isBlock = true
|
|
|
this.tabList.splice(0,2)
|
|
this.tabList.splice(0,2)
|
|
|
this.tabList.splice(2,1)
|
|
this.tabList.splice(2,1)
|
|
@@ -173,9 +210,9 @@ export default {
|
|
|
// })
|
|
// })
|
|
|
//设备唯一标识。在 Android 上返回 IMEI 或 MEID; 在 Android Q 之后,除了华为手机返回 aaid(应用匿名设备标识符),
|
|
//设备唯一标识。在 Android 上返回 IMEI 或 MEID; 在 Android Q 之后,除了华为手机返回 aaid(应用匿名设备标识符),
|
|
|
// 其他厂商手机如果支持 oaid(匿名设备标识符)则返回 oaid,否则返回空值。
|
|
// 其他厂商手机如果支持 oaid(匿名设备标识符)则返回 oaid,否则返回空值。
|
|
|
- // $apis.common.vivoUpload({sign: data.deviceId, type: 1}).then(res=>{
|
|
|
|
|
- // console.log('res',res)
|
|
|
|
|
- // })
|
|
|
|
|
|
|
+ $apis.common.vivoUpload({sign: data.deviceId, type: 1}).then(res=>{
|
|
|
|
|
+ console.log('res',res)
|
|
|
|
|
+ })
|
|
|
},
|
|
},
|
|
|
fail: function(data, code) {
|
|
fail: function(data, code) {
|
|
|
console.log(`handling fail, code = ${code}`)
|
|
console.log(`handling fail, code = ${code}`)
|