index.vue 14 KB

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