preview-resume.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613
  1. <template>
  2. <view class="preview-resume-container">
  3. <view class="user-info">
  4. <view class="flex justify-between align-center">
  5. <view class="name flex">
  6. <text>{{ userName }}</text>
  7. <view class="badge" v-if="browseTag">{{ browseTag }}</view>
  8. </view>
  9. <view class="avatar-box">
  10. <image :src="avatarUrl ? avatarUrl : '/static/images/logo.jpg'" class="avatar" mode="aspectFill"></image>
  11. <image src="@/static/images/svg/male.svg" class="sex-tag" v-if="sex == 1"></image>
  12. <image src="@/static/images/svg/female.svg" class="sex-tag" v-else-if="sex == 2"></image>
  13. </view>
  14. </view>
  15. <view class="flex sub-info">
  16. <image src="@/static/images/svg/gray-briefcase.svg" class="icon"></image>
  17. <template v-if="currentCompanyName && currentPositionName">{{ currentCompanyName }} · {{ currentPositionName }}</template>
  18. <template v-else>--</template>
  19. </view>
  20. <view class="sub-info">{{ jobStatusName }}</view>
  21. <view class="tags">
  22. <template v-for="(tag, index) in baseInfoList">
  23. <view class="tag" v-if="tag" :key="index">{{ tag }}</view>
  24. </template>
  25. </view>
  26. <view class="advantages">{{ adv }}</view>
  27. <!-- <view class="resume-tag">
  28. <image src="@/static/images/svg/file.svg" class="resume-icon"></image>
  29. 已上传附件简历
  30. </view> -->
  31. </view>
  32. <!-- 求职期望 -->
  33. <view class="job-expect-container">
  34. <view class="job-expect-title">求职期望</view>
  35. <view class="job-expect" v-for="(item, index) in intentions" :key="index">
  36. <view class="flex justify-between align-center">
  37. <view class="text">
  38. <text>{{ item.ruleClassifyName }}</text>
  39. <text>{{ item.citys }}</text>
  40. </view>
  41. <view class="salary">{{ formatSalary(item.minSalary, item.maxSalary) }}</view>
  42. </view>
  43. <view class="skills">{{ formatTag(item.industry) }}</view>
  44. </view>
  45. </view>
  46. <!-- 工作经历 -->
  47. <view class="work-exprience-container">
  48. <view class="title-bar flex align-center">
  49. <image src="@/static/images/svg/toolbox.svg" class="title-icon"></image>
  50. 工作经历
  51. </view>
  52. <view class="common-section" v-if="showWrokExpList && showWrokExpList.length">
  53. <view class="work-item" v-for="work in showWrokExpList" :key="work.workExpId">
  54. <view class="company-name-title">
  55. <view class="company-name">{{ work.companyName }}</view>
  56. <view class="company-tag" v-if="work.isCrossCompany">跨境</view>
  57. </view>
  58. <view class="position-item" v-for="(item, index) in work.workExpDetailList" :key="index">
  59. <view class="position-info">{{ item.position }} &nbsp; {{ item.startTime }}-{{ item.endTime }}</view>
  60. <view class="content">
  61. <view class="content-title">工作内容</view>
  62. <view class="content-text">{{ item.workContent }}</view>
  63. </view>
  64. <view class="content">
  65. <view class="content-title">工作业绩</view>
  66. <view class="content-text">{{ item.workPerformance }}</view>
  67. </view>
  68. <view class="tags">
  69. <view class="tag" v-for="(skill, i) in item.skills" :key="i">{{ skill }}</view>
  70. </view>
  71. </view>
  72. </view>
  73. </view>
  74. <view class="show-all-btn" v-if="workExpList.length > 1 && !toggle" @click="handleShowAll">展开全部工作经历</view>
  75. </view>
  76. <!-- 教育经历 -->
  77. <view class="common-section">
  78. <view class="title">教育经历</view>
  79. <view class="edu-item" v-for="item in eduList" :key="item.eduId">
  80. <view class="school-name">{{ item.school }}</view>
  81. <view class="edu-base-info">{{ item.degree }} • {{ item.profession }} • {{ item.time }}</view>
  82. <view class="desc">{{ item.detail }}</view>
  83. </view>
  84. </view>
  85. <!-- 资质证书 -->
  86. <view class="common-section">
  87. <view class="title">资质证书</view>
  88. <view class="tags">
  89. <view class="tag" v-for="item in certificates" :key="item.certificateId">{{ item.certificateName }}</view>
  90. </view>
  91. </view>
  92. </view>
  93. </template>
  94. <script>
  95. import { jobStatus as jobStatusList } from '@/constants/userInfo'
  96. export default {
  97. props: {
  98. // 简历id,如果有就查id的数据,如果没有就查自己的
  99. resumesId: {
  100. type: String | Number,
  101. default: '',
  102. },
  103. postPushId: {
  104. type: String | Number,
  105. default: ''
  106. },
  107. },
  108. data() {
  109. return {
  110. userName: '',
  111. sex: '',
  112. avatarUrl: '',
  113. currentCompanyName: '',
  114. currentPositionName: '',
  115. jobStatus: '',
  116. baseInfoList: [], // 工作年限、学历、年龄
  117. adv: '', // 个人优势
  118. intentions: [], // 求职期望
  119. workExpList: [], // 工作经历
  120. eduList: [], // 教育经历
  121. certificates: [], // 资质证书
  122. toggle: false,
  123. browseTag: '',
  124. };
  125. },
  126. computed: {
  127. jobStatusName() {
  128. return jobStatusList[this.jobStatus]?.text
  129. },
  130. showWrokExpList() {
  131. if (!this.toggle) {
  132. return this.workExpList.filter((wrok, index) => {
  133. if (index < 1) {
  134. return wrok
  135. }
  136. })
  137. }
  138. return this.workExpList
  139. }
  140. },
  141. mounted() {
  142. if (this.resumesId) {
  143. const resumeDetailData = this.$queue.getData('resumeDetailData')
  144. if (resumeDetailData) {
  145. this.setDetail(resumeDetailData)
  146. return
  147. }
  148. this.getOhterResume()
  149. } else {
  150. this.getData()
  151. }
  152. },
  153. methods: {
  154. // 获取数据
  155. getData() {
  156. this.$Request
  157. .getT('/app/userFirst/getUserResumes')
  158. .then((res) => {
  159. if (res.code === 0) {
  160. const data = res.data
  161. this.userName = data.userEntity.userName
  162. this.sex = data.userEntity.sex
  163. this.avatarUrl = data.userEntity.avatar
  164. this.jobStatus = data.resumeList?.resumesStatus
  165. if (data.workExpList.length) {
  166. this.currentCompanyName = data.workExpList[0].companyName
  167. this.currentPositionName = data.workExpList[0].position
  168. }
  169. // 添加工作年限
  170. if (data.resumeList?.resumesWorkExperience) {
  171. this.baseInfoList.push(data.resumeList.resumesWorkExperience)
  172. }
  173. // 添加学历
  174. if (data.eduList) {
  175. this.baseInfoList.push(this.$queue.getHighestEducation(data.eduList))
  176. }
  177. // 添加年龄
  178. if (data.userEntity && data.userEntity.age) {
  179. this.baseInfoList.push(`${data.userEntity.age}岁`)
  180. }
  181. this.adv = data.resumeList?.adv
  182. // 求职期望
  183. this.intentions = data.intentions
  184. // 工作经历
  185. this.workExpList = data.workExps.map(work => {
  186. let workExpDetailList = []
  187. let isCrossCompany = false
  188. data.workExpList.forEach(item => {
  189. if (work.workExpId == item.workExpId) {
  190. item.skills = JSON.parse(item.skills)
  191. workExpDetailList.push(item)
  192. }
  193. })
  194. // 判断是否是跨境公司
  195. if (work.type && JSON.parse(work.type)?.[0] == 0) {
  196. isCrossCompany = true
  197. }
  198. work.workExpDetailList = workExpDetailList
  199. work.isCrossCompany = isCrossCompany
  200. return work
  201. })
  202. // 教育经历
  203. this.eduList = data.eduList.map(edu => {
  204. let time = ''
  205. if (edu.startTime && edu.endTime) {
  206. time = `${edu.startTime.split('-')[0]}-${edu.endTime.split('-')[0]}`
  207. }
  208. edu.time = time
  209. return edu
  210. })
  211. // 资质证书
  212. this.certificates = data.certificates
  213. if (data?.resumeList?.resumesId) {
  214. // 将简历id回传给父页面
  215. uni.$emit('getResumeIdByComponent', data.resumeList.resumesId)
  216. }
  217. }
  218. })
  219. },
  220. // 格式化薪资
  221. formatSalary(min, max) {
  222. if (min && max) {
  223. return `${min / 1000}-${max / 1000}K`
  224. }
  225. return '--'
  226. },
  227. // 格式化标签
  228. formatTag(text) {
  229. return text.replace(/\//g, '|')
  230. },
  231. // 展示所有工作经历
  232. handleShowAll() {
  233. this.toggle = true
  234. },
  235. // 获取别人简历
  236. getOhterResume() {
  237. uni.showLoading({ title: '加载中' })
  238. this.$Request.get('/app/resumes/selectResumesByResumesId', {
  239. resumesId: this.resumesId,
  240. postPushId: this.postPushId,
  241. userId: uni.getStorageSync('userId') || 0,
  242. companyId: uni.getStorageSync('companyId'),
  243. }).then(res => {
  244. if (res.code == 0) {
  245. this.setDetail(res.data)
  246. } else {
  247. uni.hideLoading()
  248. uni.showModal({
  249. title: '提示',
  250. content: '用户简历不存在',
  251. showCancel: false,
  252. complete(ret) {
  253. uni.navigateBack()
  254. }
  255. })
  256. }
  257. }).finally(() => {
  258. uni.hideLoading()
  259. })
  260. },
  261. // 设置请求的数据
  262. setDetail(data) {
  263. this.userName = data.resumesListDtoList?.userName
  264. this.sex = data.resumesListDtoList?.userSex
  265. this.avatarUrl = data.resumesListDtoList?.userAvatar
  266. this.jobStatus = data.resumesStatus
  267. if (data.workExpList.length) {
  268. this.currentCompanyName = data.workExpList[0].companyName
  269. }
  270. this.currentPositionName = data.industryName
  271. // 添加工作年限
  272. if (data.resumesWorkExperience) {
  273. this.baseInfoList.push(data.resumesWorkExperience)
  274. }
  275. // 添加学历
  276. if (data.eduList) {
  277. this.baseInfoList.push(this.$queue.getHighestEducation(data.eduList))
  278. }
  279. // 添加年龄
  280. if (data.resumesListDtoList) {
  281. this.baseInfoList.push(`${data.resumesListDtoList.userAge}岁`)
  282. }
  283. this.adv = data.resumesListDtoList?.adv
  284. // 求职期望
  285. this.intentions = data.intentionList.map(item => {
  286. item.industry = data.resumesListDtoList.intentIndustry
  287. return item
  288. })
  289. // 工作经历
  290. this.workExpList = data?.workExpList.map(work => {
  291. // 判断是否是跨境公司
  292. let isCrossCompany = false
  293. if (work.type && JSON.parse(work.type)?.[0] == 0) {
  294. isCrossCompany = true
  295. }
  296. work.isCrossCompany = isCrossCompany
  297. work.workExpDetailList = work.workExpDetailList.map(item => {
  298. item.startTime = item.startTime?.slice(0, 10)
  299. item.endTime = item.endTime?.slice(0, 10)
  300. item.skills = JSON.parse(item.skills)
  301. return item
  302. })
  303. return work
  304. })
  305. // 教育经历
  306. this.eduList = data.eduList.map(edu => {
  307. let time = ''
  308. if (edu.startTime && edu.endTime) {
  309. time = `${edu.startTime.split('-')[0]}-${edu.endTime.split('-')[0]}`
  310. }
  311. edu.time = time
  312. return edu
  313. })
  314. // 资质证书
  315. this.certificates = data.certificates
  316. // 观看记录
  317. this.browseTag = data.resumesListDtoList?.browseTag
  318. }
  319. }
  320. }
  321. </script>
  322. <style lang="scss" scoped>
  323. .preview-resume-container {
  324. font-family: DM Sans;
  325. padding: 20rpx 40rpx 40rpx;
  326. background: #fff;
  327. // 个人基本信息
  328. .user-info {
  329. .name {
  330. font-size: 48rpx;
  331. font-weight: 700;
  332. line-height: 60rpx;
  333. text {
  334. flex: 1;
  335. }
  336. .badge {
  337. height: 18px;
  338. border-radius: 4px;
  339. background: rgba(213, 255, 231, 1);
  340. padding: 8rpx;
  341. color: rgba(29, 209, 104, 1);
  342. font-size: 8px;
  343. font-weight: 400;
  344. line-height: 10px;
  345. margin-left: 20rpx;
  346. }
  347. }
  348. .avatar-box {
  349. position: relative;
  350. .avatar {
  351. display: block;
  352. width: 72rpx;
  353. height: 72rpx;
  354. border-radius: 72rpx;
  355. border: 1px solid rgba(240, 240, 240, 1);
  356. }
  357. .sex-tag {
  358. position: absolute;
  359. top: 0;
  360. right: 0;
  361. width: 22rpx;
  362. height: 22rpx;
  363. border-radius: 22rpx;
  364. background: #fff;
  365. }
  366. }
  367. .sub-info {
  368. font-size: 24rpx;
  369. line-height: 40rpx;
  370. color: rgba(156, 164, 171, 1);
  371. margin: 20rpx 0;
  372. .icon {
  373. display: block;
  374. width: 40rpx;
  375. height: 40rpx;
  376. margin-right: 8rpx;
  377. }
  378. }
  379. .advantages {
  380. font-size: 28rpx;
  381. line-height: 36rpx;
  382. color: rgba(97, 110, 124, 1);
  383. margin-top: 20rpx;
  384. word-wrap: break-word;
  385. }
  386. .resume-tag {
  387. display: flex;
  388. align-items: center;
  389. font-size: 24rpx;
  390. line-height: 32rpx;
  391. color: rgba(1, 107, 246, 1);
  392. padding: 16rpx 0;
  393. margin-top: 20rpx;
  394. .resume-icon {
  395. display: block;
  396. width: 32rpx;
  397. height: 32rpx;
  398. margin-right: 8rpx;
  399. }
  400. }
  401. }
  402. // 求职期望
  403. .job-expect-container {
  404. margin-top: 20rpx;
  405. .job-expect-title {
  406. font-size: 32rpx;
  407. line-height: 48rpx;
  408. color: rgba(34, 37, 42, 1);
  409. margin-bottom: 20rpx;
  410. }
  411. .job-expect {
  412. margin-bottom: 20rpx;
  413. .text {
  414. width: 500rpx;
  415. font-size: 24rpx;
  416. line-height: 32rpx;
  417. color: rgba(153, 153, 153, 1);
  418. padding: 6rpx 0;
  419. margin-bottom: 12rpx;
  420. text {
  421. margin-right: 8rpx;
  422. }
  423. }
  424. .salary {
  425. font-size: 32rpx;
  426. line-height: 40rpx;
  427. font-weight: 700;
  428. color: rgba(1, 107, 246, 1);
  429. }
  430. .skills {
  431. font-size: 20rpx;
  432. line-height: 24rpx;
  433. color: rgba(153, 153, 153, 1);
  434. }
  435. }
  436. }
  437. // 工作经历
  438. .work-exprience-container {
  439. .title-bar {
  440. border-radius: 110rpx;
  441. box-shadow: 0px 16rpx 300rpx 0px rgba(0, 0, 0, 0.06);
  442. background: rgba(1, 107, 246, 0.1);
  443. padding: 12rpx 24rpx;
  444. color: rgba(1, 107, 246, 1);
  445. font-size: 32rpx;
  446. line-height: 44rpx;
  447. margin-bottom: 20rpx;
  448. .title-icon {
  449. display: block;
  450. width: 28rpx;
  451. height: 28rpx;
  452. margin-right: 8rpx;
  453. }
  454. }
  455. .work-item {
  456. margin-bottom: 40rpx;
  457. &:last-child {
  458. margin-bottom: 0;
  459. }
  460. }
  461. .company-name-title {
  462. display: flex;
  463. justify-content: space-between;
  464. margin-bottom: 8rpx;
  465. .company-name {
  466. flex: 1;
  467. font-size: 28rpx;
  468. color: rgba(23, 23, 37, 1);
  469. line-height: 32rpx;
  470. padding: 6rpx 0;
  471. }
  472. .company-tag {
  473. height: 32rpx;
  474. font-size: 20rpx;
  475. line-height: 1;
  476. color: #fff;
  477. border-radius: 8rpx;
  478. background: linear-gradient(90.00deg, rgba(13, 39, 247, 0.75) 0%,rgba(19, 193, 234, 0.75) 100%);
  479. padding: 6rpx 7rpx;
  480. margin-top: 6rpx;
  481. margin-left: 20rpx;
  482. box-sizing: border-box;
  483. }
  484. }
  485. .position-item {
  486. padding-bottom: 36rpx;
  487. margin-bottom: 20rpx;
  488. border-bottom: 1px solid rgba(227, 231, 236, 0.55);
  489. .position-info {
  490. color: rgba(102, 102, 102, 1);
  491. font-size: 24rpx;
  492. line-height: 32rpx;
  493. margin-bottom: 8rpx;
  494. }
  495. .content {
  496. margin-bottom: 20rpx;
  497. .content-title {
  498. font-size: 28rpx;
  499. line-height: 36rpx;
  500. color: #000;
  501. margin-bottom: 8rpx;
  502. }
  503. .content-text {
  504. font-size: 28rpx;
  505. line-height: 36rpx;
  506. color: rgba(120, 130, 138, 1);
  507. }
  508. }
  509. &:last-child {
  510. padding-bottom: 0;
  511. margin-bottom: 0;
  512. border-bottom: none;
  513. }
  514. }
  515. .show-all-btn {
  516. font-size: 20rpx;
  517. line-height: 26rpx;
  518. color: rgba(1, 107, 246, 1);
  519. margin-bottom: 20rpx;
  520. }
  521. }
  522. .common-section {
  523. padding: 32rpx;
  524. border: 1px solid rgba(227, 231, 236, 1);
  525. border-radius: 24rpx;
  526. margin-bottom: 20rpx;
  527. .title {
  528. font-size: 32rpx;
  529. font-weight: 700;
  530. line-height: 48rpx;
  531. color: rgba(23, 23, 37, 1);
  532. margin-bottom: 24rpx;
  533. }
  534. .edu-item {
  535. margin-bottom: 56rpx;
  536. .school-name {
  537. font-size: 28rpx;
  538. line-height: 44rpx;
  539. color: rgba(23, 23, 37, 1);
  540. margin-bottom: 6rpx;
  541. }
  542. .edu-base-info {
  543. font-size: 24rpx;
  544. line-height: 40rpx;
  545. font-weight: 500;
  546. color: rgba(120, 130, 138, 1);
  547. }
  548. .desc {
  549. font-size: 28rpx;
  550. line-height: 36rpx;
  551. color: rgba(120, 130, 138, 1);
  552. margin-top: 6rpx;
  553. }
  554. &:last-child {
  555. margin-bottom: 0;
  556. }
  557. }
  558. }
  559. // tag样式
  560. .tags {
  561. display: flex;
  562. flex-wrap: wrap;
  563. gap: 8rpx;
  564. .tag {
  565. padding: 8rpx;
  566. border-radius: 8rpx;
  567. background: rgba(198, 198, 198, 0.1);
  568. font-size: 20rpx;
  569. line-height: 1;
  570. color: rgba(153, 153, 153, 1);
  571. word-break: break-all;
  572. }
  573. }
  574. }
  575. </style>