|
@@ -147,7 +147,7 @@
|
|
|
<!-- </view> -->
|
|
|
<view class="box-bottom">
|
|
|
<view class="box-bottom-tool">
|
|
|
- <uni-tag text="发送简历" type="success" @tap="handleFindResume"/>
|
|
|
+ <uni-tag :text="isSendResume ? '简历已投递' : '发送简历'" :disabled="isSendResume" type="success" @tap="handleFindResume"/>
|
|
|
</view>
|
|
|
|
|
|
<textarea
|
|
@@ -208,8 +208,13 @@ import { timesTampChange } from '@/utils/date'
|
|
|
import { getUserAvatar } from '@/utils/avatar'
|
|
|
import { preview } from '@/utils/preview'
|
|
|
import { getPersonResumeCv, saveResume } from '@/api/user'
|
|
|
-import { getInterviewInviteListByInviteUserId } from '@/api/common'
|
|
|
+import { getInterviewInviteListByInviteUserId, getMessageType } from '@/api/common'
|
|
|
import { userInterviewInviteReject, userInterviewInviteConsent } from '@/api/personalCenter'
|
|
|
+import {
|
|
|
+ jobCvRelSend,
|
|
|
+ jobCvRelCheckSend,
|
|
|
+ jobCvRelHireSend
|
|
|
+} from '@/api/position'
|
|
|
|
|
|
const useUserStore = userStore()
|
|
|
const IM = useIMStore()
|
|
@@ -237,6 +242,10 @@ const chooseInvite = ref(null)
|
|
|
|
|
|
const scrollInto = ref(0)
|
|
|
|
|
|
+const isSendResume = ref(false)
|
|
|
+const positionInfo = ref({})
|
|
|
+const isEmployment = ref('-1')
|
|
|
+
|
|
|
const {
|
|
|
conversationList,
|
|
|
// updateConversation,
|
|
@@ -340,6 +349,9 @@ function handlePreview (payload) {
|
|
|
}
|
|
|
// 获取简历
|
|
|
async function handleFindResume () {
|
|
|
+ if (isSendResume.value) {
|
|
|
+ return
|
|
|
+ }
|
|
|
uni.showLoading({
|
|
|
title: '真正查找简历'
|
|
|
})
|
|
@@ -368,7 +380,7 @@ function handleClose () {
|
|
|
}
|
|
|
|
|
|
// 发送简历
|
|
|
-function handleSendResume () {
|
|
|
+async function handleSendResume () {
|
|
|
if (!Object.keys(resumeCheck.value).length) {
|
|
|
uni.showToast({ title: '请选择要投递的简历', icon: 'none' })
|
|
|
return
|
|
@@ -376,16 +388,34 @@ function handleSendResume () {
|
|
|
const text = {
|
|
|
remark: '发送简历',
|
|
|
query: {
|
|
|
- src: resumeCheck.url,
|
|
|
- title: resumeCheck.title,
|
|
|
- id: resumeCheck.id,
|
|
|
+ src: resumeCheck.value.url,
|
|
|
+ title: resumeCheck.value.title,
|
|
|
+ id: resumeCheck.value.id,
|
|
|
},
|
|
|
type: 1
|
|
|
}
|
|
|
send (JSON.stringify(text), channelItem.value, 105)
|
|
|
- // 提交简历
|
|
|
- // {jobId, title, type, url}
|
|
|
- popup.value.close()
|
|
|
+ console.log(isEmployment.value, positionInfo.value)
|
|
|
+ try {
|
|
|
+ if (isEmployment.value !== '-1') {
|
|
|
+ await jobCvRelHireSend({
|
|
|
+ jobId: positionInfo.value.id,
|
|
|
+ url: resumeCheck.value.url,
|
|
|
+ recommendUserId: isEmployment.value
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ await jobCvRelSend({
|
|
|
+ jobId: positionInfo.value.id,
|
|
|
+ title: resumeCheck.value.title,
|
|
|
+ url: resumeCheck.value.url,
|
|
|
+ type: positionInfo.value.hire ? 1 : 0
|
|
|
+ })
|
|
|
+ }
|
|
|
+ isSendResume.value = true
|
|
|
+ popup.value.close()
|
|
|
+ } catch (error) {
|
|
|
+
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
// 拒绝邀请
|
|
@@ -471,13 +501,32 @@ function handleUploadResume () {
|
|
|
})
|
|
|
}
|
|
|
|
|
|
-// 根据id检测是否有发过简历
|
|
|
-async function checkResume (jobId) {
|
|
|
+// 获取职位信息
|
|
|
+async function getMessageTypeSync () {
|
|
|
try {
|
|
|
- const { data } = await getJobFavoriteCheck({ jobId })
|
|
|
- console.log(data)
|
|
|
+ const { data } = await getMessageType({
|
|
|
+ fromUid: IM.uid,
|
|
|
+ channelId: channelItem.value.channelID,
|
|
|
+ type: 102,
|
|
|
+ page: {
|
|
|
+ current: 1,
|
|
|
+ size: 1,
|
|
|
+ orders: [
|
|
|
+ { column: 'message_seq', asc: false }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ })
|
|
|
+ if (!data.records || !data.records.length) {
|
|
|
+ return
|
|
|
+ }
|
|
|
+ const _item = data.records.pop()
|
|
|
+ const _itemJSON = JSON.parse(_item.payload)
|
|
|
+ const _content = JSON.parse(_itemJSON.content)
|
|
|
+ positionInfo.value = _content.positionInfo
|
|
|
+ const { data: check } = await jobCvRelCheckSend({ jobId: _content.positionInfo.id })
|
|
|
+ isSendResume.value = check
|
|
|
} catch (error) {
|
|
|
-
|
|
|
+ console.log(345, error)
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -486,9 +535,11 @@ onLoad(async (options) => {
|
|
|
r[k] = decodeURIComponent(options[k])
|
|
|
return r
|
|
|
}, {})
|
|
|
- // console.log(info.value)
|
|
|
- // await checkResume(info.value.enterpriseId)
|
|
|
- await init(options.id, options.enterpriseId)
|
|
|
+ isEmployment.value = info.value.isEmployment
|
|
|
+ await init(info.value.id, info.value.enterpriseId)
|
|
|
+ // 获取最新的职位信息
|
|
|
+ await getMessageTypeSync(info.value.id)
|
|
|
+
|
|
|
await getStatusList()
|
|
|
getInterviewInviteList()
|
|
|
// 清除未读消息
|