filter.vue 7.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323
  1. <template>
  2. <view class="page">
  3. <view class="filter-wrap">
  4. <view class="filter-content">
  5. <view class="filter-header">
  6. <view class="navbar">
  7. <view v-for="(item, index) in navList" :key="index" class="nav-item"
  8. :class="{current: tabCurrentIndex === index}" @click="tabClick(index)">
  9. {{item.text}}
  10. </view>
  11. </view>
  12. <uni-icons class="delIcons" type="trash-filled" size="30"></uni-icons>
  13. </view>
  14. <swiper :current="tabCurrentIndex" class="swiper-box" duration="300">
  15. <swiper-item class="tab-content">
  16. <scroll-view class="list-scroll-content" scroll-y>
  17. <view class="address-list">
  18. <view class="address-city">
  19. <uni-data-checkbox multiple v-model="cityValue" :localdata="cityList" class="checkbox-item"></uni-data-checkbox>
  20. </view>
  21. <view class="address-county">
  22. <uni-data-checkbox multiple v-model="cityValue" :localdata="cityList" class="checkbox-item"></uni-data-checkbox>
  23. </view>
  24. </view>
  25. </scroll-view>
  26. </swiper-item>
  27. <swiper-item class="tab-content">
  28. <scroll-view class="info-scroll-content" scroll-y>
  29. <view class="warehouse-info">
  30. <!-- 基础用法,不包含校验规则 -->
  31. <uni-forms ref="baseForm" :model="baseFormData" label-align="right" labelWidth="120px">
  32. <uni-forms-item label="企业名称">
  33. <uni-easyinput v-model="baseFormData.name" placeholder="请输入企业名称" />
  34. </uni-forms-item>
  35. <uni-forms-item label="仓房类型">
  36. <uni-data-select v-model="baseFormData.skills" :localdata="skillsRange" >
  37. </uni-data-select>
  38. </uni-forms-item>
  39. <uni-forms-item label="仓房状态">
  40. <uni-data-select v-model="baseFormData.skills" :localdata="skillsRange" >
  41. </uni-data-select>
  42. </uni-forms-item>
  43. <uni-forms-item label="空仓数量">
  44. <uni-row>
  45. <uni-col :span="20">
  46. <uni-easyinput v-model="baseFormData.name" placeholder="请输入空仓数量" />
  47. </uni-col>
  48. <uni-col :span="4">个</uni-col>
  49. </uni-row>
  50. </uni-forms-item>
  51. <uni-forms-item label="库区空仓仓容">
  52. <uni-row>
  53. <uni-col :span="9">
  54. <uni-easyinput v-model="baseFormData.minEmptyCapacity" placeholder="最小值" />
  55. </uni-col>
  56. <uni-col :span="2"><text>-</text></uni-col>
  57. <uni-col :span="9">
  58. <uni-easyinput v-model="baseFormData.maxEmptyCapacity" placeholder="最大值" />
  59. </uni-col>
  60. <uni-col :span="4">吨</uni-col>
  61. </uni-row>
  62. </uni-forms-item>
  63. <uni-forms-item label="仓房仓容">
  64. <uni-row>
  65. <uni-col :span="9">
  66. <uni-easyinput v-model="baseFormData.minEmptyCapacity" placeholder="最小值" />
  67. </uni-col>
  68. <uni-col :span="2">-</uni-col>
  69. <uni-col :span="9">
  70. <uni-easyinput v-model="baseFormData.maxEmptyCapacity" placeholder="最大值" />
  71. </uni-col>
  72. <uni-col :span="4">吨</uni-col>
  73. </uni-row>
  74. </uni-forms-item>
  75. </uni-forms>
  76. </view>
  77. </scroll-view>
  78. </swiper-item>
  79. </swiper>
  80. </view>
  81. </view>
  82. <view class="button-container">
  83. <view class="button-pad">
  84. <button class="confirm" @click="confirmSelection">确认筛选</button>
  85. </view>
  86. </view>
  87. </view>
  88. </template>
  89. <script setup>
  90. import { ref, reactive } from 'vue';
  91. const navList = [{
  92. state: 0,
  93. text: '行政区划',
  94. loadingType: 'more',
  95. orderList: []
  96. },
  97. {
  98. state: 1,
  99. text: '其他条件',
  100. loadingType: 'more',
  101. orderList: []
  102. }
  103. ]
  104. const tabCurrentIndex = ref(0)
  105. const tabClick = (index) => {
  106. tabCurrentIndex.value = index;
  107. }
  108. const cityValue = ref([0]);
  109. const cityList = ref([
  110. { text: '朝阳区', value: 0 },
  111. { text: '昌平区', value: 1 },
  112. { text: '海淀区', value: 2 },
  113. { text: '丰台区', value: 3 },
  114. { text: '丰台区1', value: 4 },
  115. { text: '丰台区1', value: 5 },
  116. { text: '丰台区1', value: 6 },
  117. ]);
  118. // 基础表单数据
  119. const baseFormData = reactive({
  120. name: '',
  121. skills: 0,
  122. minEmptyCapacity: '',
  123. maxEmptyCapacity: '',
  124. });
  125. const skillsRange = ref([{
  126. value: 0,
  127. text: "编程"
  128. },
  129. {
  130. value: 1,
  131. text: "绘画"
  132. },
  133. {
  134. value: 2,
  135. text: "运动"
  136. },
  137. ])
  138. const confirmSelection = () => {
  139. // Implement confirmation logic here
  140. };
  141. const goFilterPage = () => {
  142. uni.navigateTo({
  143. url: '/pages/filter/filter' // 注意路径前的斜杠
  144. });
  145. };
  146. </script>
  147. <style lang="scss" scoped>
  148. .page {
  149. position: relative; // 确保伪元素相对于 .page 定位
  150. }
  151. .page::before {
  152. content: '';
  153. position: absolute;
  154. top: 0;
  155. left: 0;
  156. width: 100%;
  157. height: 200rpx; // 设置渐变的高度
  158. background: linear-gradient(180deg, #cfddfc, #eff2f5);
  159. z-index: -1; // 确保它在内容之下
  160. }
  161. .filter-wrap {
  162. padding: 80rpx 40rpx 20rpx;
  163. .filter-content {
  164. background: linear-gradient(180deg, #ffffff, #F5F8FF);
  165. border-radius: 10px;
  166. margin-bottom: 20px;
  167. box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  168. .filter-header{
  169. display: flex;
  170. justify-content: space-between;
  171. border-bottom: 1rpx solid #E0E6F0;
  172. }
  173. .delIcons{ margin: 10px 10px 0 0;}
  174. .navbar {
  175. width: 60%;
  176. display: flex;
  177. height: 50px;
  178. padding: 0 5px;
  179. position: relative;
  180. z-index: 10;
  181. .nav-item {
  182. flex: 1;
  183. display: flex;
  184. justify-content: center;
  185. align-items: center;
  186. height: 100%;
  187. font-size: 35rpx;
  188. position: relative;
  189. color: #334b68;
  190. &.current {
  191. color: #1E5FDF;
  192. &:after {
  193. content: '';
  194. position: absolute;
  195. left: 50%;
  196. bottom: 0;
  197. transform: translateX(-50%);
  198. width: 40%;
  199. height: 0;
  200. border-bottom: 4px solid #1E5FDF;
  201. border-radius: 5px;
  202. }
  203. }
  204. }
  205. }
  206. .address-list{
  207. display: flex;
  208. .address-city,
  209. .address-county {
  210. flex: 1;
  211. box-sizing: border-box;
  212. }
  213. }
  214. .address-city {
  215. border-right: 1px solid #E0DEF3;
  216. min-height: 1050rpx;
  217. padding: 15rpx 0;
  218. display: flex;
  219. flex-wrap: wrap;
  220. gap: 0.5rem;
  221. .checkbox-item {
  222. font-size: 32rpx;
  223. flex: 1 1 100%;
  224. box-sizing: border-box;
  225. padding-left: 30rpx;
  226. }
  227. }
  228. .address-county{
  229. padding: 15rpx 0;
  230. display: flex;
  231. flex-wrap: wrap;
  232. gap: 0.5rem;
  233. .checkbox-item {
  234. font-size: 32rpx;
  235. flex: 1 1 100%;
  236. box-sizing: border-box;
  237. padding-left: 30rpx;
  238. }
  239. }
  240. .warehouse-info{
  241. margin: 30rpx 35rpx 10rpx 0;
  242. }
  243. }
  244. }
  245. .button-container {
  246. position: fixed;
  247. bottom: 0;
  248. background-color: #ffffff;
  249. width: 100vw;
  250. padding: 40rpx 0;
  251. .button-pad{
  252. padding: 0 40rpx;
  253. display: flex;
  254. justify-content: space-between;
  255. }
  256. .confirm {
  257. width: 88%;
  258. height: 70rpx;
  259. line-height: 70rpx;
  260. border-radius: 10rpx;
  261. background-color: #1E5FDF;
  262. color: #fff;
  263. font-size: 28rpx;
  264. text-align: center;
  265. }
  266. }
  267. </style>
  268. <style lang="scss">
  269. .filter-wrap{
  270. .swiper-box{ min-height: 1050rpx;}
  271. .uni-data-checklist .checklist-group .checklist-box{
  272. margin: 15rpx 0 !important;
  273. }
  274. .uni-data-checklist .checklist-group .checklist-box .checklist-content .checklist-text{
  275. font-size: 34rpx;
  276. }
  277. .uni-forms-item__label{
  278. font-size: 30rpx;
  279. }
  280. .uni-forms-item__content{
  281. .uni-col-4{
  282. text-align: right;
  283. line-height: 35px;
  284. }
  285. .uni-col-2{
  286. text-align: center;
  287. line-height: 35px;
  288. }
  289. }
  290. }
  291. </style>