Commit 01b6d5f7fdf4f6a96bc7a459a6c718002f39a3bc

Authored by zhangyan
1 parent 5146bd0c

no message

@@ -6,7 +6,7 @@ Component({ @@ -6,7 +6,7 @@ Component({
6 selectphone:function (e) { 6 selectphone:function (e) {
7 console.log(e) 7 console.log(e)
8 var target=e.currentTarget.dataset; 8 var target=e.currentTarget.dataset;
9 - this.triggerEvent('selectphone',{phone:target.phone,rname:target.rname}) 9 + this.triggerEvent('selectphone',{phone:target.phone,rname:target.rname,cusdem:target.cusdem})
10 } 10 }
11 } 11 }
12 }) 12 })
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 <view class="angel bg_white"></view> 2 <view class="angel bg_white"></view>
3 <scroll-view class="search-list bg_white" scroll-y> 3 <scroll-view class="search-list bg_white" scroll-y>
4 <block wx:for="{{searchlist}}"> 4 <block wx:for="{{searchlist}}">
5 - <view class="list-single flex-lr black-font font30r" data-id="{{item.id}}" data-phone="{{item.phone}}" data-rname="{{item.rname}}" bindtap="selectphone"> 5 + <view class="list-single flex-lr black-font font30r" data-cusdem="{{item.cusdem}}" data-phone="{{item.phone}}" data-rname="{{item.rname}}" bindtap="selectphone">
6 <view>{{item.phone}}</view> 6 <view>{{item.phone}}</view>
7 <view>{{item.rname}}</view> 7 <view>{{item.rname}}</view>
8 </view> 8 </view>
@@ -111,6 +111,26 @@ Page({ @@ -111,6 +111,26 @@ Page({
111 let val; 111 let val;
112 if(e.type=='input'){ 112 if(e.type=='input'){
113 val=util.val(e); 113 val=util.val(e);
  114 + if(e.currentTarget.dataset.key=='phone'){
  115 + var that=this;
  116 + if(e.detail.value!='' && e.detail.value.length>=3) {
  117 + App.Reserve.GetReserveUser({keywords:e.detail.value}).then(function(json){
  118 + if(json.ret==200 && json.data.length>0){
  119 + that.setData({
  120 + searchlist:json.data
  121 + })
  122 + }else{
  123 + that.setData({
  124 + searchlist:null
  125 + })
  126 + }
  127 + })
  128 + }else{
  129 + this.setData({
  130 + searchlist:null
  131 + })
  132 + }
  133 + }
114 }else{ 134 }else{
115 val=util.attr(e,'value'); 135 val=util.attr(e,'value');
116 } 136 }
@@ -195,29 +215,10 @@ Page({ @@ -195,29 +215,10 @@ Page({
195 }) 215 })
196 }catch (e){} 216 }catch (e){}
197 }, 217 },
198 - selectedValue:function(e){  
199 - var that=this;  
200 - if(e.detail.value!='' && e.detail.value.length>=3) {  
201 - App.Reserve.GetReserveUser({keywords:e.detail.value}).then(function(json){  
202 - if(json.ret==200 && json.data.length>0){  
203 - that.setData({  
204 - searchlist:json.data  
205 - })  
206 - }else{  
207 - that.setData({  
208 - searchlist:null  
209 - })  
210 - }  
211 - })  
212 - }else{  
213 - this.setData({  
214 - searchlist:null  
215 - })  
216 - }  
217 - },  
218 selectphone:function(e){ 218 selectphone:function(e){
219 this.data.form.phone=e.detail.phone; 219 this.data.form.phone=e.detail.phone;
220 this.data.form.rname=e.detail.rname; 220 this.data.form.rname=e.detail.rname;
  221 + this.data.form.cusdem=e.detail.cusdem;
221 this.setData({ 222 this.setData({
222 form:this.data.form, 223 form:this.data.form,
223 searchlist:null 224 searchlist:null