工单小程序2024-11-20
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.

116 lines
2.2 KiB

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