preview-resume.vue 12 KB

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