PersonalCenterIndex.vue 16 KB

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