Browse Source

筛选条件整理

xiaohaizhao 1 year ago
parent
commit
64a5455b49

+ 4 - 0
components/Yl_HeadNav/index.js

@@ -8,6 +8,10 @@ Component({
             type: String,
             value: "default", //默认样式
         },
+        showFiltrate: {
+            type: Boolean,
+            value: false
+        },
         sort: {
             type: Array
         }, //排序规则列表

+ 0 - 1
components/Yl_HeadNav/index.scss

@@ -145,7 +145,6 @@
         display: flex;
         align-items: center;
         font-size: 28rpx;
-        width: 438rpx;
         height: 58rpx;
         border-radius: 29rpx;
         background: #F4F5F7;

+ 3 - 4
components/Yl_HeadNav/index.wxml

@@ -10,15 +10,14 @@
     </navigator>
 </view>
 <view class="Yl_head_1" wx:else>
-    <view class="search">
-        <view class="iconfont icon-a-sousuolansousuo" style="padding-left:20rpx;margin-right: 10rpx;" />
+    <view class="search" style="width: {{showFiltrate?'438rpx':'560rpx'}};">
+        <view class="iconfont icon-a-sousuolansousuo" style="padding-left:20rpx;margin-right: 10rpx; " />
         <input class="input" value="{{condition}}" bindconfirm="confirmSearch" type="text" placeholder="{{placeholder}}" style="flex: 1;" />
         <navigator wx:if="{{condition}}" bindtap="endSearch" url="#" class="iconfont icon-quxiao" />
     </view>
     <navigator url="#" class="but" bindtap="onChick1" data-id="sort"><text class="iconfont icon-shengxu"></text>排序</navigator>
-    <navigator url="#" class="but" bindtap="onChick1" data-id="filtrate"><text class="iconfont icon-shaixuan"></text>筛选</navigator>
+    <navigator wx:if="{{showFiltrate}}" url="#" class="but" bindtap="onChick1" data-id="filtrate"><text class="iconfont icon-shaixuan"></text>筛选</navigator>
 </view>
-
 <van-transition show="{{ startUsing }}" custom-class="block">
     <van-search custom-class='Yl_search' value="{{ condition }}" bindfocus='onFocus' bind:blur='onBlur' shape="round" placeholder="请输入搜索关键词" bind:search='startSearch' bind:clear='endSearch' />
     <view class="Yl_history" wx:if="{{record}}">

+ 1 - 1
packageA/betweenFee/index.wxml

@@ -1,6 +1,6 @@
 <import src="index.skeleton.wxml" />
 <template is="skeleton" wx:if="{{loading}}" />
-<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
+<Yl_HeadNav styleType="1" showFiltrate sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
 <!-- <van-tabs active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
     <van-tab title="全部" />
     <van-tab title="新建" />

+ 0 - 23
packageA/borrow/index.js

@@ -18,23 +18,6 @@ Page({
             },
             sort: []
         },
-        filter: [{
-            label: "品牌",
-            index: null,
-            showName: "brandname", //显示字段
-            valueKey: "brandname", //返回Key
-            selectKey: "brandname", //传参 代表选着字段 不传参返回整个选择对象
-            value: "", //选中值
-            list: []
-        }, {
-            label: "领域",
-            index: null,
-            showName: "tradefield", //显示字段
-            valueKey: "tradefield", //返回Key
-            selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
-            value: "", //选中值
-            list: []
-        }],
         createShow: false,
         types: [{
             name: "按借用合同借用"
@@ -48,12 +31,6 @@ Page({
             userrole: wx.getStorageSync('userrole')
         })
     },
-    /* 处理筛选 */
-    handleFilter({
-        detail
-    }) {
-        console.log(detail)
-    },
     getList(init = false) {
         if (init.detail != undefined) init = init.detail;
         let content = this.data.content;

+ 0 - 1
packageA/borrow/index.wxml

@@ -18,5 +18,4 @@
 <!-- 新建浮动按钮 -->
 <Yl_FloatingButton bindtap="openAction" />
 <!-- 筛选条件 -->
-<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
 <van-action-sheet show="{{ createShow }}" actions="{{ types }}" cancel-text="取消" bind:select='createBor' bind:cancel='onCancel' bind:click-overlay='onCancel' />

+ 1 - 24
packageA/invoice/index.js

@@ -14,24 +14,7 @@ Page({
                 "condition": "",
             },
             sort: []
-        },
-        filter: [{
-            label: "品牌",
-            index: null,
-            showName: "brandname", //显示字段
-            valueKey: "brandname", //返回Key
-            selectKey: "brandname", //传参 代表选着字段 不传参返回整个选择对象
-            value: "", //选中值
-            list: []
-        }, {
-            label: "领域",
-            index: null,
-            showName: "tradefield", //显示字段
-            valueKey: "tradefield", //返回Key
-            selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
-            value: "", //选中值
-            list: []
-        }]
+        }
     },
     onLoad(options) {
         this.getList(true)
@@ -39,12 +22,6 @@ Page({
             userrole: wx.getStorageSync('userrole')
         })
     },
-    /* 处理筛选 */
-    handleFilter({
-        detail
-    }) {
-        console.log(detail)
-    },
     getList(init = false) {
         if (init.detail != undefined) init = init.detail;
         let content = this.data.content;

+ 1 - 3
packageA/invoice/index.wxml

@@ -11,6 +11,4 @@
 	<List list="{{list}}" userrole='{{userrole}}' />
 </Yl_ListBox>
 <!-- 新建浮动按钮 -->
-<Yl_FloatingButton bindtap="toAdd" />
-<!-- 筛选条件 -->
-<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
+<Yl_FloatingButton bindtap="toAdd" />

+ 1 - 1
packageA/orderForm/index.wxml

@@ -1,6 +1,6 @@
 <import src="index.skeleton.wxml" />
 <template is="skeleton" wx:if="{{loading}}" />
-<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
+<Yl_HeadNav styleType="1" showFiltrate sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
 <van-tabs active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
     <van-tab title="全部" />
     <van-tab title="新建" />

+ 1 - 3
packageA/returnOne/index.wxml

@@ -14,6 +14,4 @@
 	<view style="height: 20px;" />
 </Yl_ListBox>
 <!-- 新建浮动按钮 -->
-<Yl_FloatingButton bindtap="toAdd" />
-<!-- 筛选条件 -->
-<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
+<Yl_FloatingButton bindtap="toAdd" />

+ 1 - 24
packageA/shipment/index.js

@@ -14,34 +14,11 @@ Page({
 				"condition": "",
 			},
 			sort: []
-		},
-		filter: [{
-			label: "品牌",
-			index: null,
-			showName: "brandname", //显示字段
-			valueKey: "brandname", //返回Key
-			selectKey: "brandname", //传参 代表选着字段 不传参返回整个选择对象
-			value: "", //选中值
-			list: []
-		}, {
-			label: "领域",
-			index: null,
-			showName: "tradefield", //显示字段
-			valueKey: "tradefield", //返回Key
-			selectKey: "tradefield", //传参 代表选着字段 不传参返回整个选择对象
-			value: "", //选中值
-			list: []
-		}]
+		}
 	},
 	onLoad(options) {
 		this.getList(true)
 	},
