beixWarehouse.vue 6.0 KB

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