PersonalCenterIndex.vue 17 KB

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