index.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605
  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="save" @click="null"></view>
  220. <view class="close" @click="popupRef.close()"><uni-icons type="closeempty" size="18"></uni-icons></view>
  221. <!-- <view class="save" @click="null">保存</view> -->
  222. </view>
  223. <view class="popupContent">
  224. <jobIntention></jobIntention>
  225. </view>
  226. </view>
  227. </uni-popup>
  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 jobIntention from './jobIntention.vue'
  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) {
  255. uni.navigateTo({ url: `/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')}-${timesTampChange(e.endTime ,'Y')} `
  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. const popupRef = ref()
  357. const popupOpen = (type) => {
  358. popupRef.value.open()
  359. }
  360. // 求职状态字典
  361. // getJobStatus()
  362. // 获取基础信息
  363. getBaseInfo()
  364. // 获取求职意向
  365. getJobInterested()
  366. // 获取教育经历
  367. getEduExp()
  368. // 获取工作经验
  369. getWorkExp()
  370. // 培训经历
  371. getTrainExpData()
  372. // 职业技能
  373. getSkillExpData()
  374. onShow(() => {
  375. getBaseInfo()
  376. })
  377. </script>
  378. <style lang="scss" scoped>
  379. $px: 30rpx;
  380. .borderLine {
  381. border-bottom: 2rpx solid #f5f5f5;
  382. }
  383. .title {
  384. font-size: 40rpx;
  385. font-weight: 600;
  386. }
  387. .flex-1 {
  388. flex: 1;
  389. }
  390. .soloHeight {
  391. height: 80rpx;
  392. line-height: 80rpx;
  393. }
  394. .px-20 {
  395. padding-left: 20rpx;
  396. padding-right: 20rpx;
  397. box-sizing: border-box;
  398. }
  399. .mr-20 {
  400. margin-right: 20rpx;
  401. }
  402. .ellipsis-2 {
  403. overflow: hidden;
  404. display: -webkit-box;
  405. text-overflow: ellipsis; //属性规定当文本溢出包含元素时发生的事情 text-overflow: clip|ellipsis|string; (修剪/省略号/指定字符串)
  406. -webkit-line-clamp: 2;
  407. -webkit-box-orient: vertical; //属性规定框的子元素应该被水平或垂直排列
  408. }
  409. .titleBox {
  410. margin-bottom: 10rpx;
  411. display: flex;
  412. justify-content: space-between;
  413. }
  414. .text {
  415. font-size: 28rpx;
  416. color: #666;
  417. }
  418. .baseInfo {
  419. padding: 20rpx $px;
  420. display: flex;
  421. justify-content: space-between;
  422. align-items: center;
  423. &-name {
  424. margin-bottom: 10rpx;
  425. .name {
  426. margin-right: 10rpx;
  427. }
  428. }
  429. &-desc {
  430. font-size: 28rpx;
  431. color: #666;
  432. margin-bottom: 10rpx;
  433. }
  434. &-phone {
  435. font-size: 28rpx;
  436. color: #666;
  437. .number {
  438. margin-left: 10rpx;
  439. }
  440. }
  441. .head {
  442. image {
  443. width: 150rpx;
  444. height: 150rpx;
  445. border: 2rpx solid #ccc;
  446. border-radius: 50%;
  447. }
  448. }
  449. }
  450. .advantage {
  451. padding: $px;
  452. }
  453. .characteristic {
  454. padding: $px;
  455. .tags {
  456. padding-top: $px;
  457. display: flex;
  458. flex-wrap: wrap;
  459. .tag {
  460. margin: 0 10rpx 10rpx 0;
  461. border: 2rpx solid #008978;
  462. color: #008978;
  463. white-space: nowrap;
  464. padding: 4rpx 10rpx;
  465. border-radius: 10rpx;
  466. font-size: 24rpx;
  467. }
  468. }
  469. }
  470. .intention,.educationExp,.workExp,.projectExp {
  471. padding: $px;
  472. }
  473. .workExp {
  474. .content {
  475. &-item {
  476. padding: $px 20rpx;
  477. }
  478. &-title {
  479. display: flex;
  480. justify-content: space-between;
  481. .name {
  482. // font-weight: 600;
  483. font-size: 30rpx;
  484. color: #333;
  485. }
  486. .time {
  487. color: #999;
  488. font-size: 24rpx;
  489. display: flex;
  490. align-items: center;
  491. .icon {
  492. margin-left: 20rpx;
  493. }
  494. }
  495. }
  496. &-subTitle {
  497. font-size: 24rpx;
  498. margin-top: 6rpx;
  499. color: #999;
  500. }
  501. &-main {
  502. margin-top: 20rpx;
  503. font-size: 24rpx;
  504. color: #999;
  505. }
  506. }
  507. }
  508. .intention {
  509. .content {
  510. .item {
  511. font-size: 28rpx;
  512. color: #666;
  513. &-title {
  514. color: #000;
  515. font-weight: 600;
  516. }
  517. &-tags {
  518. display: flex;
  519. .tag {
  520. border: 2rpx solid #008978;
  521. color: #008978;
  522. padding: 4rpx 16rpx;
  523. font-size: 24rpx;
  524. margin: 10rpx 10rpx 0 0;
  525. border-radius: 10rpx;
  526. }
  527. }
  528. }
  529. }
  530. }
  531. .popup {
  532. padding: $px;
  533. padding-bottom: 100rpx;
  534. &-title {
  535. width: 100%;
  536. display: flex;
  537. justify-content: space-between;
  538. margin-bottom: $px;
  539. font-size: 24rpx;
  540. .title {
  541. font-size: 36rpx;
  542. }
  543. }
  544. &-content {
  545. .box {
  546. display: flex;
  547. justify-content: space-between;
  548. border-bottom: 2rpx solid #eee;
  549. padding: $px 0;
  550. font-size: 30rpx;
  551. font-weight: 500;
  552. color: #000;
  553. &:last-of-type {
  554. border-bottom: none;
  555. }
  556. &.active {
  557. color: #008978;
  558. font-weight: 600;
  559. }
  560. }
  561. }
  562. }
  563. .popupBox {
  564. height: 90vh;
  565. .handleBtnBox {
  566. // padding: 0 $px;
  567. display: flex;
  568. justify-content: space-between;
  569. view {
  570. padding: $px/2;
  571. margin-right: $px/2;
  572. }
  573. .save {
  574. color: #008978;
  575. }
  576. .close {
  577. color: gray;
  578. }
  579. }
  580. .popupContent {
  581. padding: $px;
  582. padding-bottom: 100rpx;
  583. }
  584. }
  585. </style>