-	/* 处理筛选 */
-	handleFilter({
-		detail
-	}) {
-		console.log(detail)
-	},
 	getList(init = false) {
 		if (init.detail != undefined) init = init.detail;
 		let content = this.data.content;

+ 1 - 3
packageA/shipment/index.wxml

@@ -11,6 +11,4 @@
     <List list="{{list}}" />
 </Yl_ListBox>
 <!-- 新建浮动按钮 -->
-<Float />
-<!-- 筛选条件 -->
-<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{false}}' />
+<Float />

+ 3 - 3
packageA/toolBill/index.wxml

@@ -1,6 +1,6 @@
-<import src="index.skeleton.wxml"/>
+<import src="index.skeleton.wxml" />
 <template is="skeleton" wx:if="{{loading}}" />
-<Yl_HeadNav styleType="1" sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
+<Yl_HeadNav styleType="1" showFiltrate sort='{{content.sort}}' placeholder='搜索' bindonSearch="onSearch" />
 <van-tabs class="tabs" active="{{ active }}" color='var(--assist)' title-active-color='var(--assist)' bind:change="tabsChange">
     <van-tab title="全部" />
     <van-tab title="新建" />
@@ -18,4 +18,4 @@
 <!-- 新建浮动按钮 -->
 <Yl_FloatingButton bindtap="toAdd" />
 <!-- 筛选条件 -->
-<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{true}}' />
+<Yl_Filtrate id='Filtrate' list="{{filter}}" bind:handle="handleFilter" dateRange='{{true}}' />