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