User.vue 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. <template>
  2. <div style="width: 100vw;">
  3. <div class="content flex">
  4. <div class="left-nav">
  5. <div class="nav-item hand" v-for="(item,index) in navList" @click="navto(item.path)"
  6. :class="{'action-item':currentUrl.indexOf(item.path) !=-1}">
  7. {{item.tit}}
  8. </div>
  9. </div>
  10. <div class="right-body">
  11. <router-view></router-view>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import {
  18. mapState,
  19. mapMutations
  20. } from 'vuex';
  21. export default {
  22. name: 'user',
  23. data() {
  24. return {
  25. navList: [{
  26. tit: '基本信息',
  27. path: '/user/setUserinfo'
  28. },
  29. {
  30. tit: '资金流水',
  31. path: '/user/money'
  32. },
  33. {
  34. tit: '充值记录',
  35. path: '/user/rechangeList'
  36. },
  37. {
  38. tit: '提现记录',
  39. path: '/user/takingList'
  40. },
  41. {
  42. tit: '转账记录',
  43. path: '/user/transferList'
  44. }
  45. ]
  46. }
  47. },
  48. computed: {
  49. ...mapState(['userInfo', 'baseInfo']),
  50. currentUrl() {
  51. return this.$route.path
  52. },
  53. },
  54. methods: {
  55. navto(path) {
  56. this.$router.push(path)
  57. }
  58. },
  59. mounted() {
  60. if (this.userInfo.agent_id == 1) {
  61. this.navList.splice(1, 0, {
  62. tit: '注册码',
  63. path: '/user/regList'
  64. }, );
  65. this.navList.splice(1, 0, {
  66. tit: '用户管理',
  67. path: '/user/userAdmin'
  68. }, );
  69. } else {
  70. this.navList.splice(1, 0, {
  71. tit: 'Token',
  72. path: '/user/tokenOrderList'
  73. }, );
  74. this.navList.splice(2, 0, {
  75. tit: '结算申请',
  76. path: '/user/jssq'
  77. }, );
  78. }
  79. }
  80. }
  81. </script>
  82. <style lang="scss" scoped>
  83. .content {
  84. width: 1425px;
  85. max-width: 1425px;
  86. margin: auto;
  87. }
  88. .left-nav {
  89. padding-top: 25px;
  90. width: 120px;
  91. height: 710px;
  92. flex-shrink: 0;
  93. .nav-item {
  94. height: 50px;
  95. line-height: 50px;
  96. margin-bottom: 20px;
  97. text-align: center;
  98. }
  99. .action-item {
  100. color: #007aff;
  101. border-right: #007aff 2px solid;
  102. font-weight: bold;
  103. }
  104. }
  105. .right-body {
  106. flex-grow: 1;
  107. max-width: 1240px;
  108. margin-left: 25px;
  109. }
  110. </style>