index.vue 15 KB

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