warehouse.vue 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281
  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 changeTab = () => {
  110. };
  111. const selectAll = () => {
  112. warehouses.value.forEach(warehouse => {
  113. warehouse.selected = true;
  114. });
  115. };
  116. const confirmSelection = () => {
  117. // Implement confirmation logic here
  118. };
  119. </script>
  120. <style lang="scss" scoped>
  121. .page {
  122. position: relative; // 确保伪元素相对于 .page 定位
  123. }
  124. .page::before {
  125. content: '';
  126. position: absolute;
  127. top: 0;
  128. left: 0;
  129. width: 100%;
  130. height: 200rpx; // 设置渐变的高度
  131. background: linear-gradient(180deg, #cfddfc, #eff2f5);
  132. z-index: -1; // 确保它在内容之下
  133. }
  134. .warehouse-list {
  135. padding: 40rpx 40rpx 20rpx;
  136. .warehouse-item {
  137. background: linear-gradient(180deg, #ffffff, #F5F8FF);
  138. border-radius: 10px;
  139. padding: 20px;
  140. margin-bottom: 20px;
  141. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  142. .warehouse-header {
  143. display: flex;
  144. justify-content: space-between;
  145. align-items: flex-start; // 对齐到顶部
  146. padding-bottom: 30rpx;
  147. border-bottom: 1px solid #E7E8EA;
  148. font-size: 35rpx;
  149. color: #00122F;
  150. .info-container {
  151. flex-grow: 1;
  152. .warehouse-name,
  153. .warehouse-address {
  154. display: flex;
  155. align-items: center;
  156. margin-bottom: 5px;
  157. &:last-child {
  158. margin-bottom: 0;
  159. }
  160. image {
  161. width: 20px;
  162. height: 20px;
  163. margin-right: 10px;
  164. }
  165. }
  166. }
  167. .select-button {
  168. display: flex;
  169. align-items: flex-start;
  170. margin-left: 10px;
  171. }
  172. }
  173. .warehouse-details {
  174. padding-top: 30rpx;
  175. font-size: 30rpx;
  176. color: #747476;
  177. .detail-row {
  178. display: flex;
  179. justify-content: space-between;
  180. margin-bottom: 10px;
  181. }
  182. }
  183. }
  184. }
  185. .button-container {
  186. position: fixed;
  187. bottom: 0;
  188. background-color: #ffffff;
  189. width: 100vw;
  190. padding: 40rpx 0;
  191. .button-pad {
  192. padding: 0 40rpx;
  193. display: flex;
  194. justify-content: space-between;
  195. }
  196. .select-all,
  197. .confirm {
  198. width: 44%;
  199. height: 70rpx;
  200. line-height: 70rpx;
  201. border-radius: 10rpx;
  202. background-color: #1E5FDF;
  203. color: #fff;
  204. font-size: 28rpx;
  205. text-align: center;
  206. }
  207. }
  208. .warehouse-info{
  209. padding-top: 20rpx;
  210. }
  211. .navbar {
  212. display: flex;
  213. height: 40px;
  214. padding: 0 5px;
  215. position: relative;
  216. z-index: 10;
  217. .nav-item {
  218. flex: 1;
  219. display: flex;
  220. justify-content: center;
  221. align-items: center;
  222. height: 100%;
  223. font-size: 35rpx;
  224. position: relative;
  225. color: #334b68;
  226. &.current {
  227. color: #0f2239;
  228. &:after {
  229. content: '';
  230. position: absolute;
  231. left: 50%;
  232. bottom: 0;
  233. transform: translateX(-50%);
  234. width: 60%;
  235. height: 0;
  236. border-bottom: 4px solid #789fec;
  237. }
  238. }
  239. }
  240. }
  241. .swiper-box {
  242. height: calc(100vh - 80rpx);
  243. }
  244. .list-scroll-content {
  245. height: calc(100vh - 200rpx);
  246. }
  247. .info-scroll-content{
  248. height: calc(100vh - 120rpx);
  249. }
  250. </style>