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.

141 lines
2.9 KiB

10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
  1. <template>
  2. <view class="list bx popup-bx">
  3. <view
  4. :class="{item : true, active : select == index}"
  5. @click="toPath(item, index)"
  6. v-for="(item, index) in list">
  7. <view class="icon">
  8. <image :src="select == index ? item.selectedIconPath : item.iconPath" class="icon-image" mode=""></image>
  9. </view>
  10. <view class="title">
  11. {{ $t(item.title) }}
  12. </view>
  13. </view>
  14. </view>
  15. </template>
  16. <!-- "tabBar": {
  17. "backgroundColor": "white",
  18. "selectedColor": "#cd0000",
  19. "list": [
  20. {
  21. "selectedIconPath": "/static/tabbar/2.png",
  22. "iconPath": "/static/tabbar/1.png",
  23. "pagePath": "pages/home/home",
  24. "text": "%tabbar.title.1%"
  25. },{
  26. "selectedIconPath": "/static/tabbar/4.png",
  27. "iconPath": "/static/tabbar/3.png",
  28. "pagePath": "pages/cart/cart",
  29. "text": "%tabbar.title.2%"
  30. },{
  31. "selectedIconPath": "/static/tabbar/6.png",
  32. "iconPath": "/static/tabbar/5.png",
  33. "pagePath": "pages/order/order",
  34. "text": "%tabbar.title.3%"
  35. }
  36. ]
  37. } -->
  38. <script>
  39. export default {
  40. props : ['select'],
  41. data() {
  42. return {
  43. "list": [
  44. {
  45. "selectedIconPath": "/static/tabbar/2.png",
  46. "iconPath": "/static/tabbar/1.png",
  47. "pagePath": "/pages/home/home",
  48. "title": "tabbar.title.1"
  49. },{
  50. "selectedIconPath": "/static/tabbar/4.png",
  51. "iconPath": "/static/tabbar/3.png",
  52. "pagePath": "/pages/prizeDraw/prizeDraw",
  53. "title": "tabbar.title.2"
  54. },{
  55. "selectedIconPath": "/static/tabbar/6.png",
  56. "iconPath": "/static/tabbar/5.png",
  57. "pagePath": "/pages/order/order",
  58. "title": "tabbar.title.3"
  59. },{
  60. "selectedIconPath": "/static/tabbar/8.png",
  61. "iconPath": "/static/tabbar/7.png",
  62. "pagePath": "/pages/center/center",
  63. "title": "tabbar.title.4"
  64. }
  65. ]
  66. }
  67. },
  68. methods: {
  69. toPath(item, index){
  70. if(index == this.select){
  71. return
  72. }
  73. this.$play()
  74. uni.redirectTo({
  75. url: item.pagePath
  76. })
  77. },
  78. }
  79. }
  80. </script>
  81. <style scoped lang="scss">
  82. .list{
  83. position: fixed;
  84. width: 100vw;
  85. background-color: #fff;
  86. display: flex;
  87. justify-content: center;
  88. align-items: center;
  89. height: 120rpx;
  90. z-index: 999;
  91. font-size: 20rpx;
  92. bottom: 0;
  93. left: 0;
  94. line-height: 50rpx;
  95. color: #000;
  96. box-shadow: 0px 0rpx 10rpx 10rpx #00000022;
  97. width: 750rpx;
  98. .item:nth-child(2){
  99. // .icon{
  100. // .icon-image{
  101. // width: 95rpx;
  102. // height: 95rpx;
  103. // margin-top: -55rpx;
  104. // }
  105. // }
  106. }
  107. .item{
  108. flex: 1;
  109. display: flex;
  110. flex-direction: column;
  111. justify-content: center;
  112. align-items: center;
  113. .icon{
  114. width: 100%;
  115. height: 50%;
  116. display: flex;
  117. justify-content: center;
  118. align-items: center;
  119. .icon-image{
  120. width: 40rpx;
  121. height: 40rpx;
  122. }
  123. }
  124. .icon-image{
  125. width: 100%;
  126. height: 50%;
  127. }
  128. .title{
  129. overflow:hidden;
  130. white-space: nowrap;
  131. text-overflow: ellipsis;
  132. -o-text-overflow:ellipsis;
  133. }
  134. }
  135. }
  136. .active{
  137. color: #000 !important;
  138. font-weight: 900;
  139. }
  140. </style>