preview-resume.vue 16 KB

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