Browse Source

企业名称带有&符号会传递缺失,改为使用企业详情接口获取企业简称

lifanagju_citu 3 weeks ago
parent
commit
7c778558ed

+ 1 - 1
pagesB/jobFair/enterprisesClassification.vue

@@ -28,7 +28,7 @@
               @tap="handClickTab(index)"
             >
               <view>
-                <view class="text MiSans-Medium">{{ val.title }}</view>
+                <view class="text MiSans-Medium">{{ formatName(val?.title) }}</view>
                 <view v-if="index === tabIndex" class="choose" style="background-color: #fff;"></view>
                 <view v-else class="choose" style="background-color: #ffffff00;"></view>
               </view>

+ 1 - 1
pagesB/jobFair/jobFairEntShare.vue

@@ -58,7 +58,7 @@ const getEntPositionList = async () => {
     const list = res?.data?.list?.length ? res.data.list : []
     positionNameList = list.map(e => { return formatName(e?.name) })
     entLogoUrl = list[0]?.enterprise?.logoUrl || ''
-    entName = list[0]?.enterprise?.anotherName || ''
+    entName = formatName(list[0]?.enterprise?.anotherName) || ''
   } catch (error) {}
 }
 

+ 17 - 8
pagesB/jobFair/positionClassification.vue

@@ -7,7 +7,7 @@
 
         <!-- 招聘会企业下的职位列表 -->
         <template v-if="query?.enterpriseId">
-          <view class="enterpriseName" :style="`color: ${entNameColor}`">{{ entName }}</view>
+          <view class="enterpriseName" :style="`color: ${entNameColor}`">{{ formatName(entName) }}</view>
           <view class="stick ss-p-y-30" :style="`background-color: ${backgroundColor}`">
             <!-- 搜索条 -->
             <view style="position: relative;">
@@ -53,7 +53,7 @@
                 @tap="handClickTab(index)"
               >
                 <view>
-                  <view class="text">{{ val.title }}</view>
+                  <view class="text">{{ formatName(val?.title) }}</view>
                   <view v-if="index === tabIndex" class="choose" style="background-color: #fff;"></view>
                   <view v-else class="choose" style="background-color: #ffffff00;"></view>
                 </view>
@@ -92,6 +92,9 @@ import { getJobFairEntJobPage, getJobFair } from '@/api/jobFair'
 import PositionList from '@/components/PositionList'
 import SwiperAd from '@/components/SwiperAd'
 import { getShareQueryById } from '@/api/jobFair.js'
+import { formatName } from '@/utils/getText'
+import { getEnterpriseDetails } from '@/api/user'
+
 
 const loading = ref(true)
 const more = ref('more')
@@ -107,8 +110,7 @@ const entName = ref('')
 const showShareBtn = ref(false)
 
 onLoad(async (options) => {
-  // 海报二维码分享
-	if (options.scene) {
+	if (options.scene) { // 海报二维码分享
     const scene = decodeURIComponent(options.scene)
     console.log(scene, 'scene')
     const key = scene.split('=')[1]
@@ -118,15 +120,16 @@ onLoad(async (options) => {
     options.jobFairId = res?.data?.jobFairId
     options.enterpriseId = res?.data?.enterpriseId
     options.backgroundColor = res?.data?.backgroundColor
-    options.entName = res?.data?.entName
+    options.entName = entName.value = formatName(res?.data?.entName)
   }
   if (options?.jobFairId) {
     query.jobFairId = options.jobFairId
     if (options.enterpriseId) {
       query.enterpriseId = options.enterpriseId
-      entName.value = options.entName
-      getEntShareImg()
+      getShareImg()
       getEntPositionList()
+      await getEnterpriseInfo()
+      options.entName = entName.value
     } else {
       getJobFairDetail()
     }
@@ -188,13 +191,19 @@ const getJobFairDetail = async () => {
   showShareBtn.value = Boolean(data?.shareImg)
 }
 
-const getEntShareImg = async () => {
+const getShareImg = async () => {
   if (!query.jobFairId) return
   const { data } = await getJobFair(query.jobFairId)
   showShareBtn.value = Boolean(data?.contentImg)
   backgroundColor.value = data.backgroundColour || '#fff'
 }
 
+const getEnterpriseInfo = async () => {
+  if (!query.enterpriseId) return
+  const { data } = await getEnterpriseDetails(query.enterpriseId)
+  entName.value = formatName(data?.enterprise?.anotherName || data?.enterprise?.name)
+}
+
 // 切换类型
 const handClickTab = (index) => {
   tabIndex.value = index