index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  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. ></uni-icons>
  221. </view>
  222. <view class="tags">
  223. <view
  224. v-for="skill in skillExp"
  225. :key="skill.title"
  226. class="tag"
  227. >
  228. {{ skill.title }}
  229. </view>
  230. </view>
  231. </view>
  232. </layout-page>
  233. </template>
  234. <script setup>
  235. import { ref } from 'vue'
  236. import { getAgeByBirthdayTimestamp, timesTampChange } from '@/utils/date'
  237. import {
  238. getResumeJobInterested,
  239. getResumeEduExp,
  240. getResumeWorkExp,
  241. getResumeTrainExp,
  242. getResumePersonSkill
  243. } from '@/api/resume'
  244. import { getText } from '@/utils/getText'
  245. import { getDict } from '@/hooks/useDictionaries'
  246. import { userStore } from '@/store/user'
  247. import { dealJobData } from './dict'
  248. import layoutPage from '@/layout'
  249. import { onShow } from '@dcloudio/uni-app'
  250. import { getUserAvatar } from '@/utils/avatar'
  251. const useUserStore = userStore()
  252. const baseInfo = ref({})
  253. const intention = ref([])
  254. const educationExp = ref([])
  255. const workExp = ref([])
  256. const trainExp = ref([])
  257. const skillExp = ref([])
  258. function handleTo (str, id) {
  259. uni.navigateTo({ url: id ? `/pagesA/resumeOnline/${str}?id=${id}` : `/pagesA/resumeOnline/${str}` })
  260. }
  261. // 获取基础信息
  262. function getBaseInfo () {
  263. const { name, phone, ...obj } = useUserStore.baseInfo
  264. baseInfo.value = {
  265. ...obj,
  266. name: name ? name : useUserStore.userInfo.phone,
  267. phone: phone ? phone : useUserStore.userInfo.phone,
  268. age: obj.birthday ? getAgeByBirthdayTimestamp(obj.birthday) : 0
  269. }
  270. }
  271. // 获取求职意向
  272. async function getJobInterested () {
  273. const { data } = await getResumeJobInterested()
  274. if (!data || !data.length) {
  275. return
  276. }
  277. // 完成度展示
  278. // emit('complete', { status: Boolean(data?.length), id: 'jobIntention' })
  279. // if (!data.length) return
  280. intention.value = dealJobData(data)
  281. }
  282. // 获取教育经历
  283. async function getEduExp () {
  284. const { data: dict } = await getDict('menduner_education_type')
  285. if (dict.code !== 0) {
  286. return
  287. }
  288. const { data } = await getResumeEduExp()
  289. if (!data || !data.length) {
  290. return
  291. }
  292. educationExp.value = data.map(e => {
  293. const item = dict.data.find(_e => _e.value === e.educationType)
  294. return {
  295. ...e,
  296. educationTypeText: item?.label ?? '',
  297. time: `${timesTampChange(e.startTime ,'Y-M')}-${timesTampChange(e.endTime ,'Y-M')} `
  298. }
  299. })
  300. // 完成度展示
  301. // emit('complete', { status: Boolean(data?.length), id: 'educationExp' })
  302. // dataList.value = data
  303. }
  304. // 获取工作经验
  305. async function getWorkExp () {
  306. const { data } = await getResumeWorkExp()
  307. if (!data || !data.length) {
  308. return
  309. }
  310. // console.log(data)
  311. // 完成度展示
  312. // emit('complete', { status: Boolean(data?.length), id: 'workExperience' })
  313. workExp.value = data.map(e => {
  314. return {
  315. ...e,
  316. time: `${timesTampChange(e.startTime ,'Y-M')}-${e.endTime ? timesTampChange(e.endTime ,'Y-M') : '至今'} `
  317. }
  318. })
  319. }
  320. // 培训经历
  321. async function getTrainExpData () {
  322. const { data } = await getResumeTrainExp()
  323. if (!data || !data.length) {
  324. return
  325. }
  326. // 完成度展示
  327. // emit('complete', { status: Boolean(data?.length), id: 'trainingExperience' })
  328. trainExp.value = data.map(e => {
  329. return {
  330. ...e,
  331. time: `${timesTampChange(e.startTime ,'Y-M')}-${e.endTime ? timesTampChange(e.endTime ,'Y-M') : '至今'} `
  332. }
  333. })
  334. }
  335. // 职业技能
  336. async function getSkillExpData () {
  337. const { data: _skillList} = await getDict('skillList', {}, 'skillList')
  338. const skillList = _skillList?.data
  339. if (!skillList || !skillList.length) {
  340. return
  341. }
  342. const { data: _skillLevelArr } = await getDict('menduner_skill_level')
  343. const skillLevelArr = _skillLevelArr?.data
  344. if (!skillLevelArr || !skillLevelArr.length) {
  345. return
  346. }
  347. const { data } = await getResumePersonSkill()
  348. if (!data || !data.length) {
  349. return
  350. }
  351. // 完成度展示
  352. // emit('complete', { status: Boolean(data?.length), id: 'vocationalSkills' })
  353. skillExp.value = data.map(e => {
  354. return {
  355. ...e,
  356. title: `${getText(e.skillId, skillList, 'nameCn', 'id')} / ${getText(e.level, skillLevelArr)}`
  357. }
  358. })
  359. }
  360. onShow(() => {
  361. // 获取基础信息
  362. getBaseInfo()
  363. // 获取求职意向
  364. getJobInterested()
  365. // 获取教育经历
  366. getEduExp()
  367. // 获取工作经验
  368. getWorkExp()
  369. // 培训经历
  370. getTrainExpData()
  371. // 职业技能
  372. getSkillExpData()
  373. })
  374. </script>
  375. <style lang="scss" scoped>
  376. $px: 30rpx;
  377. .borderLine {
  378. border-bottom: 2rpx solid #f5f5f5;
  379. }
  380. .title {
  381. font-size: 40rpx;
  382. font-weight: 600;
  383. }
  384. .flex-1 {
  385. flex: 1;
  386. }
  387. .soloHeight {
  388. height: 80rpx;
  389. line-height: 80rpx;
  390. }
  391. .px-20 {
  392. padding-left: 20rpx;
  393. padding-right: 20rpx;
  394. box-sizing: border-box;
  395. }
  396. .mr-20 {
  397. margin-right: 20rpx;
  398. }
  399. .ellipsis-2 {
  400. overflow: hidden;
  401. display: -webkit-box;
  402. text-overflow: ellipsis; //属性规定当文本溢出包含元素时发生的事情 text-overflow: clip|ellipsis|string; (修剪/省略号/指定字符串)
  403. -webkit-line-clamp: 2;
  404. -webkit-box-orient: vertical; //属性规定框的子元素应该被水平或垂直排列
  405. }
  406. .titleBox {
  407. margin-bottom: 10rpx;
  408. display: flex;
  409. justify-content: space-between;
  410. }
  411. .text {
  412. font-size: 28rpx;
  413. color: #666;
  414. }
  415. .baseInfo {
  416. padding: 20rpx $px;
  417. display: flex;
  418. justify-content: space-between;
  419. align-items: center;
  420. &-name {
  421. margin-bottom: 10rpx;
  422. .name {
  423. margin-right: 10rpx;
  424. }
  425. }
  426. &-desc {
  427. font-size: 28rpx;
  428. color: #666;
  429. margin-bottom: 10rpx;
  430. }
  431. &-phone {
  432. font-size: 28rpx;
  433. color: #666;
  434. .number {
  435. margin-left: 10rpx;
  436. }
  437. }
  438. .head {
  439. image {
  440. width: 150rpx;
  441. height: 150rpx;
  442. border: 2rpx solid #ccc;
  443. border-radius: 50%;
  444. }
  445. }
  446. }
  447. .advantage {
  448. padding: $px;
  449. }
  450. .characteristic {
  451. padding: $px;
  452. .tags {
  453. padding-top: $px;
  454. display: flex;
  455. flex-wrap: wrap;
  456. .tag {
  457. margin: 0 10rpx 10rpx 0;
  458. border: 2rpx solid #008978;
  459. color: #008978;
  460. white-space: nowrap;
  461. padding: 4rpx 10rpx;
  462. border-radius: 10rpx;
  463. font-size: 24rpx;
  464. }
  465. }
  466. }
  467. .intention,.educationExp,.workExp,.projectExp {
  468. padding: $px;
  469. }
  470. .workExp {
  471. .content {
  472. &-item {
  473. padding: $px 20rpx;
  474. }
  475. &-title {
  476. display: flex;
  477. justify-content: space-between;
  478. .name {
  479. // font-weight: 600;
  480. font-size: 30rpx;
  481. color: #333;
  482. }
  483. .time {
  484. color: #999;
  485. font-size: 24rpx;
  486. display: flex;
  487. align-items: center;
  488. .icon {
  489. margin-left: 20rpx;
  490. }
  491. }
  492. }
  493. &-subTitle {
  494. font-size: 24rpx;
  495. margin-top: 6rpx;
  496. color: #999;
  497. }
  498. &-main {
  499. margin-top: 20rpx;
  500. font-size: 24rpx;
  501. color: #999;
  502. }
  503. }
  504. }
  505. .intention {
  506. .content {
  507. .item {
  508. font-size: 28rpx;
  509. color: #666;
  510. &-title {
  511. color: #000;
  512. font-weight: 600;
  513. }
  514. &-tags {
  515. display: flex;
  516. .tag {
  517. border: 2rpx solid #008978;
  518. color: #008978;
  519. padding: 4rpx 16rpx;
  520. font-size: 24rpx;
  521. margin: 10rpx 10rpx 0 0;
  522. border-radius: 10rpx;
  523. }
  524. }
  525. }
  526. }
  527. }
  528. .popup {
  529. padding: $px;
  530. padding-bottom: 100rpx;
  531. &-title {
  532. width: 100%;
  533. display: flex;
  534. justify-content: space-between;
  535. margin-bottom: $px;
  536. font-size: 24rpx;
  537. .title {
  538. font-size: 36rpx;
  539. }
  540. }
  541. &-content {
  542. .box {
  543. display: flex;
  544. justify-content: space-between;
  545. border-bottom: 2rpx solid #eee;
  546. padding: $px 0;
  547. font-size: 30rpx;
  548. font-weight: 500;
  549. color: #000;
  550. &:last-of-type {
  551. border-bottom: none;
  552. }
  553. &.active {
  554. color: #008978;
  555. font-weight: 600;
  556. }
  557. }
  558. }
  559. }
  560. .popupBox {
  561. height: 90vh;
  562. .handleBtnBox {
  563. // padding: 0 $px;
  564. display: flex;
  565. justify-content: space-between;
  566. view {
  567. padding: $px/2;
  568. margin-right: $px/2;
  569. }
  570. .save {
  571. color: #008978;
  572. }
  573. .close {
  574. color: gray;
  575. }
  576. }
  577. .popupContent {
  578. padding: $px;
  579. padding-bottom: 100rpx;
  580. }
  581. }
  582. </style>