index.vue 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. <template>
  2. <view class="page">
  3. <view class="warehouse-list">
  4. <view v-for="(warehouse, index) in warehouses" :key="index" class="warehouse-item" @click="goPage(warehouse)">
  5. <view class="warehouse-details">
  6. <view class="detail-row">
  7. <text class="label">业务时间:<text class="blackValue">{{ warehouse.emptyRooms }}</text></text>
  8. <text class="label">粮食品种:<text class="blackValue">{{ warehouse.selected ? '1个' : '0个' }}</text></text>
  9. </view>
  10. <view class="detail-row">
  11. <text class="label">检测类型:<text class="blackValue">{{ warehouse.capacity }}</text></text>
  12. <text class="label">是否合格:<text class="blackValue">{{ warehouse.rooms }}</text></text>
  13. </view>
  14. </view>
  15. </view>
  16. </view>
  17. </view>
  18. </template>
  19. <script setup>
  20. import {
  21. ref
  22. } from 'vue';
  23. const warehouses = ref([{
  24. name: '1-1',
  25. address: 'XXXXXXXXXX',
  26. capacity: '1500吨',
  27. rooms: '10个',
  28. emptyRooms: '5个',
  29. selected: false
  30. },
  31. {
  32. name: 'XXXXX',
  33. address: 'XXXXXXXXXX',
  34. capacity: '1500吨',
  35. rooms: '10个',
  36. emptyRooms: '5个',
  37. selected: false
  38. },
  39. {
  40. name: 'XXXXX',
  41. address: 'XXXXXXXXXX',
  42. capacity: '1500吨',
  43. rooms: '10个',
  44. emptyRooms: '5个',
  45. selected: false
  46. }
  47. ]);
  48. const changeTab = () => {
  49. };
  50. const selectAll = () => {
  51. warehouses.value.forEach(warehouse => {
  52. warehouse.selected = true;
  53. });
  54. };
  55. const confirmSelection = () => {
  56. // Implement confirmation logic here
  57. };
  58. const goPage = async (warehouseItem) => {
  59. uni.navigateTo({
  60. url: `/pages/infoDetails/zj/detail?caId=${warehouseItem}`
  61. });
  62. };
  63. </script>
  64. <style lang="scss" scoped>
  65. .page {
  66. position: relative; // 确保伪元素相对于 .page 定位
  67. }
  68. .page::before {
  69. content: '';
  70. position: absolute;
  71. top: 0;
  72. left: 0;
  73. width: 100%;
  74. height: 200rpx; // 设置渐变的高度
  75. background: linear-gradient(180deg, #cfddfc, #eff2f5);
  76. z-index: -1; // 确保它在内容之下
  77. }
  78. .warehouse-list {
  79. padding: 40rpx 40rpx 20rpx;
  80. .warehouse-item {
  81. border-left: 2px solid #3872E3;
  82. background: linear-gradient(180deg, #ffffff, #F5F8FF);
  83. border-radius: 10px;
  84. padding: 10px 0 10px 20px;
  85. margin-bottom: 20px;
  86. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  87. .warehouse-details {
  88. padding-top: 30rpx;
  89. font-size: 30rpx;
  90. color: #747476;
  91. .detail-row {
  92. margin-bottom: 10px;
  93. text.label{
  94. width: 50%;
  95. display: inline-flex;
  96. .blackValue{ color: #000000;}
  97. }
  98. }
  99. }
  100. }
  101. }
  102. .button-container {
  103. position: fixed;
  104. bottom: 0;
  105. background-color: #ffffff;
  106. width: 100vw;
  107. padding: 40rpx 0;
  108. .button-pad {
  109. padding: 0 40rpx;
  110. display: flex;
  111. justify-content: space-between;
  112. }
  113. .select-all,
  114. .confirm {
  115. width: 44%;
  116. height: 70rpx;
  117. line-height: 70rpx;
  118. border-radius: 10rpx;
  119. background-color: #1E5FDF;
  120. color: #fff;
  121. font-size: 28rpx;
  122. text-align: center;
  123. }
  124. }
  125. .warehouse-info{
  126. padding-top: 20rpx;
  127. }
  128. .navbar {
  129. display: flex;
  130. height: 40px;
  131. padding: 0 5px;
  132. position: relative;
  133. z-index: 10;
  134. .nav-item {
  135. flex: 1;
  136. display: flex;
  137. justify-content: center;
  138. align-items: center;
  139. height: 100%;
  140. font-size: 35rpx;
  141. position: relative;
  142. color: #334b68;
  143. &.current {
  144. color: #0f2239;
  145. &:after {
  146. content: '';
  147. position: absolute;
  148. left: 50%;
  149. bottom: 0;
  150. transform: translateX(-50%);
  151. width: 60%;
  152. height: 0;
  153. border-bottom: 4px solid #789fec;
  154. }
  155. }
  156. }
  157. }
  158. .swiper-box {
  159. height: calc(100vh - 80rpx);
  160. }
  161. .list-scroll-content {
  162. height: calc(100vh - 200rpx);
  163. }
  164. .info-scroll-content{
  165. height: calc(100vh - 120rpx);
  166. }
  167. </style>