index.vue 16 KB

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