|
@@ -33,7 +33,7 @@
|
|
|
<v-btn v-if="info?.hire" class="radius mr-2 button-item" variant="outlined" color="error" prepend-icon="mdi-share-outline" @click="handleShare">我要赏金</v-btn>
|
|
|
<v-btn v-else class="radius mr-2 button-item" variant="outlined" color="error" prepend-icon="mdi-share-outline" @click="handleShare">{{ $t('position.rewardsShared') }}</v-btn>
|
|
|
<v-btn class="button-item radius" color="warning" variant="outlined" :prepend-icon="isCollection ? 'mdi-heart' : 'mdi-heart-outline'" @click="handleCollection">{{ isCollection ? $t('position.cancelFavorite') : $t('position.collection') }}</v-btn>
|
|
|
- <v-btn class="button-item mx-2 radius" color="success" variant="outlined" @click="toDetails(info)">{{ $t('position.communicate') }}</v-btn>
|
|
|
+ <v-btn class="button-item mx-2 radius" color="success" variant="outlined" @click="toDetails()">{{ $t('position.communicate') }}</v-btn>
|
|
|
<v-btn class="button-item radius" :disabled="delivery" color="primary" variant="outlined" @click="handleDelivery">{{ delivery ? $t('position.delivered') : $t('position.submitResume') }}</v-btn>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -82,7 +82,7 @@
|
|
|
class="mr-2 radius button-item"
|
|
|
color="success"
|
|
|
variant="outlined"
|
|
|
- @click="toDetails(info)"
|
|
|
+ @click="toDetails()"
|
|
|
>
|
|
|
{{ $t('position.communicate') }}
|
|
|
</v-btn>
|
|
@@ -235,13 +235,25 @@ const formItems = ref({
|
|
|
]
|
|
|
})
|
|
|
|
|
|
-// 打开快速登录
|
|
|
-const quickLogonOpen = () => {
|
|
|
- // if (close) {
|
|
|
- // } else {
|
|
|
- // }
|
|
|
- Snackbar.warning('您还未登录,请先登录后再试')
|
|
|
- showLogin.value = true
|
|
|
+const nextFunc = ref(null)
|
|
|
+let loginCloseWarningWord = ''
|
|
|
+// 快速登录
|
|
|
+const loginSuccess = () => {
|
|
|
+ showLogin.value = false
|
|
|
+ Snackbar.success('登录成功')
|
|
|
+ if (nextFunc.value) nextFunc.value()
|
|
|
+ // userInfo.value = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : {}
|
|
|
+ // shareUrl.value = '/shareJob?' + new URLSearchParams({
|
|
|
+ // jobId: id,
|
|
|
+ // sharedById: userInfo.value?.id,
|
|
|
+ // }).toString()
|
|
|
+ // shareDialog.value = true
|
|
|
+ // generateAndDownloadImage()
|
|
|
+}
|
|
|
+
|
|
|
+const loginClose = () => {
|
|
|
+ showLogin.value = false
|
|
|
+ Snackbar.warning(loginCloseWarningWord)
|
|
|
}
|
|
|
|
|
|
const share = ref()
|
|
@@ -267,24 +279,6 @@ const handleDownloadImage = () => {
|
|
|
downloadBase64(previewSrc.value, `${name}${areaName ? '_' + areaName : ''}${salary}-${positionInfo.value.payName}`)
|
|
|
}
|
|
|
|
|
|
-// 快速登录
|
|
|
-const loginSuccess = () => {
|
|
|
- showLogin.value = false
|
|
|
- Snackbar.success('登录成功')
|
|
|
- userInfo.value = localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : {}
|
|
|
- shareUrl.value = '/shareJob?' + new URLSearchParams({
|
|
|
- jobId: id,
|
|
|
- sharedById: userInfo.value?.id,
|
|
|
- }).toString()
|
|
|
- shareDialog.value = true
|
|
|
- generateAndDownloadImage()
|
|
|
-}
|
|
|
-
|
|
|
-const loginClose = () => {
|
|
|
- showLogin.value = false
|
|
|
- Snackbar.warning('您已取消登录,无法分享职位给好友')
|
|
|
-}
|
|
|
-
|
|
|
// 相似职位
|
|
|
const similarList = ref([])
|
|
|
const getSimilarPositionList = async () => {
|
|
@@ -334,7 +328,14 @@ const shareUrl = ref('')
|
|
|
const userInfo = ref(localStorage.getItem('userInfo') ? JSON.parse(localStorage.getItem('userInfo')) : {})
|
|
|
const handleShare = async () => {
|
|
|
// 分享链接携带参数: 用户id、职位id
|
|
|
- if (!getToken()) return quickLogonOpen()
|
|
|
+ if (!getToken()) {
|
|
|
+ showLogin.value = true // 打开快速登录弹窗
|
|
|
+ Snackbar.warning('您还未登录,请先登录后再试')
|
|
|
+ //
|
|
|
+ nextFunc.value = handleShare // 登录成功后要执行的操作
|
|
|
+ loginCloseWarningWord = '您已取消登录,无法分享职位给好友' // 取消登录提示语
|
|
|
+ return
|
|
|
+ }
|
|
|
generateAndDownloadImage()
|
|
|
shareUrl.value = '/shareJob?' + new URLSearchParams({
|
|
|
jobId: id,
|
|
@@ -345,7 +346,14 @@ const handleShare = async () => {
|
|
|
|
|
|
// 收藏&取消收藏职位
|
|
|
const handleCollection = async () => {
|
|
|
- if (!getToken()) return quickLogonOpen()
|
|
|
+ if (!getToken()) {
|
|
|
+ showLogin.value = true // 打开快速登录弹窗
|
|
|
+ Snackbar.warning('您还未登录,请先登录后再试')
|
|
|
+ //
|
|
|
+ nextFunc.value = handleCollection // 登录成功后要执行的操作
|
|
|
+ loginCloseWarningWord = '您已取消登录,无法收藏职位' // 取消登录提示语
|
|
|
+ return
|
|
|
+ }
|
|
|
const api = isCollection.value ? getPersonJobUnfavorite : getPersonJobFavorite
|
|
|
await api(isCollection.value ? id : { jobId: id })
|
|
|
await getCollectionStatus()
|
|
@@ -390,7 +398,14 @@ const showResume = ref(false)
|
|
|
const resumeList = ref([])
|
|
|
const selectResume = ref()
|
|
|
const handleDelivery = async () => {
|
|
|
- if (!getToken()) return quickLogonOpen()
|
|
|
+ if (!getToken()) {
|
|
|
+ showLogin.value = true // 打开快速登录弹窗
|
|
|
+ Snackbar.warning('您还未登录,请先登录后再试')
|
|
|
+ //
|
|
|
+ nextFunc.value = handleDelivery // 登录成功后要执行的操作
|
|
|
+ loginCloseWarningWord = '您已取消登录,无法投递简历' // 取消登录提示语
|
|
|
+ return
|
|
|
+ }
|
|
|
if (delivery.value) return Snackbar.warning(t('resume.alreadyResume'))
|
|
|
const result = await getPersonResumeCv()
|
|
|
resumeList.value = result
|
|
@@ -423,21 +438,31 @@ const handleSubmit = async (val) =>{
|
|
|
}, 3000)
|
|
|
}
|
|
|
|
|
|
+let toDetailsInfo = {}
|
|
|
// 沟通
|
|
|
-const toDetails = async (info) => {
|
|
|
- if (!getToken()) return quickLogonOpen()
|
|
|
+const toDetails = async () => {
|
|
|
+ if (info.value) toDetailsInfo = info // 快速登录弹窗回调使用
|
|
|
+ else info.value = toDetailsInfo
|
|
|
+ if (!getToken()) {
|
|
|
+ showLogin.value = true // 打开快速登录弹窗
|
|
|
+ Snackbar.warning('您还未登录,请先登录后再试')
|
|
|
+ //
|
|
|
+ nextFunc.value = toDetails // 登录成功后要执行的操作
|
|
|
+ loginCloseWarningWord = '您已取消登录,无法进行沟通' // 取消登录提示语
|
|
|
+ return
|
|
|
+ }
|
|
|
try {
|
|
|
- const userId = info.contact.userId
|
|
|
- const enterpriseId = info.contact.enterpriseId
|
|
|
+ const userId = info.value.contact.userId
|
|
|
+ const enterpriseId = info.value.contact.enterpriseId
|
|
|
const textObj = {
|
|
|
text: defaultText,
|
|
|
positionInfo: positionInfo.value
|
|
|
}
|
|
|
console.log(textObj)
|
|
|
await prologue({userId, enterpriseId, text: JSON.stringify(textObj)})
|
|
|
- let url = `/recruit/personal/message?id=${info.id}`
|
|
|
- if (info.contact.enterpriseId) {
|
|
|
- url += `&enterprise=${info.contact.enterpriseId}`
|
|
|
+ let url = `/recruit/personal/message?id=${info.value.id}`
|
|
|
+ if (info.value.contact.enterpriseId) {
|
|
|
+ url += `&enterprise=${info.value.contact.enterpriseId}`
|
|
|
}
|
|
|
|
|
|
router.push(url)
|