index.vue 15 KB

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