فهرست منبع

Merge branch 'jobFair' of https://git.citupro.com/zhengnaiwen_citu/menduner into jobFair

lifanagju_citu 1 ماه پیش
والد
کامیت
c3965d30ee
4فایلهای تغییر یافته به همراه83 افزوده شده و 35 حذف شده
  1. 1 0
      src/config/axios/service.js
  2. 81 24
      src/layout/enterprise.vue
  3. 0 10
      src/permission.js
  4. 1 1
      src/version.js

+ 1 - 0
src/config/axios/service.js

@@ -63,6 +63,7 @@ service.interceptors.request.use(
   async (config) => {
     const userStore = useUserStore()
     config.headers['Accept-Language'] = getCurrentLocaleLang() ?? 'zh_CN'
+    config.headers['Login-User-Type'] = 1
     // 是否需要设置 token
     let isToken = (config.headers || {}).isToken === false
     // token类型. api》function中设置tokenIndex(优先)

+ 81 - 24
src/layout/enterprise.vue

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

+ 0 - 10
src/permission.js

@@ -41,16 +41,6 @@ router.beforeEach(async (to, from, next) => {
     // 强制填写个人信息 fddeaddc47868b/ready
     else if (localStorage.getItem('chooseRole') === 'showChooseRole' && to.path !== '/register/selectedPersonRole' && tokenIndex === 2) next('/register/selectedPersonRole')
     else if (localStorage.getItem('necessaryInfoReady') === 'fddeaddc47868b' && tokenIndex === 2 && localStorage.getItem('chooseRole') !== 'showChooseRole') dialogExtend('necessaryInfoDialog')
-    // 企业登录-招聘会广告
-    // else if (!localStorage.getItem('jobFairAd') && tokenIndex === 1) {
-    //   localStorage.setItem('jobFairAd', 'hasBeenShow')
-    //   dialogExtend('jobFairAd')
-    // }
-    // 企业登录-免费职位广告提示
-    else if (localStorage.getItem('positionAd') && tokenIndex === 1) {
-      localStorage.setItem('positionAd', '')
-      dialogExtend('positionAd')
-    }
     // 企业信息完成度提示
     else if (localStorage.getItem('checkEnterpriseBaseInfoFalseHref') && tokenIndex === 1) {
       if (to.path !== '/recruit/enterprise/position/add') { // 除了点击企业登录免费职位广告提示跳转路由不提示

+ 1 - 1
src/version.js

@@ -1,2 +1,2 @@
 // 版本号
-export const vue_version = 'v25.03.25.1210'
+export const vue_version = 'v25.04.07.1815'