warehouse.vue 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276
  1. <template>
  2. <view class="page">
  3. <view class="navbar">
  4. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  5. :class="{current: tabCurrentIndex === index}" @click="tabClick(index)">
  6. {{item.text}}
  7. </view>
  8. </view>
  9. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300" @change="changeTab">
  10. <swiper-item class="tab-content">
  11. <scroll-view class="list-scroll-content" scroll-y>
  12. <view class="warehouse-list">
  13. <view v-for="(warehouse, index) in warehouses" :key="index" class="warehouse-item">
  14. <view class="warehouse-header">
  15. <view class="info-container">
  16. <view class="warehouse-name">
  17. <image src="../../static/icons/warehouse-ico.png" mode="widthFix"></image>
  18. <text>仓房名称:{{ warehouse.name }}</text>
  19. </view>
  20. </view>
  21. <view class="select-button">
  22. <checkbox :checked="warehouse.selected" @change="toggleSelection(index)"></checkbox>
  23. </view>
  24. </view>
  25. <view class="warehouse-details">
  26. <view class="detail-row">
  27. <text>仓库类型: {{ warehouse.emptyRooms }}</text>
  28. <text>仓库状态: {{ warehouse.selected ? '1个' : '0个' }}</text>
  29. </view>
  30. <view class="detail-row">
  31. <text>设计仓容: {{ warehouse.capacity }}</text>
  32. <text>是否空仓: {{ warehouse.rooms }}</text>
  33. </view>
  34. <view class="detail-row">
  35. <text>租仓参考价: {{ warehouse.emptyRooms }}</text>
  36. <text>委托保管参考价: {{ warehouse.selected ? '1个' : '0个' }}</text>
  37. </view>
  38. </view>
  39. </view>
  40. </view>
  41. </scroll-view>
  42. <view class="button-container">
  43. <view class="button-pad">
  44. <button class="select-all" @click="selectAll">全选</button>
  45. <button class="confirm" @click="confirmSelection">确 认</button>
  46. </view>
  47. </view>
  48. </swiper-item>
  49. <swiper-item class="tab-content">
  50. <scroll-view class="info-scroll-content" scroll-y>
  51. <view class="warehouse-info">
  52. <warehouse-info></warehouse-info>
  53. </view>
  54. </scroll-view>
  55. </swiper-item>
  56. </swiper>
  57. </view>
  58. </template>
  59. <script setup>
  60. import warehouseInfo from "./components/warehouseInfo/warehouseInfo.vue";
  61. import {
  62. ref
  63. } from 'vue';
  64. const navList = [{
  65. state: 0,
  66. text: '仓房基本信息',
  67. loadingType: 'more',
  68. orderList: []
  69. },
  70. {
  71. state: 1,
  72. text: '库区基本信息',
  73. loadingType: 'more',
  74. orderList: []
  75. }
  76. ]
  77. const tabCurrentIndex = ref(0)
  78. const tabClick = (index) => {
  79. tabCurrentIndex.value = index;
  80. }
  81. const warehouses = ref([{
  82. name: '1-1',
  83. address: 'XXXXXXXXXX',
  84. capacity: '1500吨',
  85. rooms: '10个',
  86. emptyRooms: '5个',
  87. selected: false
  88. },
  89. {
  90. name: 'XXXXX',
  91. address: 'XXXXXXXXXX',
  92. capacity: '1500吨',
  93. rooms: '10个',
  94. emptyRooms: '5个',
  95. selected: false
  96. },
  97. {
  98. name: 'XXXXX',
  99. address: 'XXXXXXXXXX',
  100. capacity: '1500吨',
  101. rooms: '10个',
  102. emptyRooms: '5个',
  103. selected: false
  104. }
  105. ]);
  106. const toggleSelection = (index) => {
  107. warehouses.value[index].selected = !warehouses.value[index].selected;
  108. };
  109. const selectAll = () => {
  110. warehouses.value.forEach(warehouse => {
  111. warehouse.selected = true;
  112. });
  113. };
  114. const confirmSelection = () => {
  115. // Implement confirmation logic here
  116. };
  117. </script>
  118. <style lang="scss" scoped>
  119. .page {
  120. position: relative; // 确保伪元素相对于 .page 定位
  121. }
  122. .page::before {
  123. content: '';
  124. position: absolute;
  125. top: 0;
  126. left: 0;
  127. width: 100%;
  128. height: 200rpx; // 设置渐变的高度
  129. background: linear-gradient(180deg, #cfddfc, #eff2f5);
  130. z-index: -1; // 确保它在内容之下
  131. }
  132. .warehouse-list {
  133. padding: 40rpx 40rpx 20rpx;
  134. .warehouse-item {
  135. background: linear-gradient(180deg, #ffffff, #F5F8FF);
  136. border-radius: 10px;
  137. padding: 20px;
  138. margin-bottom: 20px;
  139. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  140. .warehouse-header {
  141. display: flex;
  142. justify-content: space-between;
  143. align-items: flex-start; // 对齐到顶部
  144. padding-bottom: 30rpx;
  145. border-bottom: 1px solid #E7E8EA;
  146. font-size: 35rpx;
  147. color: #00122F;
  148. .info-container {
  149. flex-grow: 1;
  150. .warehouse-name,
  151. .warehouse-address {
  152. display: flex;
  153. align-items: center;
  154. margin-bottom: 5px;
  155. &:last-child {
  156. margin-bottom: 0;
  157. }
  158. image {
  159. width: 20px;
  160. height: 20px;
  161. margin-right: 10px;
  162. }
  163. }
  164. }
  165. .select-button {
  166. display: flex;
  167. align-items: flex-start;
  168. margin-left: 10px;
  169. }
  170. }
  171. .warehouse-details {
  172. padding-top: 30rpx;
  173. font-size: 30rpx;
  174. color: #747476;
  175. .detail-row {
  176. display: flex;
  177. justify-content: space-between;
  178. margin-bottom: 10px;
  179. }
  180. }
  181. }
  182. }
  183. .button-container {
  184. position: fixed;
  185. bottom: 0;
  186. background-color: #ffffff;
  187. width: 100vw;
  188. padding: 40rpx 0;
  189. .button-pad {
  190. padding: 0 40rpx;
  191. display: flex;
  192. justify-content: space-between;
  193. }
  194. .select-all,
  195. .confirm {
  196. width: 44%;
  197. height: 70rpx;
  198. line-height: 70rpx;
  199. border-radius: 10rpx;
  200. background-color: #1E5FDF;
  201. color: #fff;
  202. font-size: 28rpx;
  203. text-align: center;
  204. }
  205. }
  206. .warehouse-info{
  207. padding-top: 20rpx;
  208. }
  209. .navbar {
  210. display: flex;
  211. height: 40px;
  212. padding: 0 5px;
  213. position: relative;
  214. z-index: 10;
  215. .nav-item {
  216. flex: 1;
  217. display: flex;
  218. justify-content: center;
  219. align-items: center;
  220. height: 100%;
  221. font-size: 35rpx;
  222. position: relative;
  223. color: #334b68;
  224. &.current {
  225. color: #0f2239;
  226. &:after {
  227. content: '';
  228. position: absolute;
  229. left: 50%;
  230. bottom: 0;
  231. transform: translateX(-50%);
  232. width: 60%;
  233. height: 0;
  234. border-bottom: 4px solid #789fec;
  235. }
  236. }
  237. }
  238. }
  239. .swiper-box {
  240. height: calc(100vh - 80rpx);
  241. }
  242. .list-scroll-content {
  243. height: calc(100vh - 200rpx);
  244. }
  245. .info-scroll-content{
  246. height: calc(100vh - 120rpx);
  247. }
  248. </style>