瑶都万能墙
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
2.8 KiB

4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
4 months ago
  1. <template>
  2. <view class="">
  3. <view class="tabbar-box"></view>
  4. <view class="tabbar">
  5. <view
  6. :class="{item : true, active : select == index}"
  7. v-for="(item, index) in list"
  8. :key="index"
  9. v-if="!item.isNotShop || !userShop"
  10. @click="toPath(item, index)">
  11. <view class="icon">
  12. <!-- <image :src="select == index ?
  13. item.selectedIconPath :
  14. item.iconPath" class="icon-image" mode=""></image> -->
  15. <uv-icon
  16. size="54rpx"
  17. :color="select == index ? '#5baaff' : '#BCBCBC'"
  18. :name="item.icon"></uv-icon>
  19. </view>
  20. <view class="title">
  21. {{ item.title }}
  22. </view>
  23. </view>
  24. </view>
  25. </view>
  26. </template>
  27. <script>
  28. import { mapGetters } from 'vuex'
  29. export default {
  30. name:"tabbar",
  31. props : ['select'],
  32. computed : {
  33. ...mapGetters(['userShop']),
  34. },
  35. data() {
  36. return {
  37. list : [
  38. {
  39. "selectedIconPath": "/static/image/tabbar/home-a.png",
  40. "iconPath": "/static/image/tabbar/home.png",
  41. "pagePath": "/pages/index/index",
  42. "title": "首页",
  43. icon : 'home',
  44. },
  45. {
  46. "selectedIconPath": "/static/image/tabbar/order-a.png",
  47. "iconPath": "/static/image/tabbar/order.png",
  48. "pagePath": "/pages/index/activity",
  49. "title": "活动",
  50. icon : 'gift',
  51. },
  52. // {
  53. // "selectedIconPath": "/static/image/tabbar/cart-a.png",
  54. // "iconPath": "/static/image/tabbar/cart.png",
  55. // "pagePath": "/pages/index/message",
  56. // "title": "消息",
  57. // icon : 'chat',
  58. // },
  59. {
  60. "selectedIconPath": "/static/image/tabbar/center-a.png",
  61. "iconPath": "/static/image/tabbar/center.png",
  62. "pagePath": "/pages/index/center",
  63. "title": "我的",
  64. icon : 'account',
  65. }
  66. ]
  67. };
  68. },
  69. methods : {
  70. toPath(item, index){
  71. if(index == this.select){
  72. return
  73. }
  74. uni.redirectTo({
  75. url: item.pagePath
  76. })
  77. },
  78. }
  79. }
  80. </script>
  81. <style scoped lang="scss">
  82. .tabbar-box{
  83. height: 120rpx;
  84. padding-bottom: env(safe-area-inset-bottom);
  85. }
  86. .tabbar{
  87. position: fixed;
  88. width: 750rpx;
  89. background-color: #fff;
  90. display: flex;
  91. justify-content: center;
  92. align-items: center;
  93. flex-direction: row;
  94. height: 120rpx;
  95. padding-bottom: env(safe-area-inset-bottom);
  96. z-index: 99;
  97. bottom: 0;
  98. left: 0;
  99. color: #BCBCBC;
  100. .item{
  101. flex: 1;
  102. display: flex;
  103. flex-direction: column;
  104. justify-content: center;
  105. align-items: center;
  106. .icon{
  107. width: 54rpx;
  108. height: 54rpx;
  109. display: flex;
  110. flex-direction: column;
  111. justify-content: center;
  112. align-items: center;
  113. .icon-image{
  114. width: 54rpx;
  115. height: 54rpx;
  116. }
  117. }
  118. .title{
  119. overflow: hidden;
  120. white-space: nowrap;
  121. text-overflow: ellipsis;
  122. -o-text-overflow: ellipsis;
  123. font-size: 23rpx;
  124. line-height: 35rpx;
  125. }
  126. }
  127. }
  128. .active{
  129. color: $uni-color !important;
  130. }
  131. </style>