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

108 lines
2.1 KiB

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. 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. </view>
  16. <view class="title">
  17. {{ 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/home-a.png",
  36. "iconPath": "/static/image/tabbar/home.png",
  37. "pagePath": "/pages/index/index",
  38. "title": "首页"
  39. },
  40. {
  41. "selectedIconPath": "/static/image/tabbar/center-a.png",
  42. "iconPath": "/static/image/tabbar/center.png",
  43. "pagePath": "/pages/index/center",
  44. "title": "我的"
  45. }
  46. ]
  47. };
  48. },
  49. methods : {
  50. toPath(item, index){
  51. if(index == this.select){
  52. return
  53. }
  54. uni.reLaunch({
  55. url: item.pagePath
  56. })
  57. },
  58. }
  59. }
  60. </script>
  61. <style scoped lang="scss">
  62. .tabbar-box{
  63. height: 120rpx;
  64. padding-bottom: env(safe-area-inset-bottom);
  65. }
  66. .tabbar{
  67. position: fixed;
  68. width: 750rpx;
  69. background-color: #fff;
  70. display: flex;
  71. justify-content: center;
  72. align-items: center;
  73. flex-direction: row;
  74. height: 120rpx;
  75. padding-bottom: env(safe-area-inset-bottom);
  76. z-index: 999999;
  77. bottom: 0;
  78. left: 0;
  79. color: #BCBCBC;
  80. .item{
  81. flex: 1;
  82. display: flex;
  83. flex-direction: column;
  84. justify-content: center;
  85. align-items: center;
  86. .icon{
  87. width: 54rpx;
  88. height: 54rpx;
  89. .icon-image{
  90. width: 54rpx;
  91. height: 54rpx;
  92. }
  93. }
  94. .title{
  95. overflow: hidden;
  96. white-space: nowrap;
  97. text-overflow: ellipsis;
  98. -o-text-overflow: ellipsis;
  99. font-size: 23rpx;
  100. line-height: 35rpx;
  101. }
  102. }
  103. }
  104. .active{
  105. color: $uni-color !important;
  106. }
  107. </style>