index.vue 13 KB

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