index.vue 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <!-- 分享职位 -->
  2. <template>
  3. <div
  4. style="background-color: #f0f0f0; width: 100vw;"
  5. >
  6. <v-card
  7. class="py-3 px-5"
  8. style="background-color: #fff; overflow: auto;"
  9. :style="{'width': windowWidth > 750 ? '750px' : '100vw', 'margin': windowWidth > 750 ? '5px auto' : '0 auto'}"
  10. >
  11. <div v-if="!Object.keys(info).length">加载失败</div>
  12. <div>
  13. <div class="d-flex justify-space-between">
  14. <h2 class="JobName ellipsis">{{ info.name }}</h2>
  15. <span class="salary">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
  16. </div>
  17. <div class="d-flex justify-space-between mt-4">
  18. <div>
  19. <div class="banner-tags">
  20. <div v-for="k in desc" :key="k.mdi" class="mr-10">
  21. <v-icon color="var(--color-666)" size="20">{{ k.mdi }}</v-icon>
  22. <span class="f-w-600 ml-1">{{ positionInfo[k.value] }}</span>
  23. </div>
  24. </div>
  25. <div class="my-4 mb-3" v-if="info?.tagList">
  26. <v-chip size="small" class="mr-1 mb-1" color="primary" label v-for="(k, i) in info.tagList" :key="i">{{ k }}</v-chip>
  27. </div>
  28. </div>
  29. <v-btn
  30. class="button-item radius mb-3"
  31. color="warning"
  32. variant="outlined"
  33. prepend-icon="mdi-heart-outline"
  34. @click="null"
  35. >{{ $t('position.collection') }}</v-btn>
  36. </div>
  37. <v-divider></v-divider>
  38. <div class="mt-3 mb-1 f-w-600">{{ $t('position.jobResponsibilities') }}</div>
  39. <div class="requirement" v-html="info.content?.replace(/\n/g, '</br>')"></div>
  40. <div class="mt-3 mb-1 f-w-600">{{ $t('position.jobRequirements') }}</div>
  41. <div class="requirement" v-html="info.requirement?.replace(/\n/g, '</br>')"></div>
  42. <v-divider class="my-3"></v-divider>
  43. <div class="contact">
  44. <div class="float-left d-flex align-center">
  45. <v-img :src="info.contact?.avatar || 'https://minio.citupro.com/dev/menduner/7.png'" :width="45" style="height: 45px;"></v-img>
  46. <div class="ml-2">
  47. <div class="contact-name">{{ info.contact?.name }}</div>
  48. <div class="contact-info">{{ info.enterprise?.name }} · {{ info.contact?.postNameCn }}</div>
  49. </div>
  50. </div>
  51. </div>
  52. <v-divider class="my-3"></v-divider>
  53. <div>
  54. <h4>{{ $t('position.address') }}</h4>
  55. <div class="mt-1">
  56. <v-icon size="25" color="primary">mdi-map-marker</v-icon>
  57. <span style="color: var(--color-666);font-size: 15px;">{{ info.address }}</span>
  58. </div>
  59. </div>
  60. <div class="mt-3 text-center">
  61. <v-btn class="mr-2 radius button-item" color="success" variant="outlined">{{ $t('position.communicate') }}</v-btn>
  62. <v-btn class="radius button-item" :disabled="delivery" color="primary" @click="handleDelivery">{{ delivery ? $t('position.delivered') : $t('position.submitResume') }}</v-btn>
  63. </div>
  64. </div>
  65. </v-card>
  66. </div>
  67. </template>
  68. <script setup>
  69. import { onMounted, onUnmounted, ref } from 'vue';
  70. import { getPositionDetails } from '@/api/position'
  71. import { dealDictObjData } from '@/utils/position'
  72. defineOptions({name: 'recruit-personal-shareJob-index'})
  73. // 组件挂载后添加事件监听器
  74. onMounted(() => {
  75. window.addEventListener('resize', updateWindowSize)
  76. })
  77. // 组件卸载前移除事件监听器
  78. onUnmounted(() => {
  79. window.removeEventListener('resize', updateWindowSize)
  80. })
  81. // 获取路由参数
  82. const queryParams = new URLSearchParams(window.location.search)
  83. const jobId = queryParams.get('jobId') || ''
  84. const sharedById = queryParams.get('sharedById') || ''
  85. const sharedByName = queryParams.get('sharedByName') || ''
  86. const sharedByPhone = queryParams.get('sharedByPhone') || ''
  87. const file = queryParams.get('file') || ''
  88. console.log(jobId, sharedById, sharedByName, sharedByPhone, file)
  89. // 职位详情
  90. const info = ref({})
  91. const positionInfo = ref({})
  92. const getPositionDetail = async () => {
  93. const data = await getPositionDetails({ id: jobId })
  94. info.value = data
  95. positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value }
  96. }
  97. getPositionDetail()
  98. const desc = [
  99. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  100. { mdi: 'mdi-school-outline', value: 'eduName' },
  101. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  102. ]
  103. // 监听窗口大小变化事件
  104. const windowWidth = ref(window.innerWidth)
  105. const updateWindowSize = async () => {
  106. windowWidth.value = window.innerWidth
  107. // windowHeight.value = window.innerHeight
  108. // console.log('windowWidth', windowWidth.value)
  109. }
  110. </script>
  111. <style lang="scss" scoped>
  112. .f-w-600 { font-weight: 600; }
  113. .radius { border-radius: 8px; }
  114. .salary {
  115. color: var(--v-error-base);
  116. line-height: 41px;
  117. font-weight: 600;
  118. height: auto;
  119. display: inline-block;
  120. vertical-align: sub;
  121. }
  122. .JobName {
  123. color: #37576c;
  124. font-size: 28px;
  125. margin-right: 30px;
  126. margin-top: 1px;
  127. // max-width: 45%;
  128. vertical-align: middle;
  129. flex: 1;
  130. }
  131. .banner-tags { display: flex; flex-wrap: wrap; }
  132. .requirement {
  133. white-space: pre-wrap;
  134. word-break: break-all;
  135. line-height: 28px;
  136. color: var(--color-333);
  137. font-size: 15px;
  138. text-align: justify;
  139. letter-spacing: 0;
  140. }
  141. .contact {
  142. height: 60px;
  143. line-height: 60px;
  144. padding: 0 10px;
  145. }
  146. .contact-name {
  147. font-size: 20px;
  148. font-weight: 500;
  149. color: var(--color-222);
  150. line-height: 28px;
  151. }
  152. .contact-info {
  153. font-size: 15px;
  154. color: var(--color-666);
  155. line-height: 21px;
  156. margin-top: 8px;
  157. }
  158. .button-item {
  159. min-width: 110px;
  160. height: 36px
  161. }
  162. </style>