shopAccount.vue 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. <template>
  2. <div class="shopInfo">
  3. <el-row class="order_tab">
  4. <el-col :span="15">
  5. <div class="tab_list">
  6. <div class="tab_item" @click="changeTabs(i)" :class="{'tab_item_ac':tab_ac==i?true:false}"
  7. v-for="(item,i) in tab_list" :key="i">
  8. <span>{{item.name}}</span>
  9. <div class="tab_line"></div>
  10. </div>
  11. </div>
  12. </el-col>
  13. </el-row>
  14. <el-row class="content">
  15. <component :is="activeName"></component>
  16. </el-row>
  17. </div>
  18. </template>
  19. <script>
  20. import wallet from './accountCompoents/wallet.vue'
  21. export default {
  22. name: 'HelloWorld',
  23. components: {
  24. wallet
  25. },
  26. data() {
  27. return {
  28. activeName: 'wallet',
  29. tab_list: [
  30. {name: '我的钱包', index: 0},
  31. {name: '优惠券', index: 1},
  32. {name: '充值明细', index: 2},
  33. {name: '消费明细', index: 3}
  34. ],
  35. tab_ac: 0,
  36. }
  37. },
  38. methods: {
  39. changeTabs(i) {
  40. this.tab_ac = i;
  41. switch(i) {
  42. case 0:
  43. this.activeName = 'wallet';
  44. break;
  45. case 1:
  46. this.activeName = 'coupon';
  47. break;
  48. case 2:
  49. this.activeName = 'recharge';
  50. break;
  51. case 3:
  52. this.activeName = 'consumption';
  53. break;
  54. }
  55. }
  56. },
  57. mounted() {
  58. }
  59. }
  60. </script>
  61. <!-- Add "scoped" attribute to limit CSS to this component only -->
  62. <style scoped lang="scss">
  63. .shopInfo {
  64. .order_tab {
  65. width: 100%;
  66. height: 74px;
  67. background: #FFF;
  68. .tab_list {
  69. width: 100%;
  70. height: 74px;
  71. padding-top: 20px;
  72. padding-left: 36px;
  73. box-sizing: border-box;
  74. display: flex;
  75. .tab_item {
  76. min-width: 58px;
  77. margin-right: 56px;
  78. font-size: 16px;
  79. font-weight: 500;
  80. color: #B1B1B1;
  81. position: relative;
  82. text-align: center;
  83. cursor: pointer;
  84. .tab_line {
  85. width: 58px;
  86. height: 6px;
  87. background: #FFF;
  88. border-radius: 3px;
  89. margin: 15px auto 0;
  90. }
  91. }
  92. .tab_item_ac {
  93. color: #FC7200;
  94. .tab_line {
  95. background: #FC7200;
  96. }
  97. }
  98. }
  99. }
  100. .content {
  101. width: 100%;
  102. margin-top: 10px;
  103. padding: 20px;
  104. box-sizing: border-box;
  105. background: #FFF;
  106. }
  107. }
  108. </style>