PersonalCenterIndex.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509
  1. <!--
  2. * @Description: 个人中心
  3. * @Author: 空白格
  4. * @Date: 2022-08-15 10:09:03
  5. * @LastEditors: 空白格
  6. * @LastEditTime: 2022-08-23 15:27:46
  7. * @FilePath: \veterans_client_web\src\views\PersonalCenter\PersonalCenterIndex.vue
  8. * @Copyright: Copyright (c) 2016~2022 by 空白格, All Rights Reserved.
  9. -->
  10. <template>
  11. <div class="app-main personal-center">
  12. <div class="personal-center-header">
  13. <div class="app-main-box personal-center-header-box">
  14. <el-row>
  15. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  16. <div class="pchb-left">
  17. <div class="pchb-left-avatar hexagon">
  18. <div
  19. class="pchb-left-avatar-box hexagon-box"
  20. :style="{
  21. backgroundImage: `url('${
  22. userInfo.avatar
  23. ? userInfo.avatar
  24. : 'https://cube.elemecdn.com/3/7c/3ea6beec64369c2642b92c6726f1epng.png'
  25. }')`,
  26. }"
  27. ></div>
  28. </div>
  29. <div class="pchb-left-user">
  30. <div class="pchb-left-user-item">
  31. <div class="plui-username">{{ userInfo.name || "-" }}</div>
  32. <div class="plui-integral">
  33. <div class="plui-integral-item">进步<br />积分</div>
  34. <div class="plui-integral-item">
  35. {{ integralTotal || 0 }}
  36. </div>
  37. <div class="plui-integral-item">
  38. <span class="el-icon-arrow-right"></span>
  39. </div>
  40. </div>
  41. </div>
  42. <div class="pchb-left-user-item">
  43. <div class="plui-auth">
  44. <div class="plui-auth-item">退役军人</div>
  45. <div class="plui-auth-item">
  46. <template v-if="userInfo.auditStatus === 0"
  47. >认证中</template
  48. >
  49. <template v-else-if="userInfo.auditStatus === 2"
  50. >已认证</template
  51. >
  52. <template v-else>
  53. <router-link to="/applyeducationauth">未认证</router-link>
  54. </template>
  55. </div>
  56. </div>
  57. <div class="plui-train">
  58. <div class="plui-train-item">适应性培训</div>
  59. <div class="plui-train-item">
  60. <template v-if="userInfo.adaptTrainIsPass === 1"
  61. >已通过</template
  62. >
  63. <template v-else>未通过</template>
  64. </div>
  65. </div>
  66. </div>
  67. </div>
  68. </div>
  69. </el-col>
  70. <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
  71. <div class="pchb-right">
  72. <div
  73. class="pchb-right-item"
  74. v-for="(item, index) in statisticsList"
  75. :key="index"
  76. >
  77. <p>{{ item.label }}</p>
  78. <p>{{ learnObj[item.key] || 0 }}{{ item.unit }}</p>
  79. </div>
  80. </div>
  81. </el-col>
  82. </el-row>
  83. </div>
  84. </div>
  85. <div class="app-main-box personal-center-main">
  86. <el-row :gutter="20">
  87. <el-col :xs="24" :sm="24" :md="12" :lg="16" :xl="16">
  88. <div class="personal-center-main-left">
  89. <div
  90. class="pcml-item"
  91. v-for="(item, index) in menuList"
  92. :key="index"
  93. @click="jumpPage(item.path)"
  94. >
  95. <div class="pcml-item-icon">
  96. <el-image :src="item.icon"></el-image>
  97. </div>
  98. <div class="pcml-item-label">{{ item.label }}</div>
  99. <div class="pcml-item-right">
  100. <span class="el-icon-arrow-right"></span>
  101. </div>
  102. </div>
  103. </div>
  104. </el-col>
  105. <el-col :xs="24" :sm="24" :md="12" :lg="8" :xl="8">
  106. <div class="personal-center-main-right">
  107. <!-- 附件管理 -->
  108. <div class="pcmr-top">
  109. <h4>附件管理</h4>
  110. <div class="pcmr-top-btn upload-btn">上传简历</div>
  111. <div class="pcmr-top-btn make-btn">制作简历</div>
  112. </div>
  113. <!-- 我的技能培训 -->
  114. <div class="pcmr-bottom">
  115. <h4>我的技能培训</h4>
  116. <div class="pcmr-bottom-list">
  117. <template v-if="skillTrainList.length">
  118. <div
  119. class="pcmr-bottom-list-item"
  120. v-for="(item, index) in skillTrainList"
  121. :key="index"
  122. >
  123. <div class="pbli-left">
  124. <el-image
  125. class="image"
  126. :src="
  127. item.img ||
  128. require('@/assets/images/default-news.jpg')
  129. "
  130. fit="fill"
  131. >
  132. <div slot="placeholder" class="image-slot">
  133. 加载图片中<span class="dot">...</span>
  134. </div>
  135. <div slot="error" class="image-slot">
  136. <el-image
  137. class="image"
  138. :src="require('@/assets/images/default-news.jpg')"
  139. fit="fill"
  140. ></el-image>
  141. </div>
  142. </el-image>
  143. </div>
  144. <div class="pbli-right">
  145. <div class="pbli-right-item">{{ item.name }}</div>
  146. <div class="pbli-right-item">
  147. 培训学校:{{ item.schoolName }}
  148. </div>
  149. <div class="pbli-right-item">
  150. <div>难度:</div>
  151. <div>
  152. <el-rate
  153. v-model="item.difficult"
  154. disabled
  155. text-color="#ff9900"
  156. />
  157. </div>
  158. </div>
  159. <div class="pbli-right-item">
  160. 开始时间:{{ item.applyTime }}
  161. </div>
  162. <div class="pbli-right-item">
  163. 培训周期:{{ item.cycle || 0 }}个月
  164. </div>
  165. </div>
  166. </div>
  167. </template>
  168. <template v-else>
  169. <el-empty description="列表数据为空"></el-empty>
  170. </template>
  171. </div>
  172. </div>
  173. </div>
  174. </el-col>
  175. </el-row>
  176. </div>
  177. </div>
  178. </template>
  179. <script>
  180. import {
  181. getPersonInfoData,
  182. getPersonIntegralData,
  183. getPersonStaticisData,
  184. } from "@/api/PersonalCenter";
  185. export default {
  186. name: "PersonalCenterIndex",
  187. data() {
  188. return {
  189. userInfo: {},
  190. integralTotal: 0,
  191. statisticsList: [
  192. { label: "技能培训", key: "learnTime", unit: "个" },
  193. { label: "学习时长", key: "classCount", unit: "小时" },
  194. { label: "获得面试", key: "interviewTimes", unit: "次" },
  195. ],
  196. learnObj: {},
  197. menuList: [
  198. {
  199. icon: require("@/assets/images/personal-center-icon/jianlitongguo.svg"),
  200. label: "我的简历",
  201. path: "",
  202. },
  203. {
  204. icon: require("@/assets/images/personal-center-icon/toudimoren.svg"),
  205. label: "我的投递",
  206. path: "",
  207. },
  208. {
  209. icon: require("@/assets/images/personal-center-icon/mianshi-houxuanren.svg"),
  210. label: "我的面试",
  211. path: "",
  212. },
  213. {
  214. icon: require("@/assets/images/personal-center-icon/_jiuyechuangye.svg"),
  215. label: "我的创业计划",
  216. path: "",
  217. },
  218. {
  219. icon: require("@/assets/images/personal-center-icon/jinengx.svg"),
  220. label: "我的技能培训",
  221. path: "",
  222. },
  223. {
  224. icon: require("@/assets/images/personal-center-icon/pingjia.svg"),
  225. label: "我的评价",
  226. path: "",
  227. },
  228. {
  229. icon: require("@/assets/images/personal-center-icon/shezhi.svg"),
  230. label: "设置",
  231. path: "/setting",
  232. },
  233. ],
  234. skillTrainList: [],
  235. };
  236. },
  237. created() {
  238. this.getPersonInfo();
  239. this.getPersonIntegral();
  240. this.getPersonStaticis();
  241. },
  242. methods: {
  243. /**
  244. * 获取个人信息
  245. * @date 2022-08-15
  246. * @returns {any}
  247. */
  248. getPersonInfo() {
  249. getPersonInfoData().then((res) => {
  250. if (res.code === 200) {
  251. this.userInfo = res?.data;
  252. }
  253. });
  254. },
  255. /**
  256. * 获取个人积分
  257. * @date 2022-08-15
  258. * @returns {any}
  259. */
  260. getPersonIntegral() {
  261. getPersonIntegralData().then((res) => {
  262. if (res.code === 200) {
  263. this.integralTotal = res?.data;
  264. }
  265. });
  266. },
  267. /**
  268. * 获取个人统计
  269. * @date 2022-08-15
  270. * @returns {any}
  271. */
  272. getPersonStaticis() {
  273. getPersonStaticisData().then((res) => {
  274. if (res.code === 200) {
  275. this.learnObj = res?.data;
  276. }
  277. });
  278. },
  279. /**
  280. * 跳转指定页面
  281. * @date 2022-08-22
  282. * @param {any} path
  283. * @param {any} query
  284. * @returns {any}
  285. */
  286. jumpPage(path, query) {
  287. if (path) {
  288. this.$router.push(path, query);
  289. }
  290. },
  291. },
  292. };
  293. </script>
  294. <style lang="scss" scoped>
  295. .personal-center {
  296. &-header {
  297. width: 100%;
  298. background-color: #181c1e;
  299. &-box {
  300. margin: 0 auto;
  301. .pchb-left {
  302. padding-top: 30px;
  303. display: flex;
  304. align-items: center;
  305. &-avatar {
  306. padding-top: 30px;
  307. width: 138px;
  308. height: 138px;
  309. background-color: rgba($color: #fff, $alpha: 0.7);
  310. padding: 7px;
  311. margin-right: 20px;
  312. }
  313. &-user {
  314. &-item {
  315. display: flex;
  316. .plui-username {
  317. color: #fff;
  318. font-size: 40px;
  319. margin-right: 20px;
  320. line-height: 40px;
  321. }
  322. .plui-integral {
  323. height: 40px;
  324. display: flex;
  325. justify-content: space-between;
  326. align-content: center;
  327. border: solid 3px rgba($color: #fff, $alpha: 0.4);
  328. padding: 0 14px;
  329. background-image: linear-gradient(
  330. 270deg,
  331. #ff6100 16%,
  332. #fe7c02 100%
  333. );
  334. border-radius: 40px;
  335. &-item {
  336. color: #fff;
  337. &:first-child {
  338. font-size: 11px;
  339. padding: 4px 0;
  340. }
  341. &:nth-child(2) {
  342. font-size: 30px;
  343. padding: 0 20px;
  344. }
  345. &:last-child {
  346. line-height: 40px;
  347. }
  348. }
  349. }
  350. .plui-auth,
  351. .plui-train {
  352. display: flex;
  353. align-items: center;
  354. margin-top: 20px;
  355. &-item {
  356. color: rgba($color: #fff, $alpha: 0.6);
  357. font-size: 16px;
  358. &:last-child {
  359. margin-left: 15px;
  360. background-color: rgba($color: #fff, $alpha: 0.4);
  361. padding: 5px 20px;
  362. font-size: 14px;
  363. border-radius: 14px;
  364. }
  365. a {
  366. text-decoration: none;
  367. color: rgba($color: #fff, $alpha: 0.6);
  368. }
  369. }
  370. }
  371. .plui-train {
  372. margin-left: 30px;
  373. }
  374. }
  375. }
  376. }
  377. .pchb-right {
  378. height: 160px;
  379. padding-bottom: 40px;
  380. display: flex;
  381. justify-content: flex-end;
  382. align-items: flex-end;
  383. &-item {
  384. text-align: center;
  385. margin-left: 60px;
  386. color: #fff;
  387. font-size: 18px;
  388. &:first-child {
  389. margin-left: 0;
  390. }
  391. p {
  392. font-family: PingFangSC-Regular;
  393. }
  394. p:first-child {
  395. margin-bottom: 10px;
  396. font-weight: 500;
  397. font-family: PingFangSC-Medium;
  398. }
  399. }
  400. }
  401. }
  402. }
  403. &-main {
  404. &-left {
  405. background-color: #fff;
  406. padding: 20px 20px 200px;
  407. .pcml-item {
  408. display: flex;
  409. justify-content: space-between;
  410. align-items: center;
  411. margin-bottom: 20px;
  412. border-bottom: 1px solid #d5d5d5;
  413. padding: 5px 0 15px;
  414. cursor: pointer;
  415. &-icon {
  416. width: 30px;
  417. height: 30px;
  418. margin-right: 20px;
  419. image {
  420. width: 100%;
  421. height: 100%;
  422. }
  423. }
  424. &-label {
  425. flex: 1;
  426. font-size: 20px;
  427. color: #333333;
  428. }
  429. }
  430. }
  431. &-right {
  432. .pcmr-top {
  433. background-color: #fff;
  434. padding: 20px;
  435. margin-bottom: 20px;
  436. h4 {
  437. color: #1a1a1a;
  438. font-size: 26px;
  439. font-family: SourceHanSansCN;
  440. margin-bottom: 20px;
  441. }
  442. &-btn {
  443. width: 100%;
  444. height: 52px;
  445. line-height: 52px;
  446. text-align: center;
  447. font-size: 18px;
  448. cursor: pointer;
  449. }
  450. .upload-btn {
  451. background-color: #659789;
  452. color: #fff;
  453. margin-bottom: 10px;
  454. }
  455. .make-btn {
  456. border: solid 1px #659789;
  457. color: #659789;
  458. margin-bottom: 30px;
  459. }
  460. }
  461. .pcmr-bottom {
  462. background: #fff;
  463. padding: 20px 20px 100px;
  464. h4 {
  465. color: #1a1a1a;
  466. font-size: 26px;
  467. font-family: SourceHanSansCN;
  468. margin-bottom: 20px;
  469. }
  470. &-list {
  471. &-item {
  472. display: flex;
  473. align-items: center;
  474. cursor: pointer;
  475. padding-bottom: 10px;
  476. border-bottom: 1px solid #d5d5d5;
  477. margin-bottom: 20px;
  478. .pbli-left {
  479. width: 110px;
  480. height: 104px;
  481. border: solid 1px #e0e0e0;
  482. border-radius: 5px;
  483. margin-right: 15px;
  484. .image {
  485. width: 98%;
  486. height: 100%;
  487. }
  488. }
  489. .pbli-right {
  490. &-item {
  491. color: #747474;
  492. font-size: 14px;
  493. display: flex;
  494. margin-bottom: 5px;
  495. &:first-child {
  496. font-size: 18px;
  497. color: #1a1a1a;
  498. }
  499. }
  500. }
  501. }
  502. }
  503. }
  504. }
  505. }
  506. }
  507. </style>