Parcourir la source

获取实习扩展信息

lifanagju_citu il y a 1 mois
Parent
commit
ea9390a004
1 fichiers modifiés avec 13 ajouts et 8 suppressions
  1. 13 8
      components/positionItem/index.vue

+ 13 - 8
components/positionItem/index.vue

@@ -14,7 +14,7 @@
       <!-- 岗位要求 -->
       <requirement ref="requirementRef" :data="itemData" @requireTypeChange="bool => isStudent = bool"></requirement>
     </uni-section>
-    <template v-if="isStudent && showExtend">
+    <template v-if="isStudent">
       <uni-section class="ss-m-y-20" title="其他">
         <template v-slot:decoration>
           <view class="decoration decoration3">3</view>
@@ -53,12 +53,11 @@ const props = defineProps({
 const jobId = ref('')
 const fairId = ref('')
 onLoad((options) => {
-  console.log('options:', options) //
   jobId.value = options?.jobId || props.jobId || ''
   fairId.value = options?.fairId || props.fairId || ''
   if (jobId.value) getPositionDetail(jobId.value)
   else {
-    show.value = showExtend.value = true
+    show.value = true
   }
 })
 
@@ -69,10 +68,10 @@ const getPositionDetail = async (id) => {
   try {
     uni.showLoading({ title: '加载中...', mask: true })
     const res = await getJobDetails({ id })
-    if (!res?.data && !Object.keys(res.data).length) return
+    if (!res?.data || !Object.keys(res.data).length) return
     itemData.value = {...res.data, ...dealDictObjData({}, res.data)}
+    // itemData.value.name = new Date().getTime().toString() + '测试小程序发布职位后更新职位数量'
     if (itemData.value?.type === '3') {
-      isStudent.value = true
       await getPositionExtendDetail(id)
     }
     show.value = true
@@ -80,16 +79,19 @@ const getPositionDetail = async (id) => {
     uni.hideLoading()
   }
 }
-// getPositionDetail('1904154452278009858')
+// // 测试数据
+// setTimeout(async() => {
+//   show.value = false
+//   await getPositionDetail('1904786675108691969')
+// }, 2000)
 
 // 获取实习扩展信息
-const showExtend = ref(false)
 const extendData = ref({})
 const getPositionExtendDetail = async (id) => {
   try {
     const res = await getJobAdvertisedExtend(id)
     extendData.value = res?.data || {}
-    showExtend.value = true // 实习表单显示
+    isStudent.value = true
   } catch (error) {
   }
 }
@@ -155,6 +157,9 @@ const saveEmit = async (retry) => {
         if (!retry) saveEmit(true) // true:重新提交避免死循环
       }, 1000)
     }
+    // else if (error?.msg === '招聘会时间已过,暂停招聘') {
+    //   uni.showToast({ title: error.msg, icon: 'none', duration: 2000 })
+    // }
   } finally {
     uni.hideLoading()
   }