index.vue 15 KB

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