index.vue 15 KB

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