index.vue 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. <template>
  2. <view>
  3. <scroll-view class="scrollBox" scroll-y="true" style="position:relative;">
  4. <view class="box">
  5. <view v-if="loading" class="vertical80-center">{{ loadingText }}</view>
  6. <view v-else>
  7. <!-- 职位名称 + 薪资 -->
  8. <view class="d-flex justify-space-between">
  9. <h2 class="JobName ellipsis">
  10. {{ info.name }}
  11. </h2>
  12. <span class="salary w-600">{{ info.payFrom }}-{{ info.payTo }}/{{ positionInfo.payName }}</span>
  13. </view>
  14. <!-- 职位地区 收藏职位 -->
  15. <view class="d-flex justify-space-between mt-5">
  16. <view class="bold" style="font-size: 14px;">
  17. <span>
  18. <span>{{positionInfo?.areaName }}</span>
  19. <span class="viewider-mx">|</span>
  20. <span>{{positionInfo?.eduName }}</span>
  21. <span class="viewider-mx">|</span>
  22. <span>{{positionInfo?.expName }}</span>
  23. </span>
  24. </view>
  25. <!-- 收藏职位 -->
  26. <view @click="handleCollection">
  27. <uni-icons
  28. :type="isCollection ? 'heart-filled' : 'heart'"
  29. color="#fc6d5e"
  30. class="mr"
  31. size="25"
  32. ></uni-icons>
  33. <!-- <span style="color: #fc6d5e">{{ isCollection ? '取消收藏' : '收藏职位' }}</span> -->
  34. </view>
  35. </view>
  36. <!-- 标签 -->
  37. <view class="tagList mt">
  38. <!-- <view class="tagListItem" v-for="(tag,i) in info?.tagList || []" :key="'tagList' + i">
  39. <uni-tag
  40. :text="tag"
  41. inverted="false"
  42. size="small"
  43. custom-style="background-color: #e2f0ef; color:#00897B; border-color:#e2f0ef;"
  44. />
  45. </view> -->
  46. <view class="tag" v-for="(tag,i) in info?.tagList || []" :key="'tagList' + i">
  47. {{ tag }}
  48. </view>
  49. </view>
  50. <!-- 赏金 -->
  51. <view class="topLine mt-5" style="display: flex; align-items: center;">
  52. <uni-icons class="icon-a-1_zhaopin" custom-prefix="iconfont" color="#e03506"/>
  53. <view class="hirePrice">{{ `赏金:${commissionCalculation(2000, 1)}元` }}</view>
  54. </view>
  55. <!-- 岗位职责 -->
  56. <view class="topLine fs14 mt-5">
  57. <view class="fs15 w-600 my5">岗位职责</view>
  58. <view v-if="!info.content">暂无</view>
  59. <rich-text v-else class="htmlCss" :nodes="info.content"></rich-text>
  60. <!-- <view class="html fs14" v-html="info.content"></view> -->
  61. </view>
  62. <!-- 岗位要求 -->
  63. <view class="topLine mt-5">
  64. <view class="fs15 w-600 my5">岗位要求</view>
  65. <view v-if="!info.requirement">暂无</view>
  66. <rich-text v-else class="htmlCss" :nodes="info.requirement"></rich-text>
  67. </view>
  68. <view class="topLine mt-5 d-flex">
  69. <view class="avatarBox">
  70. <image class="avatar" :src="info.contact?.avatar || 'https://minio.citupro.com/dev/menduner/7.png'"></image>
  71. </view>
  72. <view >
  73. <view class="contact-name">{{ info.contact?.name }}</view>
  74. <view class="contact-info">{{ info.enterprise?.name }} · {{ info.contact?.postNameCn }}</view>
  75. </view>
  76. </view>
  77. <view class="topLine mt-5">
  78. <view class="fs15 w-600 my5">工作地址</view>
  79. <view class="my10">
  80. <uni-icons
  81. type="map-pin-ellipse"
  82. color="#00897B"
  83. class="mr"
  84. size="25"
  85. ></uni-icons>
  86. <span style="color: var(--color-666);font-size: 15px;line-height: 26px;">{{ info.address }}</span>
  87. </view>
  88. </view>
  89. </view>
  90. </view>
  91. </scroll-view>
  92. <view class="bottom-sticky" v-if="showBtn">
  93. <view style="display: flex;justify-content: space-evenly;align-items: center;width: 100%;margin: 20rpx 0;">
  94. <view @click="null" style="display: flex;justify-content: center;flex-direction: column;align-items: center;">
  95. <uni-icons type="redo-filled" size="24" color="#00897B"/>
  96. <span style="color:#00897B;font-weight:bold;">分享</span>
  97. </view>
  98. <button v-if="delivery" :disabled="true" class="buttons">我已投递</button>
  99. <button v-else class="buttons" @click="handleDelivery">我要投递</button>
  100. </view>
  101. </view>
  102. </view>
  103. </template>
  104. <script setup>
  105. import { commissionCalculation } from '@/utils/position'
  106. // import loginPage from '@/views/common/loginDialog.vue'
  107. // import simplePage from './sendResume/simple.vue'
  108. // import selectPage from './sendResume/select.vue'
  109. import { reactive, ref } from 'vue';
  110. import {
  111. getPositionDetails,
  112. jobCvRelCheckSend,
  113. getPersonJobUnfavorite, // 取消收藏
  114. getPersonJobFavorite, // 收藏
  115. getJobFavoriteCheck
  116. } from '@/api/position'
  117. import { dealDictObjData } from '@/utils/position'
  118. // import Snackbar from '@/plugins/snackbar'
  119. import { getAccessToken } from '@/utils/request'
  120. import { onLoad } from '@dcloudio/uni-app';
  121. const loading = ref(false)
  122. const loadingText = ref('加载中 . . . ')
  123. // 职位详情
  124. const info = ref({})
  125. const positionInfo = ref({})
  126. const getPositionDetail = async () => {
  127. const { data } = await getPositionDetails({ id: jobId })
  128. info.value = data
  129. positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value }
  130. loading.value = false
  131. console.log('positionInfo', positionInfo.value)
  132. }
  133. let jobId = ''
  134. onLoad((options) => {
  135. jobId = options?.id || ''
  136. if (jobId) {
  137. loading.value = true
  138. loadingText.value = '加载中 . . . '
  139. deliveryCheck()
  140. getCollectionStatus()
  141. getPositionDetail()
  142. } else {
  143. loadingText.value = '加载失败 . . . '
  144. }
  145. })
  146. // const resumeList = ref([])
  147. // const selectResume = ref()
  148. const handleDelivery = async () => {
  149. // if (delivery.value) return Snackbar.warning(t('resume.alreadyResume'))
  150. // const result = await getPersonResumeCv()
  151. // resumeList.value = result
  152. // // 没有上传过简历的先去上传
  153. // if (!result.length) {
  154. // Snackbar.warning('您还未上传过简历,请先上传简历')
  155. // uploadFile.value.trigger()
  156. // return
  157. // }
  158. // showResume.value = true
  159. }
  160. // 效验是否有投递过简历
  161. const delivery = ref(true) // 是否已投递简历
  162. const showBtn = ref(false)
  163. const deliveryCheck = async () => {
  164. try {
  165. if (!getAccessToken()) return delivery.value = false
  166. const { data } = await jobCvRelCheckSend({ jobId })
  167. delivery.value = Boolean(data)
  168. } finally {
  169. showBtn.value = true
  170. }
  171. }
  172. // 效验求职者是否有收藏该职位
  173. const isCollection = ref(true)
  174. const getCollectionStatus = async () => {
  175. if (!getAccessToken()) return isCollection.value = false
  176. const { data } = await getJobFavoriteCheck({ jobId })
  177. isCollection.value = Boolean(data)
  178. }
  179. // 操作 收藏&取消收藏职位
  180. const handleCollection = async () => {
  181. // if (!getAccessToken()) return
  182. console.log('1', 1)
  183. const api = isCollection.value ? getPersonJobUnfavorite : getPersonJobFavorite
  184. await api(isCollection.value ? jobId : { jobId })
  185. await getCollectionStatus()
  186. }
  187. </script>
  188. <style scoped lang="scss">
  189. .mb5 { margin-bottom: 5px; }
  190. .my5 { margin: 5px 0; }
  191. .my10 { margin: 10px 0; }
  192. .mt10 { margin-top: 10px; }
  193. .fs14 { font-size: 14px; }
  194. .fs15 { font-size: 15px; }
  195. .box {
  196. padding: 10px 30rpx 100px;
  197. }
  198. .JobName {
  199. color: #37576c;
  200. font-size: 24px;
  201. margin-right: 30px;
  202. margin-top: 1px;
  203. vertical-align: middle;
  204. flex: 1;
  205. }
  206. .tagList {
  207. width: 100%;
  208. display: flex;
  209. flex-wrap: wrap;
  210. .tagListItem {
  211. margin: 10rpx 10rpx 10rpx 0;
  212. }
  213. }
  214. .topLine {
  215. border-top: 1px solid #EDEDED;
  216. // border-bottom: 1px solid #EDEDED;
  217. padding-top: 10px;
  218. }
  219. .tag {
  220. padding: 5px 10px;
  221. background-color: #e2f0ef;
  222. color: #00897B;
  223. border-radius: 5px;
  224. font-size: 14px;
  225. margin-right: 8px;
  226. margin-top: 4px;
  227. }
  228. .hirePrice {
  229. padding: 5px 10px;
  230. background-color: #fc6d5e63;
  231. color: #ff250e;
  232. border-radius: 5px;
  233. font-size: 14px;
  234. margin-left: 8px;
  235. margin-top: 4px;
  236. }
  237. .htmlCss {
  238. white-space: pre-wrap;
  239. word-break: break-all;
  240. line-height: 28px;
  241. color: var(--color-333);
  242. font-size: 15px;
  243. text-align: justify;
  244. letter-spacing: 0;
  245. }
  246. //底部按钮公用定位
  247. .bottom-sticky{
  248. display: flex;
  249. width:100vw;
  250. position: fixed;
  251. bottom:0;
  252. left: 0;
  253. background-image:linear-gradient(rgba(255,255,255,1),white);
  254. }
  255. .buttons{
  256. width: 60vw;
  257. height: 44px;
  258. border-radius: 25px;
  259. margin: 0;
  260. color: #fff;
  261. background-color: #00897b !important;
  262. }
  263. .noMore{
  264. margin: 20px 0;
  265. }
  266. .date-time{
  267. color:#d9d0d2;
  268. float: right;
  269. }
  270. .viewided-line {
  271. width: 100%;
  272. height: 1px;
  273. background-color: #f0f2f7;
  274. margin: 20px 0;
  275. }
  276. .avatarBox{
  277. max-width: 40px;
  278. max-height: 40px;
  279. margin: 0 10px;
  280. }
  281. .avatar{
  282. width: 40px;
  283. height: 40px;
  284. }
  285. .sub-li-bottom {
  286. display: flex;
  287. justify-content:space-between;
  288. align-items: center;
  289. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  290. font-size: 13px;
  291. padding: 5px 30rpx;
  292. }
  293. .salary {
  294. // color: #ff770d;
  295. float: right;
  296. }
  297. .list-shape {
  298. padding: 10px 30rpx 10px;
  299. margin-top: 10px;
  300. background-color: #fff;
  301. .titleBox {
  302. display: flex;
  303. align-items: center;
  304. justify-content: space-between;
  305. }
  306. }
  307. .viewider-mx{
  308. margin: 0 10rpx;
  309. }
  310. .viewider {
  311. color:#e4d4d2;
  312. }
  313. //公司名称
  314. .cer-end{
  315. position: absolute;
  316. top: 85%;
  317. right: 16%;
  318. }
  319. .cer-text{
  320. text-decoration: underline;
  321. margin: 0 5rpx;
  322. }
  323. //一行展示不全...
  324. .dis{
  325. display: flex;
  326. align-items: center;
  327. }
  328. .show-more{
  329. width: 26vw;
  330. white-space: nowrap;
  331. overflow: hidden;
  332. text-overflow: ellipsis;
  333. }
  334. /* 列表触底暂无更多 */
  335. .noMore{ text-align:center; color:grey; }
  336. .mt { margin-top: 10rpx; }
  337. .mb { margin-bottom: 10rpx; }
  338. .ml { margin-left: 20rpx; }
  339. .mr { margin-right: 20rpx; }
  340. .mr-10{ margin-right: 10rpx; }
  341. .my-5{ margin: 5px 0; }
  342. </style>