|
@@ -25,6 +25,32 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
+
|
|
|
+ <v-dialog v-model="showDialog" max-width="900" :persistent="false" :width="adImgWidth">
|
|
|
+ <v-carousel
|
|
|
+ :show-arrows="adList && adList.length && adList.length > 1 ? 'hover' :false"
|
|
|
+ :model-value="0"
|
|
|
+ style="height: auto;"
|
|
|
+ :hide-delimiters="adList && adList.length && adList.length > 1 ? false : true"
|
|
|
+ >
|
|
|
+ <v-carousel-item v-for="(item, i) in adList" :key="i" @click.stop="handleClick(item)" >
|
|
|
+ <div :style="{'width': adImgWidth + 'px'}" class="position-relative" :class="{'cursor-pointer': item.link}">
|
|
|
+ <span
|
|
|
+ style="font-size: 3rem; z-index: 2;"
|
|
|
+ class="mdi mdi-close-circle-outline cursor-pointer px-3 position-absolute right-0 top-0 color-white"
|
|
|
+ @click="showDialog = false"
|
|
|
+ ></span>
|
|
|
+ <v-img :src="item.img" :lazy-src="item.img" :width="adImgWidth" style="height: auto;border-radius: 4px;">
|
|
|
+ <template v-slot:placeholder>
|
|
|
+ <v-row align="center" class="fill-height ma-0" justify="center">
|
|
|
+ <v-progress-circular color="grey-lighten-5" indeterminate></v-progress-circular>
|
|
|
+ </v-row>
|
|
|
+ </template>
|
|
|
+ </v-img>
|
|
|
+ </div>
|
|
|
+ </v-carousel-item>
|
|
|
+ </v-carousel>
|
|
|
+ </v-dialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
@@ -32,9 +58,10 @@ defineOptions({ name: 'enterprise-layout-index' })
|
|
|
import Headers from './company/navBar.vue'
|
|
|
import side from './company/side.vue'
|
|
|
import { useRouter, useRoute } from 'vue-router'
|
|
|
-import { watch, computed } from 'vue'
|
|
|
+import { ref, watch, computed, onMounted } from 'vue'
|
|
|
import { useSystem } from '@/store/system'
|
|
|
import { useUserStore } from '@/store/user'
|
|
|
+import { getWebContent } from '@/api/common'
|
|
|
|
|
|
const router = useRouter()
|
|
|
const route = useRoute()
|
|
@@ -43,6 +70,50 @@ const key = computed(() => {
|
|
|
return route.path + Math.random()
|
|
|
})
|
|
|
|
|
|
+// 广告图
|
|
|
+const showDialog = ref(false)
|
|
|
+const adList = ref([])
|
|
|
+const adImgWidth = ref(document?.documentElement?.clientWidth ?
|
|
|
+ Math.floor(document.documentElement.clientWidth/2.2) > 500 ?
|
|
|
+ Math.floor(document.documentElement.clientWidth/2.2) : 500
|
|
|
+ : 900
|
|
|
+)
|
|
|
+
|
|
|
+const getSystemWebContent = async () => {
|
|
|
+ adList.value = []
|
|
|
+ try {
|
|
|
+ const data = await getWebContent()
|
|
|
+ adList.value = data?.pcBackendAdvertisement || []
|
|
|
+ // 企业登录-免费职位广告提示
|
|
|
+ if (localStorage.getItem('positionAd')) {
|
|
|
+ adList.value.unshift({
|
|
|
+ title: '',
|
|
|
+ mark: '',
|
|
|
+ img: 'https://minio.menduner.com/dev/ddaafc5a27a735332daabbddc2c6bfe8913a2de02692f7b94f92b9f2b9e56460.jpg',
|
|
|
+ link: '/recruit/enterprise/position/add',
|
|
|
+ sort: 0,
|
|
|
+ status: '0'
|
|
|
+ })
|
|
|
+ localStorage.removeItem('positionAd')
|
|
|
+ }
|
|
|
+ localStorage.setItem('showEnterpriseAdDialog', 'true')
|
|
|
+ showDialog.value = adList.value && adList.value.length ? true : false
|
|
|
+ } catch {}
|
|
|
+}
|
|
|
+
|
|
|
+onMounted(() => {
|
|
|
+ if (!localStorage.getItem('showEnterpriseAdDialog')) {
|
|
|
+ getSystemWebContent()
|
|
|
+ }
|
|
|
+})
|
|
|
+
|
|
|
+// 点击弹窗广告
|
|
|
+const handleClick = (val) => {
|
|
|
+ if (!val || !val.link) return
|
|
|
+ showDialog.value = false
|
|
|
+ router.push(val.link)
|
|
|
+}
|
|
|
+
|
|
|
const whiteList = [
|
|
|
'/recruit/enterprise/resumeManagement/talentPool/details/details',
|
|
|
'/recruit/enterprise/talentPool/details',
|
|
@@ -60,35 +131,12 @@ const isInWhiteList = (url)=> {
|
|
|
}
|
|
|
}
|
|
|
return false
|
|
|
- // return whiteList.includes(url)
|
|
|
}
|
|
|
|
|
|
-// const breadcrumbs = ref([])
|
|
|
-// const getTitle = (list, fullPath) => {
|
|
|
-// const _fullPath = fullPath.split('/')
|
|
|
-// const arr = list.map((item, index) => {
|
|
|
-// // 重组路径
|
|
|
-// if (item.path === list[index - 1]?.path) return false
|
|
|
-// const text = item.meta.title
|
|
|
-// const _path = item.path.split('/')
|
|
|
-// const obj = {
|
|
|
-// text,
|
|
|
-// to: _path.map((e, i) => _fullPath[i]).join('/')
|
|
|
-// }
|
|
|
-// return obj
|
|
|
-// }).filter(e => e) || []
|
|
|
-// if (arr?.length) {
|
|
|
-// arr[arr.length - 1].disabled = true
|
|
|
-// arr[arr.length - 1].link = true
|
|
|
-// }
|
|
|
-// breadcrumbs.value = arr
|
|
|
-// }
|
|
|
-
|
|
|
const user = useUserStore()
|
|
|
watch(
|
|
|
() => route.matched,
|
|
|
async (val) => {
|
|
|
- // getTitle(val, route.fullPath)
|
|
|
system.setBreadcrumbs(val, route.fullPath)
|
|
|
await user.getEnterpriseInfo(true)
|
|
|
},
|
|
@@ -187,4 +235,13 @@ $top: 50px;
|
|
|
background: rgba(0, 0, 0, 0.15);
|
|
|
transition: color 0.2s ease;
|
|
|
}
|
|
|
+// 弹窗广告轮播图样式调整
|
|
|
+:deep {
|
|
|
+ .v-carousel__controls {
|
|
|
+ background: none;
|
|
|
+ }
|
|
|
+ .v-carousel__controls__item .v-icon {
|
|
|
+ opacity: 1;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|