index.vue 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458
  1. <template>
  2. <view>
  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. <!-- 职位名称 + 薪资 -->
  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="!loading && jobId">
  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 disable">我已投递</button>
  99. <button v-else class="buttons" @click="handleDelivery">我要投递</button>
  100. </view>
  101. </view>
  102. <uni-popup ref="popup" background-color="#fff">
  103. <view class="dialogBox" style="width: 86vw;">
  104. <view class="dialog-title">
  105. <view class="title">选择简历</view>
  106. <uni-icons type="close" color="grey" size="26" @click="popupClose" />
  107. </view>
  108. <view style="height: 1px; margin: 0 10rpx; background-color: #dedede;"></view>
  109. <view class="dialog-content" style="max-height: 50vh;">
  110. <uni-card
  111. v-for="(item, index) in resumeList"
  112. :key="index"
  113. shadow="0px 0px 3px 1px rgba(0,0,0,0.1)"
  114. :is-shadow="true"
  115. :border='false'
  116. background-color="red"
  117. :class="{'selected': selectIndex === index}"
  118. @click="selectIndex = index"
  119. >
  120. <view class="d-flex align-center">
  121. <view style="flex: 1;">
  122. <view style="font-weight: bold;">
  123. <uni-icons v-if="selectIndex === index" color="green" type="checkmarkempty" size="18"></uni-icons>
  124. {{ item.title }}
  125. </view>
  126. <view>上传时间:{{ timesTampChange(item.createTime, 'Y-M-D') }}</view>
  127. </view>
  128. <view class="ss-m-l-30" style="width: 60rpx;">
  129. <uni-icons @click="preview(item.url)" type="eye" size="24"></uni-icons>
  130. </view>
  131. </view>
  132. </uni-card>
  133. </view>
  134. <view class="dialog-bottom" @click="handleSubmit">确认投递</view>
  135. </view>
  136. </uni-popup>
  137. </view>
  138. </template>
  139. <script setup>
  140. import { commissionCalculation } from '@/utils/position'
  141. import { timesTampChange } from '@/utils/date'
  142. import { preview } from '@/utils/preview'
  143. // import loginPage from '@/views/common/loginDialog.vue'
  144. // import simplePage from './sendResume/simple.vue'
  145. // import selectPage from './sendResume/select.vue'
  146. import { reactive, ref } from 'vue';
  147. import {
  148. jobCvRelSend,
  149. getPositionDetails,
  150. jobCvRelCheckSend,
  151. getPersonJobUnfavorite, // 取消收藏
  152. getPersonJobFavorite, // 收藏
  153. getJobFavoriteCheck
  154. } from '@/api/position'
  155. import { getPersonResumeCv, saveResume } from '@/api/user'
  156. import { dealDictObjData } from '@/utils/position'
  157. // import Snackbar from '@/plugins/snackbar'
  158. import { getAccessToken } from '@/utils/request'
  159. import { onLoad } from '@dcloudio/uni-app';
  160. const loading = ref(false)
  161. const loadingText = ref('加载中 . . . ')
  162. // 职位详情
  163. const info = ref({})
  164. const positionInfo = ref({})
  165. const getPositionDetail = async () => {
  166. try {
  167. loading.value = true
  168. const { data } = await getPositionDetails({ id: jobId })
  169. info.value = data
  170. positionInfo.value = { ...dealDictObjData({}, info.value), ...info.value }
  171. loading.value = false
  172. console.log('positionInfo', positionInfo.value)
  173. } finally {
  174. }
  175. }
  176. let jobId = ''
  177. onLoad((options) => {
  178. jobId = options?.id || ''
  179. if (jobId) {
  180. loading.value = true
  181. loadingText.value = '加载中 . . . '
  182. deliveryCheck()
  183. getCollectionStatus()
  184. getPositionDetail()
  185. } else {
  186. loadingText.value = '加载失败 . . . '
  187. }
  188. })
  189. // 效验是否有投递过简历
  190. const delivery = ref(false) // 是否已投递简历
  191. const deliveryCheck = async () => {
  192. try {
  193. if (!getAccessToken()) return delivery.value = false
  194. const { data } = await jobCvRelCheckSend({ jobId })
  195. delivery.value = Boolean(data)
  196. } finally {
  197. }
  198. }
  199. const popup = ref()
  200. const resumeList = ref([])
  201. const selectIndex = ref(null)
  202. const handleDelivery = async () => {
  203. if (!getAccessToken()) {
  204. uni.showToast({ title: '您还未上传过简历,请先上传简历', icon: 'none', duration: 2000, })
  205. return
  206. }
  207. if (delivery.value) {
  208. uni.showToast({ title: '您已投递过该职位!', icon: 'none', duration: 2000, })
  209. return
  210. }
  211. const { data } = await getPersonResumeCv()
  212. resumeList.value = data
  213. if (!resumeList.value?.length) {
  214. return
  215. }
  216. // show.value = true
  217. popup.value.open()
  218. }
  219. const handleSubmit = async () => {
  220. const resume = resumeList.value[selectIndex.value]
  221. if (!resume) {
  222. selectIndex.value = null
  223. uni.showToast({ title: '请选择简历', icon: 'none', duration: 2000, })
  224. return
  225. }
  226. await jobCvRelSend({ jobId, title: resume.title, url: resume.url, type: info.value.hire ? 1 : 0 })
  227. uni.showToast({ title: '投递成功', icon: 'none', duration: 2000, })
  228. deliveryCheck()
  229. popup.value.close()
  230. }
  231. const popupClose = () => {
  232. selectIndex.value = null
  233. }
  234. // 效验求职者是否有收藏该职位
  235. const isCollection = ref(false)
  236. const getCollectionStatus = async () => {
  237. if (!getAccessToken()) return isCollection.value = false
  238. const { data } = await getJobFavoriteCheck({ jobId })
  239. isCollection.value = Boolean(data)
  240. }
  241. // 操作 收藏&取消收藏职位
  242. const handleCollection = async () => {
  243. // if (!getAccessToken()) return
  244. console.log('1', 1)
  245. const api = isCollection.value ? getPersonJobUnfavorite : getPersonJobFavorite
  246. await api(isCollection.value ? jobId : { jobId })
  247. await getCollectionStatus()
  248. }
  249. </script>
  250. <style scoped lang="scss">
  251. .mb5 { margin-bottom: 5px; }
  252. .my5 { margin: 5px 0; }
  253. .my10 { margin: 10px 0; }
  254. .mt10 { margin-top: 10px; }
  255. .fs14 { font-size: 14px; }
  256. .fs15 { font-size: 15px; }
  257. .box {
  258. padding: 10px 30rpx 100px;
  259. }
  260. .JobName {
  261. color: #37576c;
  262. font-size: 24px;
  263. margin-right: 30px;
  264. margin-top: 1px;
  265. vertical-align: middle;
  266. flex: 1;
  267. }
  268. .tagList {
  269. width: 100%;
  270. display: flex;
  271. flex-wrap: wrap;
  272. .tagListItem {
  273. margin: 10rpx 10rpx 10rpx 0;
  274. }
  275. }
  276. .topLine {
  277. border-top: 1px solid #EDEDED;
  278. // border-bottom: 1px solid #EDEDED;
  279. padding-top: 10px;
  280. }
  281. .tag {
  282. padding: 5px 10px;
  283. background-color: #e2f0ef;
  284. color: #00897B;
  285. border-radius: 5px;
  286. font-size: 14px;
  287. margin-right: 8px;
  288. margin-top: 4px;
  289. }
  290. .hirePrice {
  291. padding: 5px 10px;
  292. background-color: #fc6d5e63;
  293. color: #ff250e;
  294. border-radius: 5px;
  295. font-size: 14px;
  296. margin-left: 8px;
  297. margin-top: 4px;
  298. }
  299. .htmlCss {
  300. white-space: pre-wrap;
  301. word-break: break-all;
  302. line-height: 28px;
  303. color: var(--color-333);
  304. font-size: 15px;
  305. text-align: justify;
  306. letter-spacing: 0;
  307. }
  308. //底部按钮公用定位
  309. .bottom-sticky{
  310. display: flex;
  311. width:100vw;
  312. position: fixed;
  313. bottom:0;
  314. left: 0;
  315. background-image:linear-gradient(rgba(255,255,255,1),white);
  316. }
  317. .buttons{
  318. width: 60vw;
  319. height: 44px;
  320. border-radius: 25px;
  321. margin: 0;
  322. color: #fff !important;
  323. background-color: #00897b !important;
  324. }
  325. .disable { background-color: #00897bbe !important; color: #ffffffec !important;}
  326. .noMore{
  327. margin: 20px 0;
  328. }
  329. .date-time{
  330. color:#d9d0d2;
  331. float: right;
  332. }
  333. .viewided-line {
  334. width: 100%;
  335. height: 1px;
  336. background-color: #f0f2f7;
  337. margin: 20px 0;
  338. }
  339. .avatarBox{
  340. max-width: 40px;
  341. max-height: 40px;
  342. margin: 0 10px;
  343. }
  344. .avatar{
  345. width: 40px;
  346. height: 40px;
  347. }
  348. .sub-li-bottom {
  349. display: flex;
  350. justify-content:space-between;
  351. align-items: center;
  352. background: linear-gradient(90deg, #f5fcfc 0, #fcfbfa 100%);
  353. font-size: 13px;
  354. padding: 5px 30rpx;
  355. }
  356. .salary {
  357. // color: #ff770d;
  358. float: right;
  359. }
  360. .list-shape {
  361. padding: 10px 30rpx 10px;
  362. margin-top: 10px;
  363. background-color: #fff;
  364. .titleBox {
  365. display: flex;
  366. align-items: center;
  367. justify-content: space-between;
  368. }
  369. }
  370. .viewider-mx{
  371. margin: 0 10rpx;
  372. }
  373. .viewider {
  374. color:#e4d4d2;
  375. }
  376. //公司名称
  377. .cer-end{
  378. position: absolute;
  379. top: 85%;
  380. right: 16%;
  381. }
  382. .cer-text{
  383. text-decoration: underline;
  384. margin: 0 5rpx;
  385. }
  386. //一行展示不全...
  387. .dis{
  388. display: flex;
  389. align-items: center;
  390. }
  391. .show-more{
  392. width: 26vw;
  393. white-space: nowrap;
  394. overflow: hidden;
  395. text-overflow: ellipsis;
  396. }
  397. /* 列表触底暂无更多 */
  398. .noMore{ text-align:center; color:grey; }
  399. .mt { margin-top: 10rpx; }
  400. .mb { margin-bottom: 10rpx; }
  401. .ml { margin-left: 20rpx; }
  402. .mr { margin-right: 20rpx; }
  403. .mr-10{ margin-right: 10rpx; }
  404. .my-5{ margin: 5px 0; }
  405. // 选择简历
  406. .dialogBox {
  407. .dialog-title {
  408. display: flex;
  409. justify-content: space-between;
  410. align-items: center;
  411. color:#767a82;
  412. padding: 20rpx;
  413. .title {
  414. font-weight:bold;
  415. }
  416. }
  417. .dialog-content{
  418. padding: 20rpx;
  419. padding-bottom: 50rpx;
  420. .selected {
  421. background-color: #00897b !important;
  422. }
  423. }
  424. .dialog-bottom{
  425. width: 100%;
  426. height: 44px;
  427. line-height: 44px;
  428. text-align: center;
  429. color: #fff !important;
  430. background-color: #00897b !important;
  431. }
  432. }
  433. </style>