index.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. <template>
  2. <el-row :gutter="20">
  3. <el-col :span="24">
  4. <user-banner />
  5. </el-col>
  6. <el-col :span="24">
  7. <el-card style="margin-top: -5px; padding-top: 50px">
  8. <el-tabs v-model="activeTab" class="uc-tab" @tab-click="tabClick">
  9. <el-tab-pane label="用户信息" name="first">
  10. <update-info />
  11. </el-tab-pane>
  12. <el-tab-pane label="修改密码" name="second">
  13. <update-pass />
  14. </el-tab-pane>
  15. <el-tab-pane label="我的成绩" name="eight">
  16. <my-paper />
  17. </el-tab-pane>
  18. <el-tab-pane label="训练记录" name="third">
  19. <train-history />
  20. </el-tab-pane>
  21. <el-tab-pane label="学习记录" name="four">
  22. <my-file-learn />
  23. </el-tab-pane>
  24. <el-tab-pane label="我的问答" name="seven">
  25. <course-qa :is-mine="true" />
  26. </el-tab-pane>
  27. <!-- <el-tab-pane label="积分日志" name="six">
  28. <points-log />
  29. </el-tab-pane> -->
  30. </el-tabs>
  31. </el-card>
  32. </el-col>
  33. </el-row>
  34. </template>
  35. <script>
  36. import { mapGetters } from 'vuex'
  37. import UserBanner from './components/UserBanner'
  38. import TrainHistory from './components/TrainHistory'
  39. import PointsLog from './components/PointsLog'
  40. import MyFileLearn from '@/views/web/ucenter/components/MyFileLearn'
  41. import CourseQa from '@/views/web/course/qa'
  42. import UpdateInfo from '@/views/web/ucenter/components/UpdateInfo'
  43. import UpdatePass from '@/views/web/ucenter/components/UpdatePass'
  44. import MyPaper from '@/views/web/paper/total'
  45. export default {
  46. components: { MyPaper, UpdatePass, UpdateInfo, CourseQa, MyFileLearn, PointsLog, TrainHistory, UserBanner },
  47. data() {
  48. return {
  49. activeTab: 'first'
  50. }
  51. },
  52. computed: {
  53. ...mapGetters([
  54. 'token',
  55. 'realName'
  56. ])
  57. },
  58. created() {
  59. const active = localStorage.getItem('uc:tab:active')
  60. if (active != null && active !== '') {
  61. this.activeTab = active
  62. }
  63. },
  64. methods: {
  65. tabClick(e) {
  66. // 保存状态
  67. localStorage.setItem('uc:tab:active', e.name)
  68. }
  69. }
  70. }
  71. </script>
  72. <style scoped>
  73. .el-tab-pane{
  74. padding-top: 20px;
  75. }
  76. ::v-deep
  77. .el-tabs__item {
  78. }
  79. ::v-deep
  80. .el-tabs__nav-scroll {
  81. background: #F7F9FE;
  82. }
  83. </style>