index.vue 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242
  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. <view class="bottom-sticky" v-if="!loading && jobId">
  82. <view class="bottom-content">
  83. <!-- <button class="btnStyle bgButtons" type="primary" plain="true" @tap="handleSend">立即沟通</button> -->
  84. <button class="buttons btnStyle" type="primary" @click="handleEdit">编辑职位</button>
  85. </view>
  86. </view>
  87. </layout-page>
  88. </template>
  89. <script setup>
  90. import { commissionCalculation } from '@/utils/position'
  91. import { timesTampChange } from '@/utils/date'
  92. import layoutPage from '@/layout'
  93. import { ref, watch } from 'vue';
  94. import { getPositionDetails } from '@/api/position'
  95. import { dealDictObjData } from '@/utils/position'
  96. import { onLoad } from '@dcloudio/uni-app'
  97. import { userStore } from '@/store/user'
  98. import { formatName } from '@/utils/getText'
  99. const useUserStore = userStore()
  100. const loading = ref(false)
  101. const loadingText = ref('加载中 . . . ')
  102. // 职位详情
  103. const info = ref({})
  104. const positionInfo = ref({})
  105. const beenLogin = ref(false)
  106. // 监听登录状态
  107. watch(() => useUserStore.refreshToken, (newVal) => {
  108. beenLogin.value = Boolean(newVal)
  109. }, { immediate: true }, { deep: true })
  110. let jobId = ''
  111. const isJobFair = ref(false) // 是否是通过招聘会进入的岗位
  112. let obj = {}
  113. onLoad(async (options) => {
  114. jobId = options?.id || options?.jobId || obj?.jobId || ''
  115. if (options?.jobFairId) isJobFair.value = true
  116. if (jobId) {
  117. loading.value = true
  118. loadingText.value = '加载中 . . . '
  119. getPositionDetail()
  120. } else {
  121. loadingText.value = '加载失败 . . . '
  122. }
  123. })
  124. // 富文本内容处理,去除多余的换行空格等
  125. const cleanedHtml = (text) => {
  126. const cleaned = text.replace(/\n/g, '<br>')
  127. .replace(/\s+/g, ' ')
  128. .replace(/(^|\s+)<\/p>(\s*<p>|$)/g, '</p><p>')
  129. .replace(/<p>\s*(<br>)\s*<\/p>/g, '')
  130. .replace(/<pre([^>]*)>/g, '<div$1>')
  131. .replace(/<\/pre>/g, '</div>')
  132. .replace(/<p>\s*(<\/br>)\s*<\/p>/g, '').trim()
  133. return cleaned
  134. }
  135. // 职位详情
  136. async function getPositionDetail () {
  137. try {
  138. loading.value = true
  139. const { data } = await getPositionDetails({ id: jobId })
  140. info.value = data
  141. positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value, enterprise: dealDictObjData({}, data.enterprise) }
  142. loading.value = false
  143. } finally {
  144. }
  145. }
  146. const handleEdit = () => {}
  147. </script>
  148. <style scoped lang="scss">
  149. @import '../../static/style/position/index.scss';
  150. .hideCanvasView{
  151. position: relative;
  152. }
  153. .shareCanvas {
  154. position: fixed;
  155. top: -99999upx;
  156. left: -99999upx;
  157. z-index: -99999;
  158. }
  159. .bottom-content {
  160. display: flex;
  161. justify-content: space-evenly;
  162. align-items: center;
  163. width: 100%;
  164. margin: 20rpx 0;
  165. .btnStyle {
  166. flex: 1;
  167. margin-right: 20rpx;
  168. }
  169. .bgButtons {
  170. border: 2rpx solid #00B760;
  171. color: #00B760;
  172. // background: #FFF;
  173. border-radius: 50rpx;
  174. }
  175. .shareButtonCss {
  176. font-size: 16px;
  177. background: unset;
  178. &::after{
  179. border:none !important;
  180. }
  181. }
  182. &-tool {
  183. width: 160rpx;
  184. display: flex;
  185. justify-content: center;
  186. flex-direction: column;
  187. align-items: center;
  188. }
  189. }
  190. .share-pop {
  191. width: 100%;
  192. // height:300rpx;
  193. display: flex;
  194. justify-content: center;
  195. .f-straight {
  196. margin: 40rpx;
  197. background: unset;
  198. &::after{
  199. border:none !important;
  200. }
  201. }
  202. .share-round {
  203. border-radius:50%;
  204. height:100rpx;
  205. width:100rpx;
  206. display: flex;
  207. align-items: center;
  208. justify-content: center;
  209. }
  210. .share-round-1 {
  211. background-color:#22a039;
  212. }
  213. .share-round-2 {
  214. background-color:#3693cd;
  215. }
  216. }
  217. .preview {
  218. position: fixed;
  219. z-index: 9;
  220. height: 100vh;
  221. width: 100vw;
  222. left: 0;
  223. top: 0;
  224. .image {
  225. position: absolute;
  226. width: 80%;
  227. left: 10%;
  228. top: 100rpx;
  229. }
  230. }
  231. </style>