Commit 01b6d5f7fdf4f6a96bc7a459a6c718002f39a3bc

Authored by zhangyan
1 parent 5146bd0c

no message

... ... @@ -6,7 +6,7 @@ Component({
selectphone:function (e) {
console.log(e)
var target=e.currentTarget.dataset;
this.triggerEvent('selectphone',{phone:target.phone,rname:target.rname})
this.triggerEvent('selectphone',{phone:target.phone,rname:target.rname,cusdem:target.cusdem})
}
}
})
\ No newline at end of file
... ...
... ... @@ -2,7 +2,7 @@
<view class="angel bg_white"></view>
<scroll-view class="search-list bg_white" scroll-y>
<block wx:for="{{searchlist}}">
<view class="list-single flex-lr black-font font30r" data-id="{{item.id}}" data-phone="{{item.phone}}" data-rname="{{item.rname}}" bindtap="selectphone">
<view class="list-single flex-lr black-font font30r" data-cusdem="{{item.cusdem}}" data-phone="{{item.phone}}" data-rname="{{item.rname}}" bindtap="selectphone">
<view>{{item.phone}}</view>
<view>{{item.rname}}</view>
</view>
... ...
... ... @@ -111,6 +111,26 @@ Page({
let val;
if(e.type=='input'){
val=util.val(e);
if(e.currentTarget.dataset.key=='phone'){
var that=this;
if(e.detail.value!='' && e.detail.value.length>=3) {
App.Reserve.GetReserveUser({keywords:e.detail.value}).then(function(json){
if(json.ret==200 && json.data.length>0){
that.setData({
searchlist:json.data
})
}else{
that.setData({
searchlist:null
})
}
})
}else{
this.setData({
searchlist:null
})
}
}
}else{
val=util.attr(e,'value');
}
... ... @@ -195,29 +215,10 @@ Page({
})
}catch (e){}
},
selectedValue:function(e){
var that=this;
if(e.detail.value!='' && e.detail.value.length>=3) {
App.Reserve.GetReserveUser({keywords:e.detail.value}).then(function(json){
if(json.ret==200 && json.data.length>0){
that.setData({
searchlist:json.data
})
}else{
that.setData({
searchlist:null
})
}
})
}else{
this.setData({
searchlist:null
})
}
},
selectphone:function(e){
this.data.form.phone=e.detail.phone;
this.data.form.rname=e.detail.rname;
this.data.form.cusdem=e.detail.cusdem;
this.setData({
form:this.data.form,
searchlist:null
... ...