Parcourir la source

职位广告存在重定向,登录企业账号以后可以直接跳转发布职位

lifanagju_citu il y a 5 mois
Parent
commit
a462e9f1e4
2 fichiers modifiés avec 42 ajouts et 10 suppressions
  1. 7 1
      src/store/user.js
  2. 35 9
      src/views/recruit/personal/home/index.vue

+ 7 - 1
src/store/user.js

@@ -173,9 +173,15 @@ export const useUserStore = defineStore('user',
         await this.getEnterpriseUserAccountInfo()
         
         Snackbar.success(res?.type === 'emailLogin' ? '登录成功' : '切换成功')
+        let href = '/enterprise'
+        // 是否存在重定向
+        if (localStorage.getItem('enterpriseRedirect')) {
+          href = localStorage.getItem('enterpriseRedirect')
+          localStorage.setItem('enterpriseRedirect', '')
+        }
         // 人才推荐不需要跳转
         if (!res.noJump) {
-          setTimeout(() => { window.location.href = '/enterprise' }, 1000)
+          setTimeout(() => { window.location.href = href }, 1000)
         }
       },
       // 获取当前登录的企业用户信息

+ 35 - 9
src/views/recruit/personal/home/index.vue

@@ -6,15 +6,27 @@
       <headSearch @handleSearch="handleSearch"></headSearch>
     </div>
     <hotJobs></hotJobs>
-    <div class="advertise" :style="{'width': showFullAdvertise ? '180px' : '20px'}">
-      <div v-if="showFullAdvertise">
-        <div class="advertise-title d-inline-block">
-          <span>广告</span>
-          <v-icon class="float-right cursor-pointer pb-1" color="primary" size="28" @click="showFullAdvertise = false">mdi-close</v-icon>
+    <div class="advertiseBox">
+      <div class="advertise" :style="{'width': showFullAdvertise ? '180px' : '20px'}">
+        <div v-if="showFullAdvertise">
+          <div class="advertise-title d-inline-block">
+            <span>广告</span>
+            <v-icon class="float-right cursor-pointer pb-1" color="primary" size="28" @click="showFullAdvertise = false">mdi-close</v-icon>
+          </div>
+          <img class="advertise-img cursor-pointer" src="https://minio.menduner.com/dev/menduner/advertise-website-home.png" @click="handleOpenAdvertise">
         </div>
-        <img class="advertise-img cursor-pointer" src="https://minio.menduner.com/dev/menduner/advertise-website-home.png" @click="handleOpenAdvertise">
+        <div v-else class="advertise-box cursor-pointer" @mouseenter="showFullAdvertise = true"></div>
+      </div>
+      <div class="advertise mt-3" :style="{'width': showFullAdvertise1 ? '180px' : '20px'}">
+        <div v-if="showFullAdvertise1">
+          <div class="advertise-title d-inline-block">
+            <span>广告</span>
+            <v-icon class="float-right cursor-pointer pb-1" color="primary" size="28" @click="showFullAdvertise1 = false">mdi-close</v-icon>
+          </div>
+          <img class="advertise-img cursor-pointer" src="https://minio.menduner.com/dev/ced2539479c70b62b61e039250fb3e36b72611f2b7db46f4540bb91081ddf223.jpg" @click="handleOpenAdvertise1">
+        </div>
+        <div v-else class="advertise-box cursor-pointer" @mouseenter="showFullAdvertise1 = true"></div>
       </div>
-      <div v-else class="advertise-box cursor-pointer" @mouseenter="showFullAdvertise = true"></div>
     </div>
     <div class="default-width content-box mb-5">
       <homeJobTypeCard></homeJobTypeCard>
@@ -54,6 +66,7 @@ import { getToken } from '@/utils/auth'
 import { getRewardEventList } from '@/utils/eventList'
 
 const showFullAdvertise = ref(true)
+const showFullAdvertise1 = ref(true)
 if (!getToken()) getRewardEventList()
 
 
@@ -84,6 +97,13 @@ const handleSearch = (val) => {
 const handleOpenAdvertise = () => {
   window.open('https://mp.weixin.qq.com/s/Us_cWsRpGQBnLFBrZGynLA')
 }
+// 广告跳转1
+const handleOpenAdvertise1 = () => {
+  const add = '/recruit/enterprise/position/add'
+  const url = getToken(1) ? add : '/login?entLogin=true'
+  if (!getToken(1)) localStorage.setItem('enterpriseRedirect', add)
+  window.open(url)
+}
 
 const adImgWidth = ref(document?.documentElement?.clientWidth ?
   Math.floor(document.documentElement.clientWidth/2.2) > 500 ?
@@ -111,10 +131,16 @@ const adClick = () => {
   z-index: 999;
   background-color: var(--default-bgc);
 }
-.advertise {
+.advertiseBox {
   position: sticky;
   top: 128px;
   z-index: 999;
+  // height: 360px;
+}
+.advertise {
+  // position: sticky;
+  // top: 128px;
+  // z-index: 999;
   height: 360px;
   &-box {
     position: relative;
@@ -149,7 +175,7 @@ const adClick = () => {
   }
 }
 .content-box {
-  margin-top: -360px;
+  margin-top: -720px;
 }
 .banner {
   width: 100%;