铝交易,微信公众号
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.

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