warehouseList.vue 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <view class="page">
  3. <view class="warehouse-list">
  4. <view v-for="(warehouse, index) in warehouses" :key="index" class="warehouse-item">
  5. <view class="warehouse-header">
  6. <view class="info-container">
  7. <view class="warehouse-name">
  8. <image src="../../static/icons/warehouse-ico.png" mode="widthFix"></image>
  9. <text>仓房名称:{{ warehouse.name }}</text>
  10. </view>
  11. </view>
  12. <view class="select-button">
  13. <checkbox :checked="warehouse.selected" @change="toggleSelection(index)"></checkbox>
  14. </view>
  15. </view>
  16. <view class="warehouse-details">
  17. <view class="detail-row">
  18. <text>仓库类型: {{ warehouse.emptyRooms }}</text>
  19. <text>仓库状态: {{ warehouse.selected ? '1个' : '0个' }}</text>
  20. </view>
  21. <view class="detail-row">
  22. <text>设计仓容: {{ warehouse.capacity }}</text>
  23. <text>是否空仓: {{ warehouse.rooms }}</text>
  24. </view>
  25. <view class="detail-row">
  26. <text>租仓参考价: {{ warehouse.emptyRooms }}</text>
  27. <text>委托保管参考价: {{ warehouse.selected ? '1个' : '0个' }}</text>
  28. </view>
  29. </view>
  30. </view>
  31. </view>
  32. <view class="button-container">
  33. <view class="button-pad">
  34. <button class="select-all" @click="selectAll">全选</button>
  35. <button class="confirm" @click="confirmSelection">确 认</button>
  36. </view>
  37. </view>
  38. </view>
  39. </template>
  40. <script setup>
  41. import { ref } from 'vue';
  42. const warehouses = ref([
  43. { name: '1-1', address: 'XXXXXXXXXX', capacity: '1500吨', rooms: '10个', emptyRooms: '5个', selected: false },
  44. { name: 'XXXXX', address: 'XXXXXXXXXX', capacity: '1500吨', rooms: '10个', emptyRooms: '5个', selected: false },
  45. { name: 'XXXXX', address: 'XXXXXXXXXX', capacity: '1500吨', rooms: '10个', emptyRooms: '5个', selected: false }
  46. ]);
  47. const toggleSelection = (index) => {
  48. warehouses.value[index].selected = !warehouses.value[index].selected;
  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. </script>
  59. <style lang="scss" scoped>
  60. .page {
  61. position: relative; // 确保伪元素相对于 .page 定位
  62. }
  63. .page::before {
  64. content: '';
  65. position: absolute;
  66. top: 0;
  67. left: 0;
  68. width: 100%;
  69. height: 200rpx; // 设置渐变的高度
  70. background: linear-gradient(180deg, #cfddfc, #eff2f5);
  71. z-index: -1; // 确保它在内容之下
  72. }
  73. .filter-icon-container {
  74. position: relative;
  75. float: right;
  76. top: 20rpx;
  77. right: 40rpx;
  78. image {
  79. width: 40rpx;
  80. height: 40rpx;
  81. }
  82. }
  83. .warehouse-list {
  84. padding: 80rpx 40rpx 20rpx;
  85. .warehouse-item {
  86. background: linear-gradient(180deg, #ffffff, #F5F8FF);
  87. border-radius: 10px;
  88. padding: 20px;
  89. margin-bottom: 20px;
  90. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  91. .warehouse-header {
  92. display: flex;
  93. justify-content: space-between;
  94. align-items: flex-start; // 对齐到顶部
  95. padding-bottom: 30rpx;
  96. border-bottom: 1px solid #E7E8EA;
  97. font-size: 35rpx;
  98. color: #00122F;
  99. .info-container {
  100. flex-grow: 1;
  101. .warehouse-name,
  102. .warehouse-address {
  103. display: flex;
  104. align-items: center;
  105. margin-bottom: 5px;
  106. &:last-child {
  107. margin-bottom: 0;
  108. }
  109. image {
  110. width: 20px;
  111. height: 20px;
  112. margin-right: 10px;
  113. }
  114. }
  115. }
  116. .select-button {
  117. display: flex;
  118. align-items: flex-start;
  119. margin-left: 10px;
  120. }
  121. }
  122. .warehouse-details {
  123. padding-top: 30rpx;
  124. font-size: 30rpx;
  125. color: #747476;
  126. .detail-row {
  127. display: flex;
  128. justify-content: space-between;
  129. margin-bottom: 10px;
  130. }
  131. }
  132. }
  133. }
  134. .button-container {
  135. position: fixed;
  136. bottom: 0;
  137. background-color: #ffffff;
  138. width: 100vw;
  139. padding: 40rpx 0;
  140. .button-pad{
  141. padding: 0 40rpx;
  142. display: flex;
  143. justify-content: space-between;
  144. }
  145. .select-all,
  146. .confirm {
  147. width: 44%;
  148. height: 70rpx;
  149. line-height: 70rpx;
  150. border-radius: 10rpx;
  151. background-color: #1E5FDF;
  152. color: #fff;
  153. font-size: 28rpx;
  154. text-align: center;
  155. }
  156. }
  157. </style>