app-footer.vue 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. <template>
  2. <div id="deFooter" class="de-footer">
  3. <div class="btn-list-wrap">
  4. <div class="btn_list" v-for="(item, index) in btnData" :key="index" @click="pageTo(item)" v-show="item.judge()">
  5. <div class="btn_blo active" v-if="index == activeIndex">
  6. <div class="btn-img-wrap">
  7. <img class="btn_img" :src="constant.imgUrl + item.activeImg" alt mode="widthFix" />
  8. </div>
  9. <div class="btn_text">{{ item.text }}</div>
  10. <!-- <img class="btn_img" :src="constant.imgUrl + item.activeImg" alt mode="widthFix" /> -->
  11. </div>
  12. <div class="btn_blo" v-else>
  13. <div class="btn-img-wrap">
  14. <img class="btn_img" :src="constant.imgUrl + item.img" alt mode="widthFix" />
  15. </div>
  16. <div class="btn_text">{{ item.text }}</div>
  17. </div>
  18. </div>
  19. </div>
  20. </div>
  21. </template>
  22. <script>
  23. import { mapGetters, mapState } from 'vuex'
  24. import { jumpShop } from '@/utils/common'
  25. export default {
  26. name: 'Defooter',
  27. components: {},
  28. props: {
  29. activeIndex: {
  30. type: Number,
  31. default: 0
  32. }
  33. },
  34. data() {
  35. return {
  36. constant: this.$constant,
  37. btnData: [
  38. {
  39. text: '首页',
  40. url: '/pages/home/index',
  41. img: 'common/tool_no.png',
  42. activeImg: 'common/tool_is.png',
  43. judge: () => true
  44. },
  45. {
  46. text: '分类',
  47. url: '/pages/category/index',
  48. img: 'common/tool_no.png',
  49. activeImg: 'common/tool_is.png',
  50. judge: () => true
  51. },
  52. {
  53. text: '门店',
  54. url: '/pages/shop/index',
  55. img: 'common/member_no.png',
  56. activeImg: 'common/member_is.png',
  57. judge: () => true
  58. },
  59. {
  60. text: '我的',
  61. url: '/pages/center/index',
  62. img: 'common/center_no.png',
  63. activeImg: 'common/center_is.png',
  64. judge: () => true
  65. }
  66. ]
  67. }
  68. },
  69. computed: {
  70. ...mapGetters({ userInfo: 'getUser' })
  71. },
  72. mounted() {
  73. },
  74. methods: {}
  75. }
  76. </script>
  77. <style scoped lang="scss">
  78. .de-footer {
  79. // height: 100%;
  80. position: fixed;
  81. left: 0;
  82. bottom: 0;
  83. display: flex;
  84. align-items: center;
  85. width: 100%;
  86. height: 100px;
  87. background-color: #fff;
  88. box-shadow: -1px -1px 10px #cccccc; /*no*/
  89. z-index: 100;
  90. .btn-list-wrap {
  91. width: 100%;
  92. @include disFlex(center, space-around);
  93. .btn_list {
  94. width: 30%;
  95. }
  96. .btn_blo {
  97. color: $fontColor3;
  98. .btn-img-wrap {
  99. width: 44px !important;
  100. margin: 0 auto;
  101. }
  102. .btn_img {
  103. width: 100%;
  104. height: auto;
  105. }
  106. .btn_text {
  107. transform: scale(0.8);
  108. text-align: center;
  109. }
  110. }
  111. .active {
  112. .btn_text {
  113. color: $mainColor;
  114. }
  115. }
  116. }
  117. }
  118. </style>