index.vue 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. <template>
  2. <layout-page>
  3. <scroll-view class="scrollBox" style="position:relative;">
  4. <view class="box">
  5. <view v-if="loading" class="vertical80-center">{{ loadingText }}</view>
  6. <view v-else>
  7. <view class="mt-5" style="display: flex;">
  8. <!-- 赏金 -->
  9. <view v-if="info.hire && info.hirePrice" class="hirePrice ss-m-r-10 d-flex align-center">
  10. <view class="iconfont icon-a-1_zhaopin ss-m-r-10" style="color: #e03506; font-size: 20px;"></view>
  11. <view>{{ `赏金:${commissionCalculation(info.hirePrice / 100, 1)}元` }}</view>
  12. </view>
  13. <image v-if="isJobFair" src="/static/svg/jobFair.svg" class="ss-m-r-10" style="width: 30px; height: 30px;"></image>
  14. <!-- 职位名称 -->
  15. <h2 class="JobName" style="flex: 1;">{{ formatName(info.name) }}</h2>
  16. </view>
  17. <!-- 职位地区 -->
  18. <view class="d-flex justify-space-between mt-5 align-center">
  19. <view style="font-size: 14px; flex: 1; text-overflow: ellipsis; overflow: hidden; white-space: nowrap; margin-right: 30px;">
  20. <span>
  21. <span>{{positionInfo?.area?.str ?? '全国' }}</span>
  22. <span class="viewider-mx" v-if="positionInfo?.eduName">|</span>
  23. <span>{{positionInfo?.eduName }}</span>
  24. <span class="viewider-mx" v-if="positionInfo?.expName">|</span>
  25. <span>{{positionInfo?.expName }}</span>
  26. </span>
  27. </view>
  28. </view>
  29. <view class="d-flex justify-space-between mt-5 align-center">
  30. <!-- 薪资 -->
  31. <view>
  32. <span v-if="!info.payFrom && !info.payTo" class="salary w-600">面议</span>
  33. <span v-else class="salary w-600">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
  34. </view>
  35. </view>
  36. <view class="font-size-13 color-999 ss-m-t-10" style="text-align: end;">更新时间:{{ timesTampChange(info?.refreshTime || info.updateTime, 'Y-M-D h:m') }}</view>
  37. <!-- 标签 -->
  38. <view class="tagList mt">
  39. <view class="tag" v-for="(tag,i) in info?.tagList || []" :key="'tagList' + i">
  40. {{ tag }}
  41. </view>
  42. </view>
  43. <!-- 岗位职责 -->
  44. <view class="topLine fs14 mt-5">
  45. <view class="fs15 w-600 my5">岗位职责</view>
  46. <view v-if="!info.content"></view>
  47. <rich-text v-else class="htmlCss" :nodes="cleanedHtml(info.content)"></rich-text>
  48. </view>
  49. <!-- 岗位要求 -->
  50. <view class="topLine mt-5">
  51. <view class="fs15 w-600 my5">岗位要求</view>
  52. <view v-if="!info.requirement"></view>
  53. <rich-text v-else class="htmlCss" :nodes="cleanedHtml(info.requirement)"></rich-text>
  54. </view>
  55. <!-- HR信息 -->
  56. <view class="topLine mt-5 d-flex">
  57. <view class="avatarBox">
  58. <image style="width: 40px; height: 40px;" :src="info.enterprise?.logoUrl || 'https://minio.citupro.com/dev/menduner/company-avatar.png'"></image>
  59. </view>
  60. <view >
  61. <view class="contact-name">{{ info.contact?.name }}</view>
  62. <view class="contact-info">{{ formatName(info.enterprise?.anotherName || info.enterprise?.name) }} {{ info.contact?.postNameCn ? '· ' + info.contact?.postNameCn : '' }}</view>
  63. </view>
  64. </view>
  65. <!-- 工作地址 -->
  66. <view class="topLine mt-5">
  67. <view class="fs15 w-600 my5">工作地址</view>
  68. <view class="my10">
  69. <uni-icons
  70. type="map-pin-ellipse"
  71. color="#00B760"
  72. class="mr"
  73. size="25"
  74. ></uni-icons>
  75. <span style="color: var(--color-666);font-size: 15px;line-height: 26px;">{{ info.address || '' }}</span>
  76. </view>
  77. </view>
  78. </view>
  79. </view>
  80. </scroll-view>
  81. </layout-page>
  82. </template>
  83. <script setup>
  84. import { commissionCalculation } from '@/utils/position'
  85. import { timesTampChange } from '@/utils/date'
  86. import layoutPage from '@/layout'
  87. import { ref, watch } from 'vue';
  88. import { getPositionDetails } from '@/api/position'
  89. import { dealDictObjData } from '@/utils/position'
  90. import { onLoad } from '@dcloudio/uni-app'
  91. import { userStore } from '@/store/user'
  92. import { formatName } from '@/utils/getText'
  93. const useUserStore = userStore()
  94. const loading = ref(false)
  95. const loadingText = ref('加载中 . . . ')
  96. // 职位详情
  97. const info = ref({})
  98. const positionInfo = ref({})
  99. const beenLogin = ref(false)
  100. const areaName = ref('')
  101. // 监听登录状态
  102. watch(() => useUserStore.refreshToken, (newVal) => {
  103. beenLogin.value = Boolean(newVal)
  104. }, { immediate: true }, { deep: true })
  105. let jobId = ''
  106. const isJobFair = ref(false) // 是否是通过招聘会进入的岗位
  107. let obj = {}
  108. onLoad(async (options) => {
  109. areaName.value = options?.area || ''
  110. jobId = options?.id || options?.jobId || obj?.jobId || ''
  111. if (jobId) {
  112. loading.value = true
  113. loadingText.value = '加载中 . . . '
  114. getPositionDetail()
  115. } else {
  116. loadingText.value = '加载失败 . . . '
  117. }
  118. })
  119. // 富文本内容处理,去除多余的换行空格等
  120. const cleanedHtml = (text) => {
  121. const cleaned = text.replace(/\n/g, '<br>')
  122. .replace(/\s+/g, ' ')
  123. .replace(/(^|\s+)<\/p>(\s*<p>|$)/g, '</p><p>')
  124. .replace(/<p>\s*(<br>)\s*<\/p>/g, '')
  125. .replace(/<pre([^>]*)>/g, '<div$1>')
  126. .replace(/<\/pre>/g, '</div>')
  127. .replace(/<p>\s*(<\/br>)\s*<\/p>/g, '').trim()
  128. return cleaned
  129. }
  130. // 职位详情
  131. async function getPositionDetail () {
  132. try {
  133. loading.value = true
  134. const { data } = await getPositionDetails({ id: jobId })
  135. info.value = data
  136. positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value, enterprise: dealDictObjData({}, data.enterprise) }
  137. loading.value = false
  138. areaName.value = positionInfo.value.area?.str ?? '全国'
  139. } finally {
  140. }
  141. }
  142. </script>
  143. <style scoped lang="scss">
  144. @import '../../static/style/position/index.scss';
  145. .hideCanvasView{
  146. position: relative;
  147. }
  148. .shareCanvas {
  149. position: fixed;
  150. top: -99999upx;
  151. left: -99999upx;
  152. z-index: -99999;
  153. }
  154. .bottom-content {
  155. display: flex;
  156. justify-content: space-evenly;
  157. align-items: center;
  158. width: 100%;
  159. margin: 20rpx 0;
  160. .btnStyle {
  161. flex: 1;
  162. margin-right: 20rpx;
  163. }
  164. .bgButtons {
  165. border: 2rpx solid #00B760;
  166. color: #00B760;
  167. // background: #FFF;
  168. border-radius: 50rpx;
  169. }
  170. .shareButtonCss {
  171. font-size: 16px;
  172. background: unset;
  173. &::after{
  174. border:none !important;
  175. }
  176. }
  177. &-tool {
  178. width: 160rpx;
  179. display: flex;
  180. justify-content: center;
  181. flex-direction: column;
  182. align-items: center;
  183. }
  184. }
  185. .share-pop {
  186. width: 100%;
  187. // height:300rpx;
  188. display: flex;
  189. justify-content: center;
  190. .f-straight {
  191. margin: 40rpx;
  192. background: unset;
  193. &::after{
  194. border:none !important;
  195. }
  196. }
  197. .share-round {
  198. border-radius:50%;
  199. height:100rpx;
  200. width:100rpx;
  201. display: flex;
  202. align-items: center;
  203. justify-content: center;
  204. }
  205. .share-round-1 {
  206. background-color:#22a039;
  207. }
  208. .share-round-2 {
  209. background-color:#3693cd;
  210. }
  211. }
  212. .preview {
  213. position: fixed;
  214. z-index: 9;
  215. height: 100vh;
  216. width: 100vw;
  217. left: 0;
  218. top: 0;
  219. .image {
  220. position: absolute;
  221. width: 80%;
  222. left: 10%;
  223. top: 100rpx;
  224. }
  225. }
  226. </style>