index.vue 14 KB

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