selfRenwList.vue 4.8 KB

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