daixjgk.vue 5.3 KB

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