grainDepositorLayout.vue 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. <template>
  2. <view class="container">
  3. <select-warehouse v-if="currentTab == 0"></select-warehouse>
  4. <my-warehouse v-if="currentTab == 1"></my-warehouse>
  5. <system-settings v-if="currentTab == 2"></system-settings>
  6. <!-- 底部导航栏 -->
  7. <view class="tab-bar">
  8. <view
  9. class="tab-item"
  10. :class="{ active: currentTab == 0 }"
  11. @click="switchTab(0)"
  12. >
  13. <text class="iconfont icon-xuanze" :style="{ color: currentTab === 0 ? '#1d5fdf' : '748498' }"></text>
  14. <text>选择交收库</text>
  15. </view>
  16. <view
  17. class="tab-item"
  18. :class="{ active: currentTab == 1 }"
  19. @click="switchTab(1)"
  20. >
  21. <text class="iconfont icon-cangku" :style="{ color: currentTab === 1 ? '#1d5fdf' : '748498' }"></text>
  22. <text>我的交收库</text>
  23. </view>
  24. <view
  25. class="tab-item"
  26. :class="{ active: currentTab == 2 }"
  27. @click="switchTab(2)"
  28. >
  29. <text class="iconfont icon-shezhi" :style="{ color: currentTab === 2 ? '#1d5fdf' : '748498' }"></text>
  30. <text>系统设置</text>
  31. </view>
  32. </view>
  33. </view>
  34. </template>
  35. <script setup>
  36. import SelectWarehouse from "./components/selectWarehouse.vue";
  37. import MyWarehouse from "./components/myWarehouse.vue";
  38. import SystemSettings from "@/pages/systemSet/systemSet.vue";
  39. import { ref, reactive, onMounted } from 'vue';
  40. import { onLoad } from '@dcloudio/uni-app';
  41. const currentTab = ref(0);
  42. const switchTab = (index) => {
  43. currentTab.value = index;
  44. }
  45. onLoad(async (options) => {
  46. if (options && options.tabIndex) {
  47. currentTab.value = options.tabIndex;
  48. }
  49. })
  50. </script>
  51. <style lang="scss" scoped>
  52. .container {
  53. display: flex;
  54. flex-direction: column;
  55. height: 100vh;
  56. box-sizing: border-box;
  57. background: linear-gradient(180deg, #cfddfc 0%, #eff2f5 30%);
  58. position: relative;
  59. padding-bottom: 100rpx;
  60. }
  61. .tab-bar {
  62. height: 100rpx;
  63. display: flex;
  64. background-color: #FFFFFF;
  65. border-top: 1rpx solid #BDC1C4;
  66. position: fixed;
  67. bottom: 0;
  68. left: 0;
  69. right: 0;
  70. z-index: 999;
  71. .tab-item {
  72. flex: 1;
  73. display: flex;
  74. flex-direction: column;
  75. align-items: center;
  76. justify-content: center;
  77. font-size: 24rpx;
  78. color: #738598;
  79. .iconfont{ font-size: 44rpx;}
  80. &.active {
  81. color: #1E60DC;
  82. }
  83. text {
  84. margin-top: 4rpx;
  85. }
  86. }
  87. }
  88. </style>