infoDetailsLayout.vue 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122
  1. <template>
  2. <view class="container">
  3. <hwk :baseInfo="hwkInfo" v-if="currentTab == 0"></hwk>
  4. <crk :kqInfo="1" v-if="currentTab == 1"></crk>
  5. <zj :kqInfo="1" v-if="currentTab == 2"></zj>
  6. <lqjc :kqInfo="1" v-if="currentTab == 3"></lqjc>
  7. <sy :kqInfo="1" v-if="currentTab == 4"></sy>
  8. <!-- 底部导航栏 -->
  9. <view class="tab-bar">
  10. <view
  11. class="tab-item"
  12. :class="{ active: currentTab == 0 }"
  13. @click="switchTab(0)"
  14. >
  15. <text class="iconfont icon-huoweika" :style="{ color: currentTab === 0 ? '#1d5fdf' : '748498' }"></text>
  16. <text>货位卡</text>
  17. </view>
  18. <view
  19. class="tab-item"
  20. :class="{ active: currentTab == 1 }"
  21. @click="switchTab(1)"
  22. >
  23. <text class="iconfont icon-churuku" :style="{ color: currentTab === 1 ? '#1d5fdf' : '748498' }"></text>
  24. <text>出入库</text>
  25. </view>
  26. <view
  27. class="tab-item"
  28. :class="{ active: currentTab == 2 }"
  29. @click="switchTab(2)"
  30. >
  31. <text class="iconfont icon-zhijiandaibanrenwu" :style="{ color: currentTab === 2 ? '#1d5fdf' : '748498' }"></text>
  32. <text>质检</text>
  33. </view>
  34. <view
  35. class="tab-item"
  36. :class="{ active: currentTab == 3 }"
  37. @click="switchTab(3)"
  38. >
  39. <text class="iconfont icon-liangqingjiance" :style="{ color: currentTab === 3 ? '#1d5fdf' : '748498' }"></text>
  40. <text>粮情监测</text>
  41. </view>
  42. <view
  43. class="tab-item"
  44. :class="{ active: currentTab == 4 }"
  45. @click="switchTab(4)"
  46. >
  47. <text class="iconfont icon-sunyi" :style="{ color: currentTab === 4 ? '#1d5fdf' : '748498' }"></text>
  48. <text>损益</text>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script setup>
  54. import hwk from "./hwk/index.vue";
  55. import crk from "./crk/index.vue";
  56. import zj from "./zj/index.vue";
  57. import lqjc from "./lqjc/index.vue";
  58. import sy from "./sy/index.vue";
  59. import { ref, reactive, onMounted } from 'vue';
  60. import { onLoad } from '@dcloudio/uni-app';
  61. import { getInfoByCfId } from "@/api/grainDepositor";
  62. const currentTab = ref(0);
  63. const caId = ref("");
  64. const hwkInfo = ref({})
  65. const switchTab = (index) => {
  66. currentTab.value = index;
  67. }
  68. onLoad(async (options) => {
  69. if (options && options.caId) {
  70. caId.value = options.caId
  71. hwkInfo.value = await getInfoByCfId(caId.value);
  72. }
  73. })
  74. </script>
  75. <style lang="scss" scoped>
  76. .container {
  77. display: flex;
  78. flex-direction: column;
  79. height: 100vh;
  80. box-sizing: border-box;
  81. background: linear-gradient(180deg, #cfddfc 0%, #eff2f5 30%);
  82. position: relative;
  83. padding-bottom: 100rpx;
  84. }
  85. .tab-bar {
  86. height: 100rpx;
  87. display: flex;
  88. background-color: #FFFFFF;
  89. border-top: 1rpx solid #BDC1C4;
  90. position: fixed;
  91. bottom: 0;
  92. left: 0;
  93. right: 0;
  94. z-index: 999;
  95. .tab-item {
  96. flex: 1;
  97. display: flex;
  98. flex-direction: column;
  99. align-items: center;
  100. justify-content: center;
  101. font-size: 24rpx;
  102. color: #738598;
  103. .iconfont{ font-size: 44rpx;}
  104. &.active {
  105. color: #1E60DC;
  106. }
  107. text {
  108. margin-top: 4rpx;
  109. }
  110. }
  111. }
  112. </style>