首页广告优化

master
Lee-1203 2022-06-10 16:53:44 +08:00
parent 657fb67294
commit 0bc50874b9
1 changed files with 11 additions and 5 deletions

View File

@ -141,6 +141,7 @@
consult_amount: 0, // consult_amount: 0, //
bannerSrc: "", //banner bannerSrc: "", //banner
adSrc: "", //广 adSrc: "", //广
adUrl: "", //广
expertData: [], // expertData: [], //
video: null, video: null,
isPaused: true, isPaused: true,
@ -229,6 +230,7 @@
.then(function(res) { .then(function(res) {
console.log(res,'首页广告') console.log(res,'首页广告')
that.adSrc = res.data.data[0].src; that.adSrc = res.data.data[0].src;
that.adUrl = res.data.data[0].url;
}); });
}, },
@ -268,12 +270,16 @@
this.$router.push(path); this.$router.push(path);
}, },
toNewPage(){ toNewPage(){
let url = 'https://zym.emingren.com'; let url = this.adUrl;
if(this.ddEntrance == 'yes'){ if(this.adUrl == '' || this.adUrl == '#'){
// postMessage return false;
dd.postMessage({name:'newsPage',url:url});
}else{ }else{
window.open('https://zym.emingren.com'); if(this.ddEntrance == 'yes'){
// postMessage
dd.postMessage({name:'newsPage',url:url});
}else{
window.open(url);
}
} }
} }
}, },