微信

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <template>
  2. <div class="mainPage flex-v">
  3. <div class="subPage flex-item">
  4. <div>
  5. <router-view></router-view>
  6. </div>
  7. </div>
  8. <nav class="flex-h">
  9. <router-link :to="{name:item.pathName,query:{}}" v-if="showTabBar" class="flex-item" active-class="active" v-for="(item, index) in tabBar" :key="index">
  10. <div>
  11. <img v-if="index==0" class="centerLabel" src="../../../common/icon/tabBar-icon-1.png" alt="">
  12. <img v-if="index==1" class="centerLabel" src="../../../common/icon/tabBar-icon-2.png" alt="">
  13. <img v-if="index==2" class="centerLabel" src="../../../common/icon/tabBar-icon-3.png" alt="">
  14. </div>
  15. <span>{{item.name}}</span>
  16. </router-link>
  17. </nav>
  18. </div>
  19. </template>
  20. <script>
  21. import { mapState } from 'vuex'
  22. export default {
  23. name: '',
  24. data () {
  25. return {
  26. tabBar: [{
  27. pathName: 'indexPage',
  28. name: '城的空间'
  29. }, {
  30. pathName: 'coffeeIndex',
  31. name: '城咖啡'
  32. }, {
  33. pathName: 'userCenter',
  34. name: '会员'
  35. }],
  36. showTabBar: false
  37. }
  38. },
  39. computed: {
  40. ...mapState({
  41. userInfo: x => x.userCenter.userInfo
  42. })
  43. },
  44. components: {
  45. },
  46. created () {
  47. if (!this.userInfo.customer.MapUser || !this.$route.query.hideTabbar) {
  48. this.showTabBar = true
  49. }
  50. },
  51. methods: {
  52. }
  53. }
  54. </script>
  55. <!-- Add "scoped" attribute to limit CSS to this component only -->
  56. <style lang="scss" scoped>
  57. @import 'page.scss';
  58. </style>