index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. <template>
  2. <u-tabbar :value="value" :list="tabbar_list" active-color="#4076D6" inactive-color="#B8C0C8" :border-top="false">
  3. </u-tabbar>
  4. </template>
  5. <script>
  6. import indexIcon from '../../static/Tar_bar_slices/index.png'
  7. import indexIconFill from '../../static/Tar_bar_slices/index-fill.png'
  8. import orderIcon from '../../static/Tar_bar_slices/order.png'
  9. import orderIconFill from '../../static/Tar_bar_slices/order-fill.png'
  10. import goodsIcon from '../../static/Tar_bar_slices/goods.png'
  11. import goodsIconFill from '../../static/Tar_bar_slices/goods-fill.png'
  12. import userIcon from '../../static/Tar_bar_slices/user.png'
  13. import userIconFill from '../../static/Tar_bar_slices/user-fill.png'
  14. import myIcon from '../../static/Tar_bar_slices/my.png'
  15. import myIconFill from '../../static/Tar_bar_slices/my-fill.png'
  16. export default {
  17. model: {
  18. props: 'value'
  19. },
  20. props: {
  21. value: {
  22. type: Number,
  23. default: 0
  24. }
  25. },
  26. computed: {
  27. tabbar_list() {
  28. let roleType = uni.getStorageSync('roleType')
  29. if (roleType == 2) {
  30. return [{
  31. iconPath: indexIcon,
  32. selectedIconPath: indexIconFill,
  33. text: '工作台',
  34. customIcon: false,
  35. pagePath: '/pages/index/index'
  36. }, {
  37. iconPath: userIcon,
  38. selectedIconPath: userIconFill,
  39. text: '客户',
  40. customIcon: false,
  41. pagePath: '/pages/customer/CustomerList'
  42. },
  43. {
  44. iconPath: myIcon,
  45. selectedIconPath: myIconFill,
  46. text: '我的',
  47. customIcon: false,
  48. pagePath: '/pages/user/index'
  49. }
  50. ]
  51. }else {
  52. return [{
  53. iconPath: indexIcon,
  54. selectedIconPath: indexIconFill,
  55. text: '工作台',
  56. customIcon: false,
  57. pagePath: '/pages/index/index'
  58. },
  59. {
  60. iconPath: orderIcon,
  61. selectedIconPath: orderIconFill,
  62. text: '订单',
  63. customIcon: false,
  64. pagePath: '/pages/order/index'
  65. },
  66. {
  67. iconPath: goodsIcon,
  68. selectedIconPath: goodsIconFill,
  69. text: '商品',
  70. customIcon: false,
  71. pagePath: '/pages/goods/index'
  72. },
  73. {
  74. iconPath: userIcon,
  75. selectedIconPath: userIconFill,
  76. text: '客户',
  77. customIcon: false,
  78. pagePath: '/pages/customer/CustomerList'
  79. },
  80. {
  81. iconPath: myIcon,
  82. selectedIconPath: myIconFill,
  83. text: '我的',
  84. customIcon: false,
  85. pagePath: '/pages/user/index'
  86. }
  87. ];
  88. }
  89. }
  90. }
  91. };
  92. </script>
  93. <style>
  94. .u-tabbar__content__item__text .u-line-1 {
  95. font-size: 20rpx !important;
  96. }
  97. </style>