index.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  1. <template>
  2. <layout-page>
  3. <!-- 基本信息 -->
  4. <view class="progress-box">
  5. <view>简历完成度</view>
  6. <progress
  7. :percent="Number.isInteger(completeNum/7*100) ? (completeNum/7*100) : (completeNum/7*100).toFixed(2)"
  8. show-info
  9. border-radius="50"
  10. activeColor="#00897B"
  11. stroke-width="8"
  12. />
  13. </view>
  14. <!-- <view class="topTip">
  15. 使用简历附件生成在线简历:
  16. <text class="resumeAnalysisBtn" @tap="handleToResumeAnalysis">立即生成</text>
  17. </view> -->
  18. <view class="baseInfo borderLine" @tap="handleTo('baseInfoEdit')">
  19. <view>
  20. <view class="baseInfo-name">
  21. <text class="name title">{{ baseInfo.name }}</text>
  22. <uni-icons
  23. type="icon-Edit"
  24. color="#333"
  25. custom-prefix="iconfont"
  26. size="20"
  27. ></uni-icons>
  28. </view>
  29. <view class="baseInfo-desc">{{ baseInfo.jobStatusText }}</view>
  30. <view class="baseInfo-desc">{{ baseInfo.expTypeText ? baseInfo.expTypeText + ' - ' : '' }}{{ baseInfo.age ? baseInfo.age + '岁' : '' }}{{ baseInfo.eduTypeText ? ' - ' + baseInfo.eduTypeText : '' }}</view>
  31. <view class="baseInfo-phone">
  32. <uni-icons
  33. type="icon-Phone"
  34. color="#999"
  35. custom-prefix="iconfont"
  36. size="14"
  37. ></uni-icons>
  38. <text class="number">{{ baseInfo.phone }}</text>
  39. </view>
  40. </view>
  41. <view class="head">
  42. <image
  43. :src="getUserAvatar(baseInfo?.avatar, baseInfo?.sex)"
  44. mode="scaleToFill"
  45. />
  46. </view>
  47. </view>
  48. <!-- 个人画像 -->
  49. <view class="characteristic borderLine">
  50. <view class="titleBox">
  51. <text class="title">个人画像</text>
  52. <uni-icons
  53. type="icon-Edit"
  54. color="#666"
  55. custom-prefix="iconfont"
  56. size="18"
  57. @tap="handleTo('portrait')"
  58. ></uni-icons>
  59. </view>
  60. <view class="tags">
  61. <view
  62. v-for="tag in baseInfo.tagList"
  63. :key="tag"
  64. class="tag"
  65. >
  66. {{ tag }}
  67. </view>
  68. </view>
  69. </view>
  70. <!-- 个人优势 -->
  71. <view class="advantage borderLine">
  72. <view class="titleBox">
  73. <text class="title">个人优势</text>
  74. <uni-icons
  75. type="icon-Edit"
  76. color="#666"
  77. custom-prefix="iconfont"
  78. size="18"
  79. @tap="handleTo('advantage')"
  80. ></uni-icons>
  81. </view>
  82. <view class="ellipsis-2 text px-20">{{ baseInfo.advantage ? baseInfo.advantage : '请填写您的个人优势...' }}</view>
  83. </view>
  84. <!-- 求职意向 -->
  85. <view class="intention borderLine">
  86. <view class="titleBox">
  87. <text class="title">求职意向</text>
  88. <uni-icons
  89. type="icon-add"
  90. color="#666"
  91. custom-prefix="iconfont"
  92. size="18"
  93. @tap="handleTo('jobIntention')"
  94. ></uni-icons>
  95. </view>
  96. <view class="content">
  97. <view class="text" v-if="!intention.length">请填写您的求职意向...</view>
  98. <uni-list :border="false">
  99. <uni-list-item
  100. v-for="int in intention"
  101. :key="int.id"
  102. :border="false"
  103. :clickable="true"
  104. showArrow
  105. @click="handleTo('jobIntention', int.id)"
  106. >
  107. <template v-slot:body>
  108. <view class="item">
  109. <view class="item-title">{{ int.jobTypeName}}</view>
  110. <view>
  111. <text class="mr-20">{{ int.position}}</text>
  112. <text>{{ int.payFrom }} {{ int.payFrom && int.payTo ? '-' : ''}} {{ int.payTo}}</text>
  113. </view>
  114. <view>{{ int.interestedArea && int.interestedArea.length ? int.workArea + ',' + int.interestedArea.map(e => e.name).join(',') : int.workArea }}</view>
  115. <view class="item-tags">
  116. <view v-for="industry in int.industry" :key="industry.id" class="tag">{{ industry.nameCn }}</view>
  117. </view>
  118. </view>
  119. </template>
  120. </uni-list-item>
  121. </uni-list>
  122. </view>
  123. </view>
  124. <!-- 教育经历 -->
  125. <view class="educationExp borderLine">
  126. <view class="titleBox">
  127. <text class="title">教育经历</text>
  128. <uni-icons
  129. type="icon-add"
  130. color="#666"
  131. custom-prefix="iconfont"
  132. size="18"
  133. @tap="handleTo('educationExp')"
  134. ></uni-icons>
  135. </view>
  136. <view class="content">
  137. <view class="text" v-if="!educationExp.length">请填写您的教育经历...</view>
  138. <uni-list :border="false">
  139. <uni-list-item
  140. v-for="education in educationExp"
  141. :key="education.id"
  142. showArrow
  143. :border="false"
  144. :clickable="true"
  145. :title="education.schoolName"
  146. :note="`${education.major} ${education.educationTypeText}`"
  147. :rightText="education.time"
  148. @click="handleTo('educationExp', education.id)"
  149. />
  150. </uni-list>
  151. </view>
  152. </view>
  153. <!-- 工作经历 -->
  154. <view class="workExp borderLine">
  155. <view class="titleBox">
  156. <text class="title">工作经历</text>
  157. <uni-icons
  158. type="icon-add"
  159. color="#666"
  160. custom-prefix="iconfont"
  161. size="18"
  162. @tap="handleTo('workExperience')"
  163. ></uni-icons>
  164. </view>
  165. <view class="content">
  166. <view
  167. v-for="work in workExp"
  168. :key="work.id"
  169. class="content-item"
  170. @tap="handleTo('workExperience', work.id)"
  171. >
  172. <view class="content-title">
  173. <view class="name">{{ work.enterpriseName }}</view>
  174. <view class="time">
  175. {{ work.time }}
  176. <uni-icons
  177. class="icon"
  178. type="right"
  179. color="#aaa"
  180. size="16"
  181. />
  182. </view>
  183. </view>
  184. <view class="content-subTitle">{{ work.positionName }}</view>
  185. <view class="content-main ellipsis-2">内容:{{ work.content }}</view>
  186. </view>
  187. </view>
  188. </view>
  189. <!-- 培训经历 -->
  190. <view class="workExp trainExp borderLine">
  191. <view class="titleBox">
  192. <text class="title">培训经历</text>
  193. <uni-icons
  194. type="icon-add"
  195. color="#666"
  196. custom-prefix="iconfont"
  197. size="18"
  198. @tap.stop="handleTo('trainingExperience')"
  199. ></uni-icons>
  200. </view>
  201. <view class="content">
  202. <view
  203. v-for="train in trainExp"
  204. :key="train.id"
  205. class="content-item"
  206. @tap.stop="handleTo('trainingExperience', train.id)"
  207. >
  208. <view class="content-title">
  209. <view class="name">{{ train.orgName }}</view>
  210. <view class="time">
  211. {{ train.time }}
  212. <uni-icons
  213. class="icon"
  214. type="right"
  215. color="#aaa"
  216. size="16"
  217. />
  218. </view>
  219. </view>
  220. <view class="content-subTitle">课程:{{ train.course }}</view>
  221. <view class="content-main ellipsis-2">描述:{{ train.content }}</view>
  222. </view>
  223. </view>
  224. </view>
  225. <!-- 职业技能 -->
  226. <view class="characteristic">
  227. <view class="titleBox">
  228. <text class="title">职业技能</text>
  229. <uni-icons
  230. type="icon-Edit"
  231. color="#666"
  232. custom-prefix="iconfont"
  233. size="18"
  234. @tap.stop="handleTo('vocationalSkills')"
  235. ></uni-icons>
  236. </view>
  237. <view class="tags">
  238. <view
  239. v-for="skill in skillExp"
  240. :key="skill.title"
  241. class="tag"
  242. >
  243. {{ skill.title }}
  244. </view>
  245. </view>
  246. </view>
  247. </layout-page>
  248. </template>
  249. <script setup>
  250. import { ref } from 'vue'
  251. import { getAgeByBirthdayTimestamp, timesTampChange } from '@/utils/date'
  252. import {
  253. getResumeJobInterested,
  254. getResumeEduExp,
  255. getResumeWorkExp,
  256. getResumeTrainExp,
  257. getResumePersonSkill
  258. } from '@/api/resume'
  259. import { getText } from '@/utils/getText'
  260. import { getDict } from '@/hooks/useDictionaries'
  261. import { userStore } from '@/store/user'
  262. import { dealJobData } from './dict'
  263. import layoutPage from '@/layout'
  264. import { onShow } from '@dcloudio/uni-app'
  265. import { getUserAvatar } from '@/utils/avatar'
  266. const useUserStore = userStore()
  267. const baseInfo = ref({})
  268. const intention = ref([])
  269. const educationExp = ref([])
  270. const workExp = ref([])
  271. const trainExp = ref([])
  272. const skillExp = ref([])
  273. // 简历完成度
  274. const completeNum = ref(0)
  275. function handleTo (str, id) {
  276. uni.navigateTo({ url: id ? `/pagesA/resumeOnline/${str}?id=${id}` : `/pagesA/resumeOnline/${str}` })
  277. }
  278. // function handleToResumeAnalysis () {
  279. // uni.navigateTo({ url: '/pagesA/resumeAnalysis/index' })
  280. // }
  281. // 获取基础信息
  282. function getBaseInfo () {
  283. const { name, phone, ...obj } = useUserStore.baseInfo
  284. baseInfo.value = {
  285. ...obj,
  286. name: name ? name : useUserStore.userInfo.phone,
  287. phone: phone ? phone : useUserStore.userInfo.phone,
  288. age: obj.birthday ? getAgeByBirthdayTimestamp(obj.birthday) : 0
  289. }
  290. if (useUserStore.userInfo && Object.keys(useUserStore.userInfo).length) completeNum.value++
  291. if (baseInfo.value?.advantage ) completeNum.value++
  292. }
  293. // 获取求职意向
  294. async function getJobInterested () {
  295. const { data } = await getResumeJobInterested()
  296. if (!data || !data.length) {
  297. return
  298. }
  299. completeNum.value++ // 完成度展示
  300. intention.value = dealJobData(data)
  301. }
  302. // 获取教育经历
  303. async function getEduExp () {
  304. const { data: dict } = await getDict('menduner_education_type')
  305. if (dict.code !== 0) {
  306. return
  307. }
  308. const { data } = await getResumeEduExp()
  309. if (!data || !data.length) {
  310. return
  311. }
  312. completeNum.value++ // 完成度展示
  313. educationExp.value = data.map(e => {
  314. const item = dict.data.find(_e => _e.value === e.educationType)
  315. return {
  316. ...e,
  317. educationTypeText: item?.label ?? '',
  318. time: `${timesTampChange(e.startTime ,'Y-M')}-${timesTampChange(e.endTime ,'Y-M')} `
  319. }
  320. })
  321. }
  322. // 获取工作经验
  323. async function getWorkExp () {
  324. const { data } = await getResumeWorkExp()
  325. if (!data || !data.length) {
  326. return
  327. }
  328. completeNum.value++ // 完成度展示
  329. workExp.value = data.map(e => {
  330. return {
  331. ...e,
  332. time: `${timesTampChange(e.startTime ,'Y-M')}-${e.endTime ? timesTampChange(e.endTime ,'Y-M') : '至今'} `
  333. }
  334. })
  335. }
  336. // 培训经历
  337. async function getTrainExpData () {
  338. const { data } = await getResumeTrainExp()
  339. if (!data || !data.length) {
  340. return
  341. }
  342. completeNum.value++ // 完成度展示
  343. trainExp.value = data.map(e => {
  344. return {
  345. ...e,
  346. time: `${timesTampChange(e.startTime ,'Y-M')}-${e.endTime ? timesTampChange(e.endTime ,'Y-M') : '至今'} `
  347. }
  348. })
  349. }
  350. // 职业技能
  351. async function getSkillExpData () {
  352. const { data: _skillList} = await getDict('skillList', {}, 'skillList')
  353. const skillList = _skillList?.data
  354. if (!skillList || !skillList.length) {
  355. return
  356. }
  357. completeNum.value++ // 完成度展示
  358. const { data: _skillLevelArr } = await getDict('menduner_skill_level')
  359. const skillLevelArr = _skillLevelArr?.data
  360. if (!skillLevelArr || !skillLevelArr.length) {
  361. return
  362. }
  363. const { data } = await getResumePersonSkill()
  364. if (!data || !data.length) {
  365. return
  366. }
  367. skillExp.value = data.map(e => {
  368. return {
  369. ...e,
  370. title: `${getText(e.skillId, skillList, 'nameCn', 'id')} / ${getText(e.level, skillLevelArr)}`
  371. }
  372. })
  373. }
  374. onShow(() => {
  375. completeNum.value = 0
  376. // 获取基础信息
  377. getBaseInfo()
  378. // 获取求职意向
  379. getJobInterested()
  380. // 获取教育经历
  381. getEduExp()
  382. // 获取工作经验
  383. getWorkExp()
  384. // 培训经历
  385. getTrainExpData()
  386. // 职业技能
  387. getSkillExpData()
  388. })
  389. </script>
  390. <style lang="scss" scoped>
  391. $px: 30rpx;
  392. .borderLine {
  393. border-bottom: 2rpx solid #f5f5f5;
  394. }
  395. .progress-box {
  396. padding: 20rpx $px;
  397. }
  398. .title {
  399. font-size: 40rpx;
  400. font-weight: 600;
  401. }
  402. .flex-1 {
  403. flex: 1;
  404. }
  405. .soloHeight {
  406. height: 80rpx;
  407. line-height: 80rpx;
  408. }
  409. .px-20 {
  410. padding-left: 20rpx;
  411. padding-right: 20rpx;
  412. box-sizing: border-box;
  413. }
  414. .mr-20 {
  415. margin-right: 20rpx;
  416. }
  417. .ellipsis-2 {
  418. overflow: hidden;
  419. display: -webkit-box;
  420. text-overflow: ellipsis; //属性规定当文本溢出包含元素时发生的事情 text-overflow: clip|ellipsis|string; (修剪/省略号/指定字符串)
  421. -webkit-line-clamp: 2;
  422. -webkit-box-orient: vertical; //属性规定框的子元素应该被水平或垂直排列
  423. }
  424. .titleBox {
  425. margin-bottom: 10rpx;
  426. display: flex;
  427. justify-content: space-between;
  428. }
  429. .text {
  430. font-size: 28rpx;
  431. color: #666;
  432. }
  433. .baseInfo {
  434. padding: 20rpx $px;
  435. display: flex;
  436. justify-content: space-between;
  437. align-items: center;
  438. &-name {
  439. margin-bottom: 10rpx;
  440. .name {
  441. margin-right: 10rpx;
  442. }
  443. }
  444. &-desc {
  445. font-size: 28rpx;
  446. color: #666;
  447. margin-bottom: 10rpx;
  448. }
  449. &-phone {
  450. font-size: 28rpx;
  451. color: #666;
  452. .number {
  453. margin-left: 10rpx;
  454. }
  455. }
  456. .head {
  457. image {
  458. width: 150rpx;
  459. height: 150rpx;
  460. border: 2rpx solid #ccc;
  461. border-radius: 50%;
  462. }
  463. }
  464. }
  465. .advantage {
  466. padding: $px;
  467. }
  468. .characteristic {
  469. padding: $px;
  470. .tags {
  471. padding-top: $px;
  472. display: flex;
  473. flex-wrap: wrap;
  474. .tag {
  475. margin: 0 10rpx 10rpx 0;
  476. border: 2rpx solid #008978;
  477. color: #008978;
  478. white-space: nowrap;
  479. padding: 4rpx 10rpx;
  480. border-radius: 10rpx;
  481. font-size: 24rpx;
  482. }
  483. }
  484. }
  485. .intention,.educationExp,.workExp,.projectExp {
  486. padding: $px;
  487. }
  488. .workExp {
  489. .content {
  490. &-item {
  491. padding: $px 20rpx;
  492. }
  493. &-title {
  494. display: flex;
  495. justify-content: space-between;
  496. .name {
  497. // font-weight: 600;
  498. font-size: 30rpx;
  499. color: #333;
  500. }
  501. .time {
  502. color: #999;
  503. font-size: 24rpx;
  504. display: flex;
  505. align-items: center;
  506. .icon {
  507. margin-left: 20rpx;
  508. }
  509. }
  510. }
  511. &-subTitle {
  512. font-size: 24rpx;
  513. margin-top: 6rpx;
  514. color: #999;
  515. }
  516. &-main {
  517. margin-top: 20rpx;
  518. font-size: 24rpx;
  519. color: #999;
  520. }
  521. }
  522. }
  523. .intention {
  524. .content {
  525. .item {
  526. font-size: 28rpx;
  527. color: #666;
  528. &-title {
  529. color: #000;
  530. font-weight: 600;
  531. }
  532. &-tags {
  533. display: flex;
  534. .tag {
  535. border: 2rpx solid #008978;
  536. color: #008978;
  537. padding: 4rpx 16rpx;
  538. font-size: 24rpx;
  539. margin: 10rpx 10rpx 0 0;
  540. border-radius: 10rpx;
  541. }
  542. }
  543. }
  544. }
  545. }
  546. .popup {
  547. padding: $px;
  548. padding-bottom: 100rpx;
  549. &-title {
  550. width: 100%;
  551. display: flex;
  552. justify-content: space-between;
  553. margin-bottom: $px;
  554. font-size: 24rpx;
  555. .title {
  556. font-size: 36rpx;
  557. }
  558. }
  559. &-content {
  560. .box {
  561. display: flex;
  562. justify-content: space-between;
  563. border-bottom: 2rpx solid #eee;
  564. padding: $px 0;
  565. font-size: 30rpx;
  566. font-weight: 500;
  567. color: #000;
  568. &:last-of-type {
  569. border-bottom: none;
  570. }
  571. &.active {
  572. color: #008978;
  573. font-weight: 600;
  574. }
  575. }
  576. }
  577. }
  578. .popupBox {
  579. height: 90vh;
  580. .handleBtnBox {
  581. // padding: 0 $px;
  582. display: flex;
  583. justify-content: space-between;
  584. view {
  585. padding: calc($px / 2);
  586. margin-right: calc($px / 2);
  587. }
  588. .save {
  589. color: #008978;
  590. }
  591. .close {
  592. color: gray;
  593. }
  594. }
  595. .popupContent {
  596. padding: $px;
  597. padding-bottom: 100rpx;
  598. }
  599. }
  600. .topTip {
  601. background-color: #f7f8fa;
  602. color: #2f3640;
  603. padding: 12px 20px;
  604. margin: 20px 20rpx;
  605. font-size: 14px;
  606. }
  607. .resumeAnalysisBtn {
  608. text-decoration: underline;
  609. color: #008978;
  610. }
  611. </style>