Browse Source

通讯录调整

user5 9 tháng trước cách đây
mục cha
commit
4af5e4adc9
1 tập tin đã thay đổi với 26 bổ sung2 xóa
  1. 26 2
      pages/addressbook/addressbook.vue

+ 26 - 2
pages/addressbook/addressbook.vue

@@ -6,7 +6,13 @@
 
 	<u-sticky>
 		<view  style="padding: 20upx; background-color: white;">
-			<u-search placeholder="输入搜索的关键词" :clearabled="true" :showAction="false" v-model="searchUserName"></u-search>
+			<u-search placeholder="姓名" :clearabled="true" :showAction="false" v-model="searchUserName"></u-search>
+		</view>
+		<view  style="padding: 20upx; background-color: white;">
+			<u-search placeholder="部门" :clearabled="true" :showAction="false" v-model="officeName"></u-search>
+		</view>
+		<view  style="padding: 20upx; background-color: white;">
+			<u-search placeholder="手机号" :clearabled="true" :showAction="false" v-model="mobile"></u-search>
 		</view>
 	</u-sticky>
 	
@@ -51,7 +57,9 @@
 				indexList: [],
 				userList: [],
 				total: 0,
-				searchUserName: ''
+				searchUserName: '',
+				officeName: '',
+				mobile:''
 			}
 		},
 		created() {
@@ -69,6 +77,21 @@
 						return true
 					}
 				})
+				resultList = resultList.filter((item)=>{
+					if(item.officeDTO && item.officeDTO.name){
+						if(item.officeDTO.name.indexOf(this.officeName) >= 0){
+							return true
+						}
+					}
+				})
+				resultList = resultList.filter((item)=>{
+					if(item.mobile){
+						if(item.mobile.indexOf(this.mobile) >= 0){
+							return true
+						}
+					}
+				})
+				this.total = resultList.length
 				return this.pySegSort(resultList)
 			}
 		},
@@ -82,6 +105,7 @@
 			    var zh = "阿八嚓哒妸发旮哈讥咔垃痳拏噢妑七呥扨它穵夕丫帀".split('');
 			     
 			    var segs = [];
+				this.indexList = [];
 			    var curr;
 			    letters.forEach((item,i) => {
 			        curr = {letter: item, data:[]};