preview-resume.vue 15 KB

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