index.vue 15 KB

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