Browse Source

企业登录免费职位广告提示

lifanagju_citu 7 months ago
parent
commit
9ab9863941

+ 0 - 2
src/App.vue

@@ -5,8 +5,6 @@ import Confirm from '@/plugins/confirm'
 import axios from 'axios'
 import { vue_version } from './version.js'
 
-console.log(123456, '测试demo打包1')
-
 const timer = ref(null)
 const setIntervalTime = 3000 // 接口调用间隔时间
 

+ 6 - 1
src/permission.js

@@ -28,12 +28,17 @@ router.beforeEach(async (to, from, next) => {
     if (localStorage.getItem('entUpdatePassword') === 'needChange') fullScreen('entUpdatePassword')
     // 强制填写个人信息
     else if (localStorage.getItem('necessaryInfoReady') === 'fddeaddc47868b' && tokenIndex === 2) necessaryInfo('necessaryInfoDialog')
+    // 企业登录免费职位广告提示
+    // else if (localStorage.getItem('positionAd')) {
+    //   localStorage.setItem('positionAd', '')
+    //   necessaryInfo('positionAd')
+    // }
     // 企业信息完成度提示
     else if (localStorage.getItem('checkEnterpriseBaseInfoFalseHref')) {
       const href = localStorage.getItem('checkEnterpriseBaseInfoFalseHref')
       localStorage.setItem('checkEnterpriseBaseInfoFalseHref', '')
       localStorage.setItem('entUpdatePassword', '')
-      if (to.path !== '/recruit/enterprise/entInfoSetting') {
+      if (to.path !== href) {
         setTimeout(() => {
           Confirm('系统提示', '企业信息设置未完善,是否前往完善?').then(() => {
             window.location.href = href

+ 50 - 0
src/plugins/necessaryInfo/components/positionAd.vue

@@ -0,0 +1,50 @@
+<!-- 完善个人信息 -->
+<template>
+  <v-app>
+    <v-dialog
+      v-model="dialog"
+      max-width="900"
+      :persistent="false"
+      @update:modelValue="handleChange"
+    >
+      <div style="cursor: pointer; margin: 0 auto; position: relative;">
+        <v-img src="@/views/recruit/personal/home/img/adImg.jpg" :width="adImgWidth" style="height: auto;border-radius: 4px;" @click="adClick"></v-img>
+        <span style="color: #ddddddcc; font-size: 32px; position: absolute; right: 0px; top: 0px;" class="mdi mdi-close-circle-outline cursor-pointer px-3" @click="dialog = false"></span>
+      </div>
+    </v-dialog>
+  </v-app>
+</template>
+
+<script setup>
+defineOptions({name: 'necessaryInfo-positionAd'})
+import { onMounted, ref } from 'vue'
+
+const props = defineProps({
+  cancel: Function
+})
+
+const adImgWidth = ref(document?.documentElement?.clientWidth ?
+  Math.floor(document.documentElement.clientWidth/2.2) > 500 ?
+  Math.floor(document.documentElement.clientWidth/2.2) : 500
+  : 900
+)
+
+
+const dialog = ref(false)
+onMounted(() => {
+  dialog.value = true
+})
+
+const adClick =  () => {
+  dialog.value = false
+  window.location.href = '/recruit/enterprise/position/add'
+  props.cancel()
+}
+
+const handleChange = (val) => {
+  debugger
+  props.cancel()
+}
+</script>
+<style lang="scss" scoped>
+</style>

+ 5 - 1
src/plugins/necessaryInfo/index.js

@@ -1,10 +1,14 @@
 import { createApp } from 'vue'
 import necessaryInfoDialog from './components/necessaryInfoDialog.vue'
+import positionAd from './components/positionAd.vue'
 import vuetify from '@/plugins/vuetify'
 
 const toastMessage = (type, option = {})  => {
   return new Promise((resolve, reject) => {
-    const componentName = type === 'necessaryInfoDialog' ? necessaryInfoDialog : null
+    const componentName = type === 'necessaryInfoDialog' ?
+      necessaryInfoDialog : type === 'positionAd' ?
+      positionAd : null
+    //
     const rootNode = document.createElement("div")
       document.querySelector('.v-application').appendChild(rootNode)
       const app = createApp(componentName, {

+ 4 - 0
src/store/user.js

@@ -203,9 +203,13 @@ export const useUserStore = defineStore('user',
       async checkEnterpriseBaseInfo () {
         try {
           const data = await getEnterpriseBaseInfo()
+          console.log('获取《企业基本信息》:', data)
           if (data?.first !== false && data?.first !== 'false') {  // 首次登录才提示,不为false都属于首次登录
             localStorage.setItem('checkEnterpriseBaseInfoFalseHref', '/recruit/enterprise/entInfoSetting')
           }
+          if (!data?.bizFlag) {  // 企业登录免费职位广告提示
+            localStorage.setItem('positionAd', 'showPositionAd')
+          }
           // // 检验必填信息
           // const keyArr = ['industryId', 'financingStatus', 'scale', 'introduce', 'logoUrl'] // 必填信息列表
           // let href = '/recruit/enterprise/entInfoSetting'

+ 3 - 0
src/views/recruit/components/message/index.vue

@@ -412,6 +412,7 @@ async function getMessageTypeSync () {
   const _itemJSON = JSON.parse(_item.payload)
   const _content = JSON.parse(_itemJSON.content)
   positionInfo.value = _content.positionInfo
+  debugger
   const check = await jobCvRelCheckSend({ jobId: _content.positionInfo.id })
   handleChangeSendResumeStatus(check)
 }
@@ -478,6 +479,7 @@ const handleUploadResume = async (url, title, filename) => {
 const showUploadDialog = ref(false)
 const enRequestPositionInfo = ref({}) // 企业求简历时选中的职位信息
 async function handleSendResume (item) {
+  debugger
   try {
     item.loading = true
     // 获取简历列表
@@ -554,6 +556,7 @@ const handleSubmitAttachment = async () => {
     })
   } else {
     const jobId = enRequestPositionInfo.value && enRequestPositionInfo.value?.id ? enRequestPositionInfo.value?.id : positionInfo.value.id
+    debugger
     const type = (enRequestPositionInfo.value && Object.keys(enRequestPositionInfo.value).length ? enRequestPositionInfo.value.hire : positionInfo.value.hire) ? 1 : 0
     await jobCvRelSend({
       jobId,