details.vue 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <template>
  2. <div>
  3. <div class="default-width banner px-6">
  4. <div class="banner-title">
  5. <h1>{{ info.name }}</h1>
  6. <span class="salary">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
  7. <span class="refresh-time">{{ timesTampChange(info.updateTime) }} 刷新 <v-icon color="warning" size="20">mdi-alert-outline</v-icon></span>
  8. </div>
  9. <div class="banner-tags mt-4">
  10. <span v-for="k in desc" :key="k.mdi" class="mr-10">
  11. <v-icon color="#666" size="20">{{ k.mdi }}</v-icon>
  12. <span class="ml-1">{{ positionInfo[k.value] }}</span>
  13. </span>
  14. </div>
  15. <div class="banner-tools my-4" style="height: 47px;">
  16. <div class="float-left" style="line-height: 40px;">
  17. <v-chip size="small" label v-for="(k, i) in info.tagList" :key="i" class="mr-1" color="primary">{{ k }}</v-chip>
  18. </div>
  19. <div class="banner-tools-btns float-right">
  20. <v-btn class="half-button radius" color="warning" variant="outlined" prepend-icon="mdi-star-outline">收藏</v-btn>
  21. <v-btn class="half-button mx-2 radius" color="success" variant="outlined">立即沟通</v-btn>
  22. <v-btn class="half-button radius" color="primary" variant="outlined">投递简历</v-btn>
  23. </div>
  24. </div>
  25. <v-divider></v-divider>
  26. <div class="d-flex">
  27. <div class="content-left">
  28. <div v-if="Object.keys(info).length">
  29. <div>岗位职责:</div>
  30. <div class="requirement" v-html="info.content.replace(/\n/g, '</br>')"></div>
  31. <div class="mt-3">岗位要求:</div>
  32. <div class="requirement" v-html="info.requirement.replace(/\n/g, '</br>')"></div>
  33. </div>
  34. <v-divider class="my-3"></v-divider>
  35. <div class="contact" v-if="Object.keys(info).length">
  36. <div class="float-left d-flex align-center">
  37. <v-img :src="info.contact.avatar" :width="45" style="height: 45px;"></v-img>
  38. <div class="ml-2">
  39. <div class="contact-name">{{ info.contact.name }}</div>
  40. <div class="contact-info">{{ info.enterprise.name }} · {{ info.contact.postNameCn }}</div>
  41. </div>
  42. </div>
  43. <div class="float-right">
  44. <v-chip color="primary" label>当前在线</v-chip>
  45. </div>
  46. </div>
  47. <v-divider class="my-3"></v-divider>
  48. <div class="address">
  49. <h4>工作地址</h4>
  50. <div class="mt-1">
  51. <v-icon size="25" color="primary">mdi-map-marker</v-icon>
  52. <span style="color: #666;font-size: 15px;">{{ info.address }}</span>
  53. </div>
  54. </div>
  55. <div class="mt-3 text-center">
  56. <v-btn class="half-button mr-2 radius" color="success" variant="outlined">立即沟通</v-btn>
  57. <v-btn class="half-button radius" color="primary">投递简历</v-btn>
  58. </div>
  59. </div>
  60. <div class="content-right" v-if="Object.keys(info).length">
  61. <!-- 公司信息 -->
  62. <EnterpriseInfo :info="{ ...info, position: { ...positionInfo } }"></EnterpriseInfo>
  63. <!-- 相似职位 -->
  64. <similarPositions class="mt-3" :list="similarList"></similarPositions>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </template>
  70. <script setup>
  71. defineOptions({ name: 'position-details' })
  72. import { ref } from 'vue'
  73. import { useRouter } from 'vue-router'
  74. import { timesTampChange } from '@/utils/date'
  75. import { getPositionDetails, getSimilarPosition } from '@/api/position'
  76. import { dealData } from '@/views/recruit/position/components/dict'
  77. import similarPositions from '@/components/Position/similarPositions.vue'
  78. import EnterpriseInfo from '@/components/Enterprise/info.vue'
  79. const router = useRouter()
  80. const { id } = router.currentRoute.value.params
  81. // 职位详情
  82. const info = ref({})
  83. const positionInfo = ref({})
  84. const getPositionDetail = async () => {
  85. const data = await getPositionDetails({ id })
  86. info.value = data
  87. positionInfo.value = { ...dealData(positionInfo.value, info.value), ...info.value }
  88. }
  89. getPositionDetail()
  90. const desc = [
  91. { mdi: 'mdi-map-marker-outline', value: 'areaName' },
  92. { mdi: 'mdi-school-outline', value: 'eduName' },
  93. { mdi: 'mdi-clock-time-ten-outline', value: 'expName' }
  94. ]
  95. // 相似职位
  96. const similarList = ref([])
  97. const getSimilarPositionList = async () => {
  98. if (!Object.keys(positionInfo).length) return
  99. const { list } = await getSimilarPosition({ pageNo: 1, pageSize: 4, positionId: positionInfo.value.positionId, expType: positionInfo.value.expType })
  100. const items = list.splice(0, 4)
  101. similarList.value = dealData(similarList.value, items)
  102. }
  103. getSimilarPositionList()
  104. </script>
  105. <style lang="scss" scoped>
  106. .banner {
  107. background-color: #fff;
  108. padding: 18px 0 20px;
  109. }
  110. .banner-title {
  111. line-height: 40px;
  112. font-size: 28px;
  113. font-weight: 600;
  114. }
  115. .banner-title h1 {
  116. display: inline-block;
  117. color: #37576c;
  118. font-size: 28px;
  119. margin-right: 30px;
  120. margin-top: 1px;
  121. max-width: 360px;
  122. vertical-align: middle;
  123. white-space: nowrap;
  124. text-overflow: ellipsis;
  125. overflow: hidden;
  126. }
  127. .salary {
  128. color: var(--v-error-base);
  129. line-height: 41px;
  130. font-weight: 600;
  131. height: auto;
  132. display: inline-block;
  133. vertical-align: sub;
  134. }
  135. .refresh-time {
  136. float: right;
  137. color: #666;
  138. font-size: 14px;
  139. line-height: 66px;
  140. vertical-align: sub;
  141. }
  142. .banner-tags span {
  143. font-weight: 600;
  144. }
  145. .radius {
  146. border-radius: 8px;
  147. }
  148. .content-left {
  149. width: 864px;
  150. padding: 20px 20px;
  151. }
  152. .content-right {
  153. flex: 1;
  154. padding: 20px 20px 20px 0;
  155. }
  156. .label-text {
  157. color: #7f7a7a;
  158. font-weight: 600;
  159. }
  160. .value-text {
  161. color: #000;
  162. font-weight: 400;
  163. }
  164. .requirement {
  165. white-space: pre-wrap;
  166. word-break: break-all;
  167. line-height: 28px;
  168. color: #333;
  169. font-size: 15px;
  170. text-align: justify;
  171. letter-spacing: 0;
  172. }
  173. .contact {
  174. height: 60px;
  175. line-height: 60px;
  176. }
  177. .contact-name {
  178. font-size: 20px;
  179. font-weight: 500;
  180. color: #222;
  181. line-height: 28px;
  182. }
  183. .contact-info {
  184. font-size: 15px;
  185. color: #666;
  186. line-height: 21px;
  187. margin-top: 8px;
  188. }
  189. </style>