daixjgk.vue 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view class="page">
  3. <view class="filter-icon-container">
  4. <image @click="toggle('top')" src="../../static/icons/shaix-ico.png"></image>
  5. </view>
  6. <view class="warehouse-list">
  7. <view v-for="(warehouse, index) in warehouses" :key="index" class="warehouse-item">
  8. <view class="warehouse-header">
  9. <view class="info-container">
  10. <view class="warehouse-name">
  11. <image src="../../static/icons/warehouse-ico.png" mode="widthFix"></image>
  12. <text>库区名称:{{ warehouse.name }}</text>
  13. </view>
  14. <view class="warehouse-address">
  15. <image src="../../static/icons/location-ico.png" mode="widthFix"></image>
  16. <text>库区地址:{{ warehouse.address }}</text>
  17. </view>
  18. </view>
  19. <view class="select-button">
  20. <checkbox :checked="warehouse.selected" @change="toggleSelection(index)"></checkbox>
  21. </view>
  22. </view>
  23. <view class="warehouse-details">
  24. <view class="detail-row">
  25. <text>库区空仓仓容: {{ warehouse.capacity }}</text>
  26. <text>仓房数量: {{ warehouse.rooms }}</text>
  27. </view>
  28. <view class="detail-row">
  29. <text>空仓数量: {{ warehouse.emptyRooms }}</text>
  30. <text>已选仓房数量: {{ warehouse.selected ? '1个' : '0个' }}</text>
  31. </view>
  32. </view>
  33. </view>
  34. </view>
  35. <view class="button-container">
  36. <view class="button-pad">
  37. <button class="select-all" @click="selectAll">全选</button>
  38. <button class="confirm" @click="confirmSelection">确 认</button>
  39. </view>
  40. </view>
  41. <view>
  42. <!-- 普通弹窗 -->
  43. <uni-popup ref="popup" background-color="#fff" @change="change" border-radius="10px 10px 0 0">
  44. <view class="popup-content" :class="{ 'popup-height': type === 'left' || type === 'right' }"><text
  45. class="text">popup 内容1</text></view>
  46. </uni-popup>
  47. </view>
  48. </view>
  49. </template>
  50. <script setup>
  51. import { ref, reactive } from 'vue';
  52. const warehouses = ref([
  53. { name: 'XXXXX', address: 'XXXXXXXXXX', capacity: '1500吨', rooms: '10个', emptyRooms: '5个', selected: false },
  54. { name: 'XXXXX', address: 'XXXXXXXXXX', capacity: '1500吨', rooms: '10个', emptyRooms: '5个', selected: false },
  55. { name: 'XXXXX', address: 'XXXXXXXXXX', capacity: '1500吨', rooms: '10个', emptyRooms: '5个', selected: false }
  56. ]);
  57. const toggleSelection = (index) => {
  58. warehouses.value[index].selected = !warehouses.value[index].selected;
  59. };
  60. const selectAll = () => {
  61. warehouses.value.forEach(warehouse => {
  62. warehouse.selected = true;
  63. });
  64. };
  65. const confirmSelection = () => {
  66. // Implement confirmation logic here
  67. };
  68. // 定义响应式数据
  69. const state = reactive({
  70. type: 'center',
  71. msgType: 'success',
  72. messageText: '这是一条成功提示',
  73. showClose: true,
  74. });
  75. const popup = ref(null);
  76. const toggle = (type) => {
  77. state.type = type;
  78. // open 方法传入参数 等同在 uni-popup 组件上绑定 type属性
  79. popup.value.open(type);
  80. };
  81. </script>
  82. <style lang="scss" scoped>
  83. .page {
  84. position: relative; // 确保伪元素相对于 .page 定位
  85. }
  86. .page::before {
  87. content: '';
  88. position: absolute;
  89. top: 0;
  90. left: 0;
  91. width: 100%;
  92. height: 200rpx; // 设置渐变的高度
  93. background: linear-gradient(180deg, #cfddfc, #eff2f5);
  94. z-index: -1; // 确保它在内容之下
  95. }
  96. .filter-icon-container {
  97. position: relative;
  98. float: right;
  99. top: 20rpx;
  100. right: 40rpx;
  101. image {
  102. width: 40rpx;
  103. height: 40rpx;
  104. }
  105. }
  106. .warehouse-list {
  107. padding: 80rpx 40rpx 20rpx;
  108. .warehouse-item {
  109. background: linear-gradient(180deg, #ffffff, #F5F8FF);
  110. border-radius: 10px;
  111. padding: 20px;
  112. margin-bottom: 20px;
  113. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  114. .warehouse-header {
  115. display: flex;
  116. justify-content: space-between;
  117. align-items: flex-start; // 对齐到顶部
  118. padding-bottom: 30rpx;
  119. border-bottom: 1px solid #E7E8EA;
  120. font-size: 35rpx;
  121. color: #00122F;
  122. .info-container {
  123. flex-grow: 1;
  124. .warehouse-name,
  125. .warehouse-address {
  126. display: flex;
  127. align-items: center;
  128. margin-bottom: 5px;
  129. &:last-child {
  130. margin-bottom: 0;
  131. }
  132. image {
  133. width: 20px;
  134. height: 20px;
  135. margin-right: 10px;
  136. }
  137. }
  138. }
  139. .select-button {
  140. display: flex;
  141. align-items: flex-start;
  142. margin-left: 10px;
  143. }
  144. }
  145. .warehouse-details {
  146. padding-top: 30rpx;
  147. font-size: 30rpx;
  148. color: #747476;
  149. .detail-row {
  150. display: flex;
  151. justify-content: space-between;
  152. margin-bottom: 10px;
  153. }
  154. }
  155. }
  156. }
  157. .button-container {
  158. position: fixed;
  159. bottom: 0;
  160. background-color: #ffffff;
  161. width: 100vw;
  162. padding: 40rpx 0;
  163. .button-pad{
  164. padding: 0 40rpx;
  165. display: flex;
  166. justify-content: space-between;
  167. }
  168. .select-all,
  169. .confirm {
  170. width: 44%;
  171. height: 70rpx;
  172. line-height: 70rpx;
  173. border-radius: 10rpx;
  174. background-color: #1E5FDF;
  175. color: #fff;
  176. font-size: 28rpx;
  177. text-align: center;
  178. }
  179. }
  180. </style>