|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div>
|
|
|
<!-- 顶部广告图 -->
|
|
|
- <div class="banner"></div>
|
|
|
+ <div v-if="topAdvertise" class="banner" :style="{'background': 'url('+topAdvertise+') no-repeat'}"></div>
|
|
|
<div class="stickyBox py-5">
|
|
|
<headSearch @handleSearch="handleSearch"></headSearch>
|
|
|
</div>
|
|
@@ -20,8 +20,8 @@
|
|
|
</div>
|
|
|
<div class="default-width mb-5" :style="{'margin-top': leftAdvertise.length * (-372) + 'px'}">
|
|
|
<homeJobTypeCard></homeJobTypeCard>
|
|
|
- <advertisementPage class="my-3"></advertisementPage>
|
|
|
- <hotPromotedPositions></hotPromotedPositions>
|
|
|
+ <advertisementPage v-if="preferred.length" :list="preferred" class="my-3"></advertisementPage>
|
|
|
+ <hotPromotedPositions :class="{'mt-10': !preferred.length}"></hotPromotedPositions>
|
|
|
<PopularEnterprises class="mt-10"></PopularEnterprises>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -59,10 +59,16 @@ import { getRewardEventList } from '@/utils/eventList'
|
|
|
if (!getToken()) getRewardEventList()
|
|
|
|
|
|
// 获取广告图
|
|
|
+const topAdvertise = ref('')
|
|
|
const leftAdvertise = ref([])
|
|
|
const dialogAdvertise = ref({})
|
|
|
+const preferred = ref([])
|
|
|
const getSystemWebContent = async () => {
|
|
|
const data = await getWebContent()
|
|
|
+ // 优选集团
|
|
|
+ preferred.value = data.pcHomePreferred
|
|
|
+ // 顶部广告
|
|
|
+ topAdvertise.value = data.pcTop && data.pcTop.length ? data.pcTop[0].img : ''
|
|
|
// 弹窗广告
|
|
|
dialogAdvertise.value = data.pcAdvertisement ? data.pcAdvertisement[0] : {}
|
|
|
// 左侧广告
|
|
@@ -185,7 +191,7 @@ onMounted(async () => {
|
|
|
.banner {
|
|
|
width: 100%;
|
|
|
height: 110px;
|
|
|
- background: url("@/assets/headerBg.jpg") no-repeat;
|
|
|
+ // background: url("@/assets/headerBg.jpg") no-repeat;
|
|
|
background-size: contain;
|
|
|
}
|
|
|
.common-width {
|