index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212
  1. <!-- 分享职位 -->
  2. <template>
  3. <div style="background-color: #f0f0f0;" :style="{'padding': isMobile ? '0' : '10px'}">
  4. <v-card
  5. class="py-3 px-5"
  6. style="min-height: calc(100vh - 20px); box-sizing: border-box; margin: 0 auto;"
  7. :style="{'width': isMobile ? '100%' : '750px'}"
  8. >
  9. <div v-if="!Object.keys(info).length">加载失败</div>
  10. <div v-else>
  11. <div class="d-flex justify-space-between">
  12. <h2 class="JobName ellipsis">{{ info.name }}</h2>
  13. <span class="salary">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
  14. </div>
  15. <div class="d-flex justify-space-between mt-4">
  16. <div>
  17. <div class="banner-tags">
  18. <div v-for="k in desc" :key="k.mdi" class="mr-3">
  19. <v-icon color="var(--color-666)" size="20">{{ k.mdi }}</v-icon>
  20. <span class="f-w-600 ml-1">{{ positionInfo[k.value] }}</span>
  21. </div>
  22. </div>
  23. <div class="mt-4" v-if="info?.tagList">
  24. <v-chip size="small" class="mr-1 mb-1" color="primary" label v-for="(k, i) in info.tagList" :key="i">{{ k }}</v-chip>
  25. </div>
  26. </div>
  27. <v-btn
  28. class="button-item radius"
  29. color="warning"
  30. variant="outlined"
  31. prepend-icon="mdi-heart-outline"
  32. @click="null"
  33. >{{ $t('position.collection') }}</v-btn>
  34. </div>
  35. {{ info.hire }}
  36. <v-divider class="mt-3"></v-divider>
  37. <div class="mt-3 mb-1 f-w-600">{{ $t('position.jobResponsibilities') }}</div>
  38. <div class="requirement" v-html="info.content?.replace(/\n/g, '</br>')"></div>
  39. <div class="mt-3 mb-1 f-w-600">{{ $t('position.jobRequirements') }}</div>
  40. <div class="requirement" v-html="info.requirement?.replace(/\n/g, '</br>')"></div>
  41. <v-divider class="my-3"></v-divider>
  42. <div class="contact">
  43. <div class="float-left d-flex align-center">
  44. <v-img :src="info.contact?.avatar || 'https://minio.citupro.com/dev/menduner/7.png'" :width="45" style="height: 45px;"></v-img>
  45. <div class="ml-2">
  46. <div class="contact-name">{{ info.contact?.name }}</div>
  47. <div class="contact-info">{{ info.enterprise?.name }} · {{ info.contact?.postNameCn }}</div>
  48. </div>
  49. </div>
  50. </div>
  51. <v-divider class="my-3"></v-divider>
  52. <div>
  53. <h4>{{ $t('position.address') }}</h4>
  54. <div class="mt-1">
  55. <v-icon size="25" color="primary">mdi-map-marker</v-icon>
  56. <span style="color: var(--color-666);font-size: 15px;">{{ info.address }}</span>
  57. </div>
  58. </div>
  59. <div class="mb-5 text-center" style="height: 80px; line-height: 80px;">
  60. <v-btn class="mr-2 radius button-item" color="success" variant="outlined" target="_blank" to="/recruit/personal/position">{{ $t('position.moreBtn') }}</v-btn>
  61. <v-btn class="radius button-item" color="primary" :disabled="delivery" @click="handleDelivery">{{ delivery ? $t('position.delivered') : $t('position.submitResume') }}</v-btn>
  62. </div>
  63. </div>
  64. </v-card>
  65. <handleDeliveryCom v-if="showHandleDelivery" :jobId="jobId" :hire="info?.hire" :userId="sharedById" @refresh="handleCheckJobDelivery"></handleDeliveryCom>
  66. <CtDialog
  67. :visible="showQuickResumeDialog"
  68. :widthType="2"
  69. :footer="false"
  70. titleClass="text-h6"
  71. title="快速登录"
  72. @close="showQuickResumeDialog = false"
  73. @submit="null"
  74. >
  75. <login :jobId="jobId" @loginSuccess="loginSuccess"></login>
  76. </CtDialog>
  77. </div>
  78. </template>
  79. <script setup>
  80. defineOptions({name: 'recruit-personal-shareJob-index'})
  81. import { onMounted, ref } from 'vue';
  82. import { getPositionDetails, jobCvRelCheckSend } from '@/api/position'
  83. import { dealDictObjData } from '@/utils/position'
  84. import handleDeliveryCom from './components/handleDeliveryCom.vue'
  85. import login from './components/login.vue'
  86. import { getPersonalToken } from '@/utils/auth'
  87. import Snackbar from '@/plugins/snackbar'
  88. import { useI18n } from '@/hooks/web/useI18n'; const { t } = useI18n()
  89. // 组件挂载后添加事件监听器
  90. const isMobile = ref(false)
  91. onMounted(() => {
  92. const userAgent = navigator.userAgent
  93. isMobile.value = /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i.test(userAgent)
  94. })
  95. // 获取路由参数
  96. const queryParams = new URLSearchParams(window.location.search)
  97. const jobId = queryParams.get('jobId') || ''
  98. const sharedById = queryParams.get('sharedById') || ''
  99. // 职位详情
  100. const info = ref({})
  101. const positionInfo = ref({})
  102. const getPositionDetail = async () => {
  103. const data = await getPositionDetails({ id: jobId })
  104. info.value = data
  105. positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value }
  106. }
  107. // 效验是否已投递
  108. const delivery = ref(false)
  109. const handleCheckJobDelivery = async () => {
  110. delivery.value = await jobCvRelCheckSend({ jobId })
  111. return delivery.value
  112. }
  113. // 判断有没有jobId跟sharedById,没有的话关闭当前窗口
  114. if (!jobId || !sharedById) {
  115. Snackbar.warning('当前打开的链接无效')
  116. setTimeout(() => {
  117. window.close()
  118. }, 2000)
  119. } else {
  120. getPositionDetail()
  121. if (getPersonalToken()) handleCheckJobDelivery()
  122. }
  123. const desc = [
  124. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  125. { mdi: 'mdi-school-outline', value: 'eduName' },
  126. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  127. ]
  128. // handleClick 投递简历
  129. const showQuickResumeDialog = ref(false)
  130. const showHandleDelivery = ref(false)
  131. const handleDelivery = () => {
  132. if (getPersonalToken()) {
  133. showHandleDelivery.value = true
  134. showQuickResumeDialog.value = !showHandleDelivery.value
  135. } else {
  136. showQuickResumeDialog.value = true
  137. showHandleDelivery.value = !showQuickResumeDialog.value
  138. }
  139. }
  140. // 快速登录成功
  141. const loginSuccess = ({ type = false, info = {}, keyArr = [] }) => {
  142. const bool = handleCheckJobDelivery()
  143. showQuickResumeDialog.value = false
  144. if (bool) return Snackbar.warning(t('resume.alreadyResume'))
  145. showHandleDelivery.value = !showQuickResumeDialog.value
  146. if (type) {
  147. // type = true, 符合快速投递,进入查看是否存在简历
  148. } else {
  149. // type = false, 不符合快速投递,进入填写基本信息
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .f-w-600 { font-weight: 600; }
  155. .radius { border-radius: 8px; }
  156. .salary {
  157. color: var(--v-error-base);
  158. line-height: 41px;
  159. font-weight: 600;
  160. height: auto;
  161. display: inline-block;
  162. vertical-align: sub;
  163. }
  164. .JobName {
  165. color: #37576c;
  166. font-size: 28px;
  167. margin-right: 30px;
  168. margin-top: 1px;
  169. // max-width: 45%;
  170. vertical-align: middle;
  171. flex: 1;
  172. }
  173. .banner-tags { display: flex; flex-wrap: wrap; }
  174. .requirement {
  175. white-space: pre-wrap;
  176. word-break: break-all;
  177. line-height: 28px;
  178. color: var(--color-333);
  179. font-size: 15px;
  180. text-align: justify;
  181. letter-spacing: 0;
  182. }
  183. .contact {
  184. height: 60px;
  185. line-height: 60px;
  186. padding: 0 10px;
  187. }
  188. .contact-name {
  189. font-size: 20px;
  190. font-weight: 500;
  191. color: var(--color-222);
  192. line-height: 28px;
  193. }
  194. .contact-info {
  195. font-size: 15px;
  196. color: var(--color-666);
  197. line-height: 21px;
  198. margin-top: 8px;
  199. }
  200. .button-item {
  201. min-width: 110px;
  202. height: 36px
  203. }
  204. </style>