|
@@ -10,13 +10,8 @@
|
|
|
|
|
|
|
|
<view class="search-container">
|
|
<view class="search-container">
|
|
|
<view class="search-box">
|
|
<view class="search-box">
|
|
|
- <input
|
|
|
|
|
- type="text"
|
|
|
|
|
- v-model="searchKeyword"
|
|
|
|
|
- placeholder="客户名称或手机尾号"
|
|
|
|
|
- class="search-input"
|
|
|
|
|
- @input="handleSearch"
|
|
|
|
|
- />
|
|
|
|
|
|
|
+ <text class="search-style" @click="changeSearchStyle()">{{ searchStyle == 0 ? '尾号' : '名称' }}</text>
|
|
|
|
|
+ <input type="text" v-model="searchText" placeholder="客户名称或手机尾号" class="search-input" @input="handleSearch" @focus="clearSearch()" />
|
|
|
<text class="clear-btn" @tap="clearSearch">清空</text>
|
|
<text class="clear-btn" @tap="clearSearch">清空</text>
|
|
|
</view>
|
|
</view>
|
|
|
<view class="number-keyboard">
|
|
<view class="number-keyboard">
|
|
@@ -95,14 +90,21 @@ export default {
|
|
|
type:0,
|
|
type:0,
|
|
|
selCustomId:0,
|
|
selCustomId:0,
|
|
|
sn:'',
|
|
sn:'',
|
|
|
- searchKeyword: '',
|
|
|
|
|
|
|
+ searchText: '',
|
|
|
searchTimer: null,
|
|
searchTimer: null,
|
|
|
|
|
+ searchStyle:0
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
created(){
|
|
created(){
|
|
|
this.getCustomData()
|
|
this.getCustomData()
|
|
|
},
|
|
},
|
|
|
methods:{
|
|
methods:{
|
|
|
|
|
+ changeSearchStyle(){
|
|
|
|
|
+ this.searchStyle = this.searchStyle == 0 ? 1 : 0
|
|
|
|
|
+ this.searchText = ''
|
|
|
|
|
+ this.resetList()
|
|
|
|
|
+ this.getCustomData()
|
|
|
|
|
+ },
|
|
|
refreshList(){
|
|
refreshList(){
|
|
|
this.resetList()
|
|
this.resetList()
|
|
|
this.getCustomData()
|
|
this.getCustomData()
|
|
@@ -121,7 +123,6 @@ export default {
|
|
|
clearTimeout(this.searchTimer)
|
|
clearTimeout(this.searchTimer)
|
|
|
this.searchTimer = null
|
|
this.searchTimer = null
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
this.resetList()
|
|
this.resetList()
|
|
|
this.getCustomData()
|
|
this.getCustomData()
|
|
|
},
|
|
},
|
|
@@ -131,14 +132,13 @@ export default {
|
|
|
clearTimeout(this.searchTimer)
|
|
clearTimeout(this.searchTimer)
|
|
|
this.searchTimer = null
|
|
this.searchTimer = null
|
|
|
}
|
|
}
|
|
|
-
|
|
|
|
|
- this.searchKeyword = ''
|
|
|
|
|
|
|
+ this.searchText = ''
|
|
|
this.resetList()
|
|
this.resetList()
|
|
|
this.getCustomData()
|
|
this.getCustomData()
|
|
|
},
|
|
},
|
|
|
appendNumber(num) {
|
|
appendNumber(num) {
|
|
|
this.$util.hitVoice()
|
|
this.$util.hitVoice()
|
|
|
- this.searchKeyword += num.toString()
|
|
|
|
|
|
|
+ this.searchText += num.toString()
|
|
|
// 清除之前的定时器
|
|
// 清除之前的定时器
|
|
|
if (this.searchTimer) {
|
|
if (this.searchTimer) {
|
|
|
clearTimeout(this.searchTimer)
|
|
clearTimeout(this.searchTimer)
|
|
@@ -158,10 +158,7 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
getCustomData(){
|
|
getCustomData(){
|
|
|
- let params = {page:this.list.page,pageSize:20,type:this.type}
|
|
|
|
|
- if (this.searchKeyword) {
|
|
|
|
|
- params.keyword = this.searchKeyword
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ let params = {page:this.list.page,pageSize:20,type:this.type,searchStyle:this.searchStyle,searchText:this.searchText}
|
|
|
return getCustomList(params).then(res=>{
|
|
return getCustomList(params).then(res=>{
|
|
|
if(res.code == 1){
|
|
if(res.code == 1){
|
|
|
this.completes(res)
|
|
this.completes(res)
|
|
@@ -219,7 +216,15 @@ export default {
|
|
|
background-color: #f5f5f5;
|
|
background-color: #f5f5f5;
|
|
|
border-radius: 5upx;
|
|
border-radius: 5upx;
|
|
|
margin-bottom: 5upx;
|
|
margin-bottom: 5upx;
|
|
|
-
|
|
|
|
|
|
|
+ .search-style{
|
|
|
|
|
+ width: 18%;
|
|
|
|
|
+ height: 30upx;
|
|
|
|
|
+ line-height: 30upx;
|
|
|
|
|
+ text-align: center;
|
|
|
|
|
+ background-color: #fff;
|
|
|
|
|
+ border-radius: 3upx;
|
|
|
|
|
+ font-size: 12upx;
|
|
|
|
|
+ }
|
|
|
.search-input {
|
|
.search-input {
|
|
|
flex: 1;
|
|
flex: 1;
|
|
|
height: 30upx;
|
|
height: 30upx;
|