index.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  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. <v-divider class="mt-3"></v-divider>
  36. <div class="mt-3 mb-1 f-w-600">{{ $t('position.jobResponsibilities') }}</div>
  37. <div class="requirement" v-html="info.content?.replace(/\n/g, '</br>')"></div>
  38. <div class="mt-3 mb-1 f-w-600">{{ $t('position.jobRequirements') }}</div>
  39. <div class="requirement" v-html="info.requirement?.replace(/\n/g, '</br>')"></div>
  40. <v-divider class="my-3"></v-divider>
  41. <div class="contact">
  42. <div class="float-left d-flex align-center">
  43. <v-img :src="info.contact?.avatar || 'https://minio.citupro.com/dev/menduner/7.png'" :width="45" style="height: 45px;"></v-img>
  44. <div class="ml-2">
  45. <div class="contact-name">{{ info.contact?.name }}</div>
  46. <div class="contact-info">{{ info.enterprise?.name }} · {{ info.contact?.postNameCn }}</div>
  47. </div>
  48. </div>
  49. </div>
  50. <v-divider class="my-3"></v-divider>
  51. <div>
  52. <h4>{{ $t('position.address') }}</h4>
  53. <div class="mt-1">
  54. <v-icon size="25" color="primary">mdi-map-marker</v-icon>
  55. <span style="color: var(--color-666);font-size: 15px;">{{ info.address }}</span>
  56. </div>
  57. </div>
  58. <div class="mb-5 text-center" style="height: 80px; line-height: 80px;">
  59. <!-- <v-btn class="mr-2 radius button-item" color="success" variant="outlined">{{ $t('position.communicate') }}</v-btn> -->
  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" @click="handleDelivery">{{ $t('position.submitResume') }}</v-btn>
  62. </div>
  63. </div>
  64. </v-card>
  65. </div>
  66. <CtDialog :visible="showResume" :widthType="2" titleClass="text-h6" title="简历投递" @close="handleClose" @submit="handleSubmit">
  67. <DeliveryForm ref="deliveryForm"></DeliveryForm>
  68. </CtDialog>
  69. </template>
  70. <script setup>
  71. defineOptions({name: 'recruit-personal-shareJob-index'})
  72. import { onMounted, ref } from 'vue';
  73. import { getPositionDetails } from '@/api/position'
  74. import { dealDictObjData } from '@/utils/position'
  75. import DeliveryForm from './components/deliveryForm.vue'
  76. // 组件挂载后添加事件监听器
  77. const isMobile = ref(false)
  78. onMounted(() => {
  79. const userAgent = navigator.userAgent
  80. 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)
  81. })
  82. // 获取路由参数
  83. const queryParams = new URLSearchParams(window.location.search)
  84. const jobId = queryParams.get('jobId') || ''
  85. const sharedById = queryParams.get('sharedById') || ''
  86. const sharedByName = queryParams.get('sharedByName') || ''
  87. const sharedByPhone = queryParams.get('sharedByPhone') || ''
  88. const file = queryParams.get('file') || ''
  89. console.log(jobId, sharedById, sharedByName, sharedByPhone, file)
  90. // 职位详情
  91. const info = ref({})
  92. const positionInfo = ref({})
  93. const getPositionDetail = async () => {
  94. const data = await getPositionDetails({ id: jobId })
  95. info.value = data
  96. positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value }
  97. }
  98. getPositionDetail()
  99. const desc = [
  100. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  101. { mdi: 'mdi-school-outline', value: 'eduName' },
  102. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  103. ]
  104. // 简历投递
  105. const deliveryForm = ref()
  106. const showResume = ref(false)
  107. const handleDelivery = () => {
  108. showResume.value = true
  109. }
  110. const handleClose = () => {
  111. showResume.value = false
  112. }
  113. const handleSubmit = async () => {
  114. console.log(await deliveryForm.value.getQuery(), 'handleSubmit')
  115. }
  116. </script>
  117. <style lang="scss" scoped>
  118. .f-w-600 { font-weight: 600; }
  119. .radius { border-radius: 8px; }
  120. .salary {
  121. color: var(--v-error-base);
  122. line-height: 41px;
  123. font-weight: 600;
  124. height: auto;
  125. display: inline-block;
  126. vertical-align: sub;
  127. }
  128. .JobName {
  129. color: #37576c;
  130. font-size: 28px;
  131. margin-right: 30px;
  132. margin-top: 1px;
  133. // max-width: 45%;
  134. vertical-align: middle;
  135. flex: 1;
  136. }
  137. .banner-tags { display: flex; flex-wrap: wrap; }
  138. .requirement {
  139. white-space: pre-wrap;
  140. word-break: break-all;
  141. line-height: 28px;
  142. color: var(--color-333);
  143. font-size: 15px;
  144. text-align: justify;
  145. letter-spacing: 0;
  146. }
  147. .contact {
  148. height: 60px;
  149. line-height: 60px;
  150. padding: 0 10px;
  151. }
  152. .contact-name {
  153. font-size: 20px;
  154. font-weight: 500;
  155. color: var(--color-222);
  156. line-height: 28px;
  157. }
  158. .contact-info {
  159. font-size: 15px;
  160. color: var(--color-666);
  161. line-height: 21px;
  162. margin-top: 8px;
  163. }
  164. .button-item {
  165. min-width: 110px;
  166. height: 36px
  167. }
  168. </style>