Parcourir la source

优选集团、登录页背景从接口获取

Xiao_123 il y a 5 mois
Parent
commit
fa768bf257

+ 0 - 1
src/App.vue

@@ -14,7 +14,6 @@ function open () {
 }
 onMounted(() => {
   nextTick(() => {
-    // testVersionFun()
     console.log('baseurl:', import.meta.env?.VITE_BASE_URL, 'vue_version:', vue_version) // 打印
     const process_ENV = process?.env?.NODE_ENV || ''
     if (process_ENV === 'production' || process_ENV === 'development') {

+ 0 - 4
src/utils/testVersion.js

@@ -1,4 +0,0 @@
-export const testVersionFun = () => {
-  console.log('23456', 789)
-  console.log('VITE_VERSION', import.meta.env?.VITE_VERSION)
-}

+ 5 - 3
src/views/login/index.vue

@@ -1,5 +1,5 @@
 <template>
-  <div class="box">
+  <div class="box" :style="{'background-image': 'url(' + logoBgUrl + ')'}">
     <div class="content">
       <div class="login-content">
         <v-card height="392px" class="carousel mr-3" style="width: 792px; border-radius: 8px;">
@@ -110,10 +110,12 @@ onMounted(() => {
   isMobile.value = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(userAgent)
 })
 
-// 获取轮播图
+// 获取轮播图、背景图
+const logoBgUrl = ref('')
 const carouselList = ref([])
 const getSystemWebContent = async () => {
   const data = await getWebContent()
+  logoBgUrl.value = data.pcLoginBackground && data.pcLoginBackground.length ? data.pcLoginBackground[0].img : 'https://minio.menduner.com/dev/menduner/login-bgc.jpg'
   carouselList.value = data.pcLoginCarousel || []
 }
 getSystemWebContent()
@@ -257,7 +259,7 @@ const windowOpen = (url) => {
   position: relative;
   width: 100%;
   height: 100vh;
-  background-image: url('https://minio.menduner.com/dev/menduner/login-bgc.jpg');
+  // background-image: url('https://minio.menduner.com/dev/menduner/login-bgc.jpg');
   background-size: cover;
   overflow: hidden;
   .navBar {

+ 11 - 9
src/views/recruit/personal/home/components/advertisement/index.vue

@@ -10,7 +10,7 @@
 
     <div no-gutters class="mt-5 d-flex flex-wrap" style="width: 100%;">
       <v-card v-for="(k, i) in list" :key="i" class="col-item" @click="handleOpen(k)">
-        <v-img :src="k.url"/>
+        <v-img :src="k.img"/>
       </v-card>
     </div>
   </div>
@@ -19,16 +19,18 @@
 <script setup>
 defineOptions({ name: 'advertisementPage'})
 
-const date = new Date()
-const list = [
-  { url: `https://minio.citupro.com/dev/menduner/preferredGroup/MARRIOTT.jpg?time=${date.getTime()}`, path: '/recruit/personal/advertisement/introduce/marriott/734173233779183616' },
-  { url: `https://minio.citupro.com/dev/menduner/preferredGroup/IHG.jpg?time=${date.getTime()}`, path: '/recruit/personal/advertisement/introduce/577540545828753408' },
-  { url: `https://minio.citupro.com/dev/menduner/preferredGroup/Yifei.jpg?time=${date.getTime()}`, path: '/recruit/personal/company/details/277182701256183808?key=briefIntroduction' }
-]
+defineProps({ list: Array })
+
+// const date = new Date()
+// const list = [
+//   { url: `https://minio.citupro.com/dev/menduner/preferredGroup/MARRIOTT.jpg?time=${date.getTime()}`, path: '/recruit/personal/advertisement/introduce/marriott/734173233779183616' },
+//   { url: `https://minio.citupro.com/dev/menduner/preferredGroup/IHG.jpg?time=${date.getTime()}`, path: '/recruit/personal/advertisement/introduce/577540545828753408' },
+//   { url: `https://minio.citupro.com/dev/menduner/preferredGroup/Yifei.jpg?time=${date.getTime()}`, path: '/recruit/personal/company/details/277182701256183808?key=briefIntroduction' }
+// ]
 
 const handleOpen = (k) => {
-  if (!k.path) return
-  window.open(k.path)
+  if (!k.link) return
+  window.open(k.link)
 }
 </script>
 

+ 10 - 4
src/views/recruit/personal/home/index.vue

@@ -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 {