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.

167 lines
3.4 KiB

9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 months ago
9 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="'/static/tabbar/' + (index + 1) + '.png'" 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. "list": [
  67. {
  68. "pagePath": "/pages/home/home",
  69. "title": "tabbar.title.1"
  70. },
  71. {
  72. "pagePath": "/pages/order/order",
  73. "title": "tabbar.title.2"
  74. },
  75. {
  76. "pagePath": "/pages/starting/starting",
  77. "title": "tabbar.title.3"
  78. },
  79. {
  80. "title": "tabbar.title.4"
  81. },
  82. {
  83. "pagePath": "/pages/center/center",
  84. "title": "tabbar.title.5"
  85. }
  86. ]
  87. }
  88. },
  89. methods: {
  90. toPath(item, index){
  91. if(index == this.select){
  92. return
  93. }
  94. if(!item.pagePath){
  95. return
  96. }
  97. this.$play()
  98. uni.redirectTo({
  99. url: item.pagePath
  100. })
  101. },
  102. }
  103. }
  104. </script>
  105. <style scoped lang="scss">
  106. .list{
  107. position: fixed;
  108. width: 100vw;
  109. background-color: #000;
  110. display: flex;
  111. justify-content: center;
  112. align-items: center;
  113. height: 120rpx;
  114. z-index: 999;
  115. font-size: 20rpx;
  116. bottom: 0;
  117. left: 0;
  118. line-height: 50rpx;
  119. color: #fff;
  120. box-shadow: 0px 0rpx 10rpx 10rpx #00000022;
  121. width: 750rpx;
  122. font-weight: 500;
  123. .item:nth-child(2){
  124. // .icon{
  125. // .icon-image{
  126. // width: 95rpx;
  127. // height: 95rpx;
  128. // margin-top: -55rpx;
  129. // }
  130. // }
  131. }
  132. .item{
  133. flex: 1;
  134. display: flex;
  135. flex-direction: column;
  136. justify-content: center;
  137. align-items: center;
  138. .icon{
  139. width: 100%;
  140. height: 50%;
  141. display: flex;
  142. justify-content: center;
  143. align-items: center;
  144. .icon-image{
  145. width: 45rpx;
  146. height: 45rpx;
  147. }
  148. }
  149. .icon-image{
  150. width: 100%;
  151. height: 50%;
  152. }
  153. .title{
  154. overflow:hidden;
  155. white-space: nowrap;
  156. text-overflow: ellipsis;
  157. -o-text-overflow:ellipsis;
  158. }
  159. }
  160. }
  161. .active{
  162. color: rgb(92, 173, 255) !important;
  163. }
  164. </style>