index.vue 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <mobile-frame>
  3. <view class="main">
  4. <view class="one">
  5. <view class="one_1" v-if="barActive=='0'">
  6. 微店首页
  7. </view>
  8. <view class="one_2" v-else-if="barActive=='1'">
  9. 商品分类
  10. </view>
  11. <view class="one_3" v-else-if="barActive=='2'">
  12. 全部商品
  13. </view>
  14. <view class="one_4" v-else-if="barActive=='3'">
  15. 店铺简介
  16. </view>
  17. </view>
  18. <view class="two">
  19. <view class="list" v-for="(item,index) in barList" :key="index" @tap="barChange(index,item)">
  20. <view class="icon">
  21. <text :class="['iconfont',barActive==index?item.acticon:item.icon]"></text>
  22. </view>
  23. <view :class="['name',barActive==index?'activename':'']">
  24. {{item.name}}
  25. </view>
  26. </view>
  27. </view>
  28. </view>
  29. </mobile-frame>
  30. </template>
  31. <script>
  32. export default {
  33. data() {
  34. return {
  35. barActive: '0',
  36. barList: [ //底部菜单
  37. {
  38. icon: 'icon-shangdian',
  39. acticon: "icon-shangdian-copy",
  40. name: '微店首页'
  41. }, {
  42. icon: 'icon-fenlei',
  43. acticon: "icon-fenlei-copy",
  44. name: '商品分类'
  45. }, {
  46. icon: 'icon-shangpinfenlei',
  47. acticon: "icon-shangpinfenlei-copy",
  48. name: '全部商品'
  49. }, {
  50. icon: 'icon-qiyejianjie',
  51. acticon: "icon-qiyejianjie-copy",
  52. name: '店铺简介'
  53. }
  54. ]
  55. };
  56. },
  57. onShow: function() {},
  58. methods: {
  59. // 选择底部菜单
  60. barChange(index, item) {
  61. const that = this;
  62. that.$set(that, `barActive`, index);
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="scss">
  68. .main {
  69. display: flex;
  70. flex-direction: column;
  71. width: 100vw;
  72. height: 100vh;
  73. .one {
  74. position: relative;
  75. flex-grow: 1;
  76. }
  77. .two {
  78. display: flex;
  79. flex-direction: row;
  80. justify-content: space-around;
  81. border-top: 1px solid #f1f1f1;
  82. .list {
  83. padding: 1vw 0;
  84. text-align: center;
  85. .icon {}
  86. .name {
  87. font-size: 12px;
  88. }
  89. .activename {
  90. color: var(--fFB1Color);
  91. }
  92. }
  93. }
  94. }
  95. </style>