|
@@ -5,7 +5,7 @@
|
|
|
<view class="decoration decoration1">1</view>
|
|
|
</template>
|
|
|
<!-- 基本信息 -->
|
|
|
- <baseInfo ref="baseInfoRef" :data="itemData"></baseInfo>
|
|
|
+ <baseInfo ref="baseInfoRef" :isFair="Boolean(fairId)" :data="itemData"></baseInfo>
|
|
|
</uni-section>
|
|
|
<uni-section v-if="show" class="ss-m-y-20" title="岗位要求">
|
|
|
<template v-slot:decoration>
|
|
@@ -46,16 +46,17 @@ import {
|
|
|
getJobAdvertisedExtend,
|
|
|
} from '@/api/new/position'
|
|
|
const props = defineProps({
|
|
|
- jobId: String
|
|
|
+ jobId: String,
|
|
|
+ fairId: String,
|
|
|
})
|
|
|
|
|
|
-let jobId = ''
|
|
|
-let fairId = ''
|
|
|
+const jobId = ref('')
|
|
|
+const fairId = ref('')
|
|
|
onLoad((options) => {
|
|
|
- jobId = options?.jobId || props.jobId || ''
|
|
|
- fairId = options?.fairId || ''
|
|
|
- console.log('jobId:', jobId); console.log('fairId:', fairId)
|
|
|
- if (jobId) getPositionDetail(jobId)
|
|
|
+ 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
|
|
|
}
|
|
@@ -79,8 +80,8 @@ const getPositionDetail = async (id) => {
|
|
|
// 获取实习扩展信息
|
|
|
const showExtend = ref(false)
|
|
|
const extendData = ref({})
|
|
|
-const getPositionExtendDetail = async (jobId) => {
|
|
|
- const res = await getJobAdvertisedExtend(jobId)
|
|
|
+const getPositionExtendDetail = async (id) => {
|
|
|
+ const res = await getJobAdvertisedExtend(id)
|
|
|
extendData.value = res?.data || {}
|
|
|
showExtend.value = true // 实习表单显示
|
|
|
}
|
|
@@ -93,18 +94,20 @@ const getSubmitParams = async() => {
|
|
|
const baseInfo = await baseInfoRef.value.getQuery()
|
|
|
const requirement = await requirementRef.value.getQuery()
|
|
|
if (!baseInfo || !requirement) return
|
|
|
- // if (baseInfo.contentLength > 1500) uni.showToast({ title: '岗位职责字数超出限制', icon: 'none', duration: 2000 })
|
|
|
- // if (baseInfo.requirementLength > 1500) uni.showToast({ title: '岗位要求字数超出限制', icon: 'none', duration: 2000 })
|
|
|
+
|
|
|
+ // if (cleanedHtml(baseInfo.content)?.length > 5000) return uni.showToast({ title: '岗位职责字数超出限制', icon: 'none', duration: 2000 })
|
|
|
+ // if (cleanedHtml(baseInfo.requirement)?.length > 5000) return uni.showToast({ title: '岗位要求字数超出限制', icon: 'none', duration: 2000 })
|
|
|
|
|
|
submitParams = {
|
|
|
...baseInfo,
|
|
|
...requirement,
|
|
|
- fair: Boolean(fairId), // fair:是否为招聘会职位编辑-必填
|
|
|
+ fair: Boolean(fairId.value), // fair:是否为招聘会职位编辑-必填
|
|
|
currency_type: 0, // currency_type: 写死0(人民币)
|
|
|
- source: fairId ? '2' : '0', // source: 0职位管理|1招聘会
|
|
|
- bizId: fairId ? fairId : null,
|
|
|
+ source: fairId.value || baseInfo.bizId ? '2' : '0', // source: 0职位管理|1招聘会
|
|
|
+ bizId: fairId.value || baseInfo.bizId || null,
|
|
|
}
|
|
|
- if (jobId) submitParams.id = jobId // 有id则为编辑
|
|
|
+
|
|
|
+ if (jobId.value) submitParams.id = jobId.value // 有id则为编辑
|
|
|
saveEmit()
|
|
|
}
|
|
|
//
|
|
@@ -120,18 +123,16 @@ const saveEmit = async (retry) => {
|
|
|
// status:99为待支付职位,弹窗支付
|
|
|
if (submitParams?.status && submitParams?.status === '99') {
|
|
|
showPay.value = true
|
|
|
- console.log('1payRef:', payRef.value)
|
|
|
uni.showToast({ title: '当前可发布职位额度不足,请支付', icon: 'none', duration: 2000 })
|
|
|
nextTick(() => {
|
|
|
// 金额*100,页面展示/100
|
|
|
- console.log('2payRef:', payRef.value?.handleOpen)
|
|
|
payRef.value && payRef.value.handleOpen({ spuId: _jobId||'', spuName: submitParams?.name||'', price, type: 1 })
|
|
|
})
|
|
|
return
|
|
|
}
|
|
|
uni.switchTab({ url: '/pages/index/position' })
|
|
|
- // const title = itemData.value?.status === '99' '编辑成功,请前往支付' :
|
|
|
- setTimeout(() => { uni.showToast({ title: jobId ? '编辑成功' : '发布成功', icon: 'success' }) }, 1000)
|
|
|
+ // const title = itemData.value?.status === '99' '编辑成功,请前往支付' : jobId.value ? '编辑成功' : '发布成功'
|
|
|
+ setTimeout(() => { uni.showToast({ title: jobId.value ? '编辑成功' : '发布成功', icon: 'success' }) }, 1000)
|
|
|
|
|
|
} catch (error) {
|
|
|
console.log('error:', error)
|