index.vue 15 KB

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