shopInfo.vue 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  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. <el-col :span="24">
  16. <component :is="activeName"></component>
  17. </el-col>
  18. </el-row>
  19. </div>
  20. </template>
  21. <script>
  22. import shopList from './shopCompoents/shopList';
  23. import storeList from './shopCompoents/bindTakeOut.vue';
  24. import deliveryList from './shopCompoents/bindDelivery.vue';
  25. import printerList from './shopCompoents/bindPrinter.vue';
  26. export default {
  27. name: 'HelloWorld',
  28. components: {
  29. shopList,
  30. storeList,
  31. deliveryList,
  32. printerList
  33. },
  34. data() {
  35. return {
  36. activeName: 'shopList',
  37. tab_list: [
  38. {name: '门店管理', index: 0},
  39. {name: '绑定外卖平台', index: 1},
  40. {name: '绑定配送平台', index: 2},
  41. {name: '绑定打印机', index: 3}
  42. ],
  43. tab_ac: 0,
  44. }
  45. },
  46. methods: {
  47. changeTabs(i) {
  48. this.tab_ac = i;
  49. switch(i) {
  50. case 0:
  51. this.activeName = 'shopList';
  52. break;
  53. case 1:
  54. this.activeName = 'storeList';
  55. break;
  56. case 2:
  57. this.activeName = 'deliveryList';
  58. break;
  59. case 3:
  60. this.activeName = 'printerList';
  61. break;
  62. default:
  63. this.activeName = 'shopList';
  64. break;
  65. }
  66. }
  67. },
  68. mounted() {
  69. }
  70. }
  71. </script>
  72. <!-- Add "scoped" attribute to limit CSS to this component only -->
  73. <style scoped lang="scss">
  74. .shopInfo {
  75. .order_tab {
  76. width: 100%;
  77. height: 74px;
  78. background: #FFF;
  79. .tab_list {
  80. width: 100%;
  81. height: 74px;
  82. padding-top: 20px;
  83. padding-left: 36px;
  84. box-sizing: border-box;
  85. display: flex;
  86. .tab_item {
  87. min-width: 58px;
  88. margin-right: 56px;
  89. font-size: 16px;
  90. font-weight: 500;
  91. color: #B1B1B1;
  92. position: relative;
  93. text-align: center;
  94. cursor: pointer;
  95. .tab_line {
  96. width: 58px;
  97. height: 6px;
  98. background: #FFF;
  99. border-radius: 3px;
  100. margin: 15px auto 0;
  101. }
  102. }
  103. .tab_item_ac {
  104. color: #FC7200;
  105. .tab_line {
  106. background: #FC7200;
  107. }
  108. }
  109. }
  110. }
  111. .content {
  112. width: 100%;
  113. margin-top: 10px;
  114. }
  115. }
  116. </style>