|
@@ -12,15 +12,15 @@
|
|
class="ad-item-container"
|
|
class="ad-item-container"
|
|
v-for="(item, index) in adList"
|
|
v-for="(item, index) in adList"
|
|
:key="index"
|
|
:key="index"
|
|
- :data-exposure="(adCodeMap[routerName] || routerName) + (item.s_picalt || '')"
|
|
|
|
|
|
+ :data-exposure="(adCodeMap[routerName] || routerName) + (item.name || '')"
|
|
data-exposure-loop
|
|
data-exposure-loop
|
|
>
|
|
>
|
|
<a
|
|
<a
|
|
- :href="item.s_link"
|
|
|
|
|
|
+ :href="item.link"
|
|
target="_blank"
|
|
target="_blank"
|
|
- :id="(adCodeMap[routerName] || routerName) + (item.s_picalt || index)"
|
|
|
|
|
|
+ :id="(adCodeMap[routerName] || routerName) + (item.name || index)"
|
|
>
|
|
>
|
|
- <img :src="item.s_pic" :alt="(adCodeMap[routerName] || routerName) + (item.s_picalt || '')"/>
|
|
|
|
|
|
+ <img :src="item.pic" :alt="(adCodeMap[routerName] || routerName) + (item.name || '')"/>
|
|
</a>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
@@ -32,8 +32,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import { getAdList } from '@/api/modules/'
|
|
|
|
-import { getRandomString } from '@/utils/'
|
|
|
|
|
|
+import { fetchJyAdList } from '@/utils/'
|
|
import { mapState } from 'vuex'
|
|
import { mapState } from 'vuex'
|
|
export default {
|
|
export default {
|
|
name: 'content-layout',
|
|
name: 'content-layout',
|
|
@@ -108,7 +107,6 @@ export default {
|
|
this.routerName = this.$route.name
|
|
this.routerName = this.$route.name
|
|
},
|
|
},
|
|
methods: {
|
|
methods: {
|
|
- getRandomString,
|
|
|
|
async getAdvertisementList() {
|
|
async getAdvertisementList() {
|
|
const params = {
|
|
const params = {
|
|
code: this.adCode
|
|
code: this.adCode
|
|
@@ -122,11 +120,7 @@ export default {
|
|
|
|
|
|
if (!params.code) return console.warn('请传入adCode参数')
|
|
if (!params.code) return console.warn('请传入adCode参数')
|
|
|
|
|
|
- const { data } = await getAdList(params)
|
|
|
|
-
|
|
|
|
- if (Array.isArray(data)) {
|
|
|
|
- this.adList = data
|
|
|
|
- }
|
|
|
|
|
|
+ this.adList = await fetchJyAdList(params.code)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|