瀏覽代碼

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

lifanagju_citu 2 月之前
父節點
當前提交
c2f623636b

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

@@ -266,7 +266,7 @@ service.interceptors.response.use(
       Snackbar.error(t('sys.api.errMsg901'))
       return Promise.reject(new Error(msg))
     }
-    if ([1100017019, 1100016002, 1100021016, 1100017022].includes(code)) {
+    if ([1100017019, 1100016002, 1100021016, 1100017022, 1100056008, 1100056005].includes(code)) {
       // 1100017019邮箱未注册、1100016002手机号未注册过、1100021016注册企业申请中
       // 未注册过的手机号将code码返回
       return Promise.reject(data)

+ 12 - 12
src/views/recruit/enterprise/jobFair/details.vue

@@ -1,10 +1,11 @@
 <template>
-  <v-card class="card-box pa-4">
+  <v-card class="card-box pa-4" :style="`background-color: ${jobFairInfo?.backgroundColour}`">
     <div class="position-relative">
+      <div class="text-center mb-5 mt-2 font-weight-bold font-size-20" style="color: #fff">{{ jobFairInfo?.title?.replace(/<\/?p[^>]*>/gi, '') }}</div>
       <div class="text-end mb-3">
-        <v-btn color="primary" @click="handleAdd">新增职位</v-btn>
-        <v-btn color="primary" class="mx-3" variant="outlined" @click="handleJoin">选择已发布的职位加入招聘会</v-btn>
-        <v-btn color="primary" v-if="bgImg" variant="outlined" prepend-icon="mdi-share-all" @click="handleShare">我的分享海报</v-btn>
+        <v-btn color="#fff" :style="`color: ${jobFairInfo?.backgroundColour || 'var(--v-primary-base)'}`" @click="handleAdd">新增职位</v-btn>
+        <v-btn color="#fff" class="mx-3" variant="outlined" @click="handleJoin">选择已发布的职位加入招聘会</v-btn>
+        <v-btn color="#fff" v-if="jobFairInfo?.contentImg" variant="outlined" prepend-icon="mdi-share-all" @click="handleShare">我的分享海报</v-btn>
       </div>
       <JobItem :items="jobList" @refresh="getJobList"></JobItem>
 
@@ -73,8 +74,8 @@
           :jobFairId="id"
           :enterpriseId="entBaseInfo?.id"
           :positionList="positionList" 
-          :bgImg="bgImg"
-          :backgroundColor="bgColor" 
+          :bgImg="jobFairInfo?.contentImg"
+          :backgroundColor="jobFairInfo?.backgroundColour" 
           @success="handlePreview"
         ></JobFairEntShare>
       </div>
@@ -124,8 +125,6 @@ const enterpriseName = ref(formatName(entBaseInfo.value.enterpriseAnotherName ||
 const logoUrl = ref(entBaseInfo.value.logoUrl)
 const previewSrc  = ref('')
 const positionList = ref([])
-const bgImg = ref('')
-const bgColor = ref('')
 
 // 职位列表
 const getJobList = async () => {
@@ -179,13 +178,14 @@ const getPositionList = async () => {
 }
 getJobList()
 
-const getJob = async () => {
+// 获取招聘会信息
+const jobFairInfo = ref({})
+const getJobFairInfo = async () => {
   const data = await getJobFair(id)
   if (!data) return
-  bgImg.value = data.contentImg
-  bgColor.value = data.backgroundColour
+  jobFairInfo.value = data || {}
 }
-getJob()
+getJobFairInfo()
 
 // 分享海报预览
 const handlePreview = (val) => {

+ 6 - 3
src/views/recruit/enterprise/jobFair/index.vue

@@ -240,9 +240,12 @@ const handleBlockEnterprise = async (val) => {
   try {
     const data = await getCheckJobFairPermission(val.id)
     if (data) router.push(`/recruit/enterprise/jobFair/details/${val.id}`)
-  } catch {
-    if (val?.admissionPrice && val?.admissionPrice > 0) {
-      // 购买门票
+  } catch (error) {
+    // 权限被禁用
+    if (error?.code === 1100056008) return Snackbar.warning(error.msg)
+    // 没有权限参加招聘会,购买门票
+    if (error?.code === 1100056005 && val?.admissionPrice && val?.admissionPrice > 0) {
+      Snackbar.warning('您当前暂无权限参与招聘会,请先购买门票')
       info.value = val
       if (timer.value) clearInterval(timer.value); timer.value = null
       await getCodeList()

+ 14 - 4
src/views/recruit/enterprise/jobFair/job/item.vue

@@ -1,7 +1,7 @@
 <template>
   <div>
     <div v-if="items.length">
-      <div v-for="val in items" :key="val.id" class="itemBox mb-3" style="height: 134px;">
+      <div v-for="val in items" :key="val.id" class="itemBox mb-3 white-bgc" style="height: 134px;">
         <div class="d-flex justify-space-between" style="padding: 10px 20px;">
           <div class="position">
             <div class="d-flex align-center">
@@ -21,7 +21,10 @@
               <span>{{ val.positionName }}</span>
             </div>
           </div>
-          <div class="text-center color-primary d-flex flex-column justify-center cursor-pointer" @click="handleToResume(val)">
+          <div 
+            class="text-center color-primary d-flex flex-column justify-center cursor-pointer"
+            @click="handleToResume(val)"
+          >
             <div class="font-weight-bold font-size-18">{{ val.count || 0 }}</div>
             <div class="font-size-14">已投递简历</div>
           </div>
@@ -36,7 +39,7 @@
         </div>
       </div>
     </div>
-    <Empty v-else :elevation="false"></Empty>
+    <div v-else class="empty-text">暂无数据,去发布职位看看吧~</div>
   </div>
 
   <Loading :visible="loading"></Loading>
@@ -71,7 +74,7 @@ const handleEdit = async (val) => {
 
 
 const handleRemove = ({ id }) => {
-  Confirm('确定要移出该职位吗?', '提示').then(async () => {
+  Confirm('系统提示', '是否确认将此职位移出招聘会?').then(async () => {
     await quitJobFairPosition({
       jobFairId: route.params.id,
       jobId: id
@@ -89,9 +92,16 @@ const handleToResume = (val) => {
 </script>
 
 <style scoped lang="scss">
+.empty-text {
+  height: 50vh;
+  line-height: 50vh;
+  text-align: center;
+  color: #fff;
+}
 .itemBox {
   position: relative;
   border: 1px solid #e5e6eb;
+  border-radius: 4px;
 }
 .position-name {
   color: var(--color-333);