index.vue 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <template>
  2. <view class="tabBar" :placeholder='false'>
  3. <u-tabbar fixed style="height: 93px;" :value="tabbarValue" activeColor="#eb5a10" inactiveColor="#bdbdbd">
  4. <u-tabbar-item v-if="!isSingle" class="tabBarItem" text="企业看板" name="企业看板" @click="tabClick('企业看板')">
  5. <img class="icon" slot="active-icon" src="../../static/img/qiye-active.png" alt=""/>
  6. <img class="icon" slot="inactive-icon" src="../../static/img/qiye.png" alt=""/>
  7. </u-tabbar-item>
  8. <u-tabbar-item class="tabBarItem" text="我的看板" name="我的看板" @click="tabClick('我的看板')">
  9. <img class="icon" slot="active-icon" src="../../static/img/me-active.png" alt=""/>
  10. <img class="icon" slot="inactive-icon" src="../../static/img/me.png" alt=""/>
  11. </u-tabbar-item>
  12. <u-tabbar-item class="tabBarItem" text="分享给我" name="分享给我" @click="tabClick('分享给我')">
  13. <img class="icon" slot="active-icon" src="../../static/img/fenxiang-active.png" alt=""/>
  14. <img class="icon" slot="inactive-icon" src="../../static/img/fenxiang.png" alt=""/>
  15. </u-tabbar-item>
  16. <u-tabbar-item class="tabBarItem" text="移动应用" name="移动应用" @click="tabClick('移动应用')">
  17. <img class="icon" slot="active-icon" src="../../static/img/apps-active.png" alt=""/>
  18. <img class="icon" slot="inactive-icon" src="../../static/img/apps.png" alt=""/>
  19. </u-tabbar-item>
  20. </u-tabbar>
  21. </view>
  22. </template>
  23. <script>
  24. export default {
  25. name: "tabBar",
  26. props: {
  27. tabbarValue: {
  28. type: String,
  29. default: '',
  30. }
  31. },
  32. computed: {
  33. isSingle() {
  34. return this.$store.state.$userInfo.isSingle
  35. }
  36. },
  37. data() {
  38. return {
  39. // tabbarValue: '企业看板'
  40. };
  41. },
  42. methods: {
  43. tabClick(val) {
  44. if (val == '企业看板') {
  45. uni.reLaunch({url: '/pages/home/home'})
  46. } else if (val == '我的看板') {
  47. uni.reLaunch({url: '/pages/home/me'})
  48. } else if (val == '分享给我') {
  49. uni.reLaunch({url: '/pages/home/share'})
  50. } else if (val == '移动应用') {
  51. uni.reLaunch({url: '/pages/home/apps'})
  52. }
  53. }
  54. }
  55. }
  56. </script>
  57. <style lang="less">
  58. .tabBar {
  59. width: 100%;
  60. height: 186rpx;
  61. background-color: #fff;
  62. .tabBarItem {
  63. height: 186rpx;
  64. .icon {
  65. width: 50rpx;
  66. height: 50rpx;
  67. }
  68. }
  69. }
  70. ::v-deep .u-tabbar__content__item-wrapper {
  71. height: 186rpx !important;
  72. }
  73. </style>