index.vue 14 KB

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