Commit 93b4ac01 authored by 黄奎's avatar 黄奎

广告修改

parent 7e2eddf6
......@@ -385,8 +385,7 @@
</div>
<div class="footer-bottom">
<div class="sponsor">
<a @click="OpenNewUrl(item.url)" target="_blank" v-for="(item,index) in dataList.BottomList"
:key="index">
<a @click="OpenNewUrl(item.url)" target="_blank" v-for="(item,index) in dataList.BottomList" :key="index">
<img :src="item.icon" />
</a>
</div>
......@@ -396,7 +395,7 @@
</div>
<div class="footer-watermark footer_Left">
<template v-if="dataList&&dataList.AdLeftList">
<div v-for="(item,index) in dataList.AdLeftList" :key="index">
<div v-for="(item,index) in getAdLeftList" :key="index">
<a @click="OpenNewUrl(item.AdLink)">
<img style="width:100%" :src="item.AdImg" />
</a>
......@@ -405,7 +404,7 @@
</div>
<div class="footer-watermark footer_Right">
<template v-if="dataList&&dataList.AdRightList">
<div v-for="(item,index) in dataList.AdRightList" :key="index">
<div v-for="(item,index) in getAdRightList" :key="index">
<a @click="OpenNewUrl(item.AdLink)">
<img style="width:100%" :src="item.AdImg" />
</a>
......@@ -429,8 +428,53 @@
var myDate = new Date();
this.year = myDate.getFullYear();
},
computed: {
getAdLeftList() {
var tempArray = [];
var showId = this.getShowId();
if (this.dataList && this.dataList.AdLeftList) {
this.dataList.AdLeftList.forEach(item => {
if (item.ShowPage.indexOf(showId) > -1) {
tempArray.push(item);
}
});
}
return tempArray;
},
getAdRightList() {
var tempArray = [];
var showId = this.getShowId();
if (this.dataList && this.dataList.AdRightList) {
this.dataList.AdRightList.forEach(item => {
if (item.ShowPage.indexOf(showId) > -1) {
tempArray.push(item);
}
});
}
return tempArray;
}
},
methods: {
getShowId() {
let locationName = window.location.hostname;
var routeStr = this.$route.path.toLowerCase();
var showId = 0;
switch (routeStr) {
case "/index":
showId = 1;
break;
case '/search':
showId = 2;
break;
case '/trip':
showId = 3;
break;
case '/self':
showId = 4;
break;
}
return showId;
}
},
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment