|
@@ -1,7 +1,7 @@
|
|
<template>
|
|
<template>
|
|
<div>
|
|
<div>
|
|
<!-- 顶部广告图 -->
|
|
<!-- 顶部广告图 -->
|
|
- <div v-if="topAdvertise" class="banner" :style="{'background-image': 'url('+topAdvertise+')'}"></div>
|
|
|
|
|
|
+ <div v-if="topAdvertise?.img" class="banner" :style="{'background-image': 'url('+topAdvertise?.img+')'}" :class="{'cursor-pointer': topAdvertise?.link}" @click="handleAdvertise"></div>
|
|
<div class="stickyBox py-5">
|
|
<div class="stickyBox py-5">
|
|
<headSearch @handleSearch="handleSearch"></headSearch>
|
|
<headSearch @handleSearch="handleSearch"></headSearch>
|
|
</div>
|
|
</div>
|
|
@@ -65,7 +65,7 @@ import { getRewardEventList } from '@/utils/eventList'
|
|
if (!getToken()) getRewardEventList()
|
|
if (!getToken()) getRewardEventList()
|
|
|
|
|
|
// 获取广告图
|
|
// 获取广告图
|
|
-const topAdvertise = ref('')
|
|
|
|
|
|
+const topAdvertise = ref({})
|
|
const leftAdvertise = ref([])
|
|
const leftAdvertise = ref([])
|
|
const dialogAdvertise = ref({})
|
|
const dialogAdvertise = ref({})
|
|
const preferred = ref([])
|
|
const preferred = ref([])
|
|
@@ -80,7 +80,7 @@ const getSystemWebContent = async () => {
|
|
}) : []
|
|
}) : []
|
|
preferredContent.value = data.appPreferredGroup
|
|
preferredContent.value = data.appPreferredGroup
|
|
// 顶部广告
|
|
// 顶部广告
|
|
- topAdvertise.value = data.pcTop && data.pcTop.length ? data.pcTop[0].img : ''
|
|
|
|
|
|
+ topAdvertise.value = data.pcTop && data.pcTop.length ? data.pcTop[0] : {}
|
|
// 弹窗广告
|
|
// 弹窗广告
|
|
dialogAdvertise.value = data.pcAdvertisement ? data.pcAdvertisement[0] : {}
|
|
dialogAdvertise.value = data.pcAdvertisement ? data.pcAdvertisement[0] : {}
|
|
// 左侧广告
|
|
// 左侧广告
|
|
@@ -104,6 +104,12 @@ const handleLeftClick = (val) => {
|
|
} else window.open(val.link)
|
|
} else window.open(val.link)
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+// 顶部banner跳转
|
|
|
|
+const handleAdvertise = () => {
|
|
|
|
+ if (!topAdvertise.value?.link) return
|
|
|
|
+ window.open(topAdvertise.value.link)
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
|
|
const router = useRouter()
|
|
const router = useRouter()
|
|
const handleSearch = (val) => {
|
|
const handleSearch = (val) => {
|