瑶都万能墙
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.

139 lines
3.0 KiB

11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 months ago
10 months ago
11 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/product",
  49. "title": "商城",
  50. icon : 'integral',
  51. },
  52. {
  53. "selectedIconPath": "/static/image/tabbar/order-a.png",
  54. "iconPath": "/static/image/tabbar/order.png",
  55. "pagePath": "/pages/index/activity",
  56. "title": "活动",
  57. icon : 'gift',
  58. },
  59. // {
  60. // "selectedIconPath": "/static/image/tabbar/cart-a.png",
  61. // "iconPath": "/static/image/tabbar/cart.png",
  62. // "pagePath": "/pages/index/message",
  63. // "title": "消息",
  64. // icon : 'chat',
  65. // },
  66. {
  67. "selectedIconPath": "/static/image/tabbar/center-a.png",
  68. "iconPath": "/static/image/tabbar/center.png",
  69. "pagePath": "/pages/index/center",
  70. "title": "我的",
  71. icon : 'account',
  72. }
  73. ]
  74. };
  75. },
  76. methods : {
  77. toPath(item, index){
  78. if(index == this.select){
  79. return
  80. }
  81. uni.redirectTo({
  82. url: item.pagePath
  83. })
  84. },
  85. }
  86. }
  87. </script>
  88. <style scoped lang="scss">
  89. .tabbar-box{
  90. height: 120rpx;
  91. padding-bottom: env(safe-area-inset-bottom);
  92. }
  93. .tabbar{
  94. position: fixed;
  95. width: 750rpx;
  96. background-color: #fff;
  97. display: flex;
  98. justify-content: center;
  99. align-items: center;
  100. flex-direction: row;
  101. height: 120rpx;
  102. padding-bottom: env(safe-area-inset-bottom);
  103. z-index: 99;
  104. bottom: 0;
  105. left: 0;
  106. color: #BCBCBC;
  107. .item{
  108. flex: 1;
  109. display: flex;
  110. flex-direction: column;
  111. justify-content: center;
  112. align-items: center;
  113. .icon{
  114. width: 54rpx;
  115. height: 54rpx;
  116. display: flex;
  117. flex-direction: column;
  118. justify-content: center;
  119. align-items: center;
  120. .icon-image{
  121. width: 54rpx;
  122. height: 54rpx;
  123. }
  124. }
  125. .title{
  126. overflow: hidden;
  127. white-space: nowrap;
  128. text-overflow: ellipsis;
  129. -o-text-overflow: ellipsis;
  130. font-size: 23rpx;
  131. line-height: 35rpx;
  132. }
  133. }
  134. }
  135. .active{
  136. color: $uni-color !important;
  137. }
  138. </style>