Commit 346a26c9d20c66d97cf10dd774ff2bfe0eb96622

Authored by zhangyan
1 parent efd73b53

no message

Component({
properties: {
searchlist:Array
},
methods:{
selectphone:function (e) {
console.log(e)
var target=e.currentTarget.dataset;
this.triggerEvent('selectphone',{phone:target.phone,rname:target.rname})
}
}
})
\ No newline at end of file
... ...
{
"component":true
}
\ No newline at end of file
... ...
<view class="search-react">
<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>{{item.phone}}</view>
<view>{{item.rname}}</view>
</view>
</block>
</scroll-view>
</view>
\ No newline at end of file
... ...
@import '../../app.wxss';
.search-react{
width:400rpx;
height:541rpx;
position:absolute;
left:0;
top:142rpx;
}
.angel{
width:30rpx;
height:30rpx;
border-top:1px solid #E0E0E0;
border-left:1px solid #E0E0E0;
transform:rotate(45deg);
margin:0 auto;
position:relative;
z-index:2;
}
.search-list{
width:100%;
max-height:500rpx;
border:1px solid #E0E0E0;
border-radius:16rpx;
position:relative;
top:-16rpx;
box-shadow:0 0 4px rgba(0,0,0,.1);
}
.list-single{
width:100%;
height:100rpx;
padding:35rpx 30rpx 5rpx;
border-top:1px solid #E0E0E0;
box-sizing:border-box;
}
\ No newline at end of file
... ...
... ... @@ -195,4 +195,28 @@ 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
})
}
})
}
},
selectphone:function(e){
this.data.form.phone=e.detail.phone;
this.data.form.rname=e.detail.rname;
this.setData({
form:this.data.form,
searchlist:null
})
}
})
\ No newline at end of file
... ...
... ... @@ -6,6 +6,7 @@
"nothingBook":"/components/book/nothing/nothing",
"bookList":"/components/book/list/list",
"nav":"/components/nav/nav",
"tabBar":"/components/book/tabBar/tabBar"
"tabBar":"/components/book/tabBar/tabBar",
"searchList":"/components/searchlist/searchlist"
}
}
\ No newline at end of file
... ...
... ... @@ -103,7 +103,7 @@
</view>
</view>
<view class="book-info">
<view class="book-info-single flex-lr" style="align-items:flex-start;">
<view class="book-info-single flex-lr" style="align-items:flex-start;position:relative;z-index:5;">
<input placeholder="预订人电话" placeholder-class="gray-font font34r" class="black-font font34r" type="number" maxlength="11"
bindinput="selectedValue"
bindconfirm="selectedValue"
... ... @@ -115,6 +115,9 @@
<image src="../image/name-have.png" class="phone-reminder"></image>
</view>
</block>
<block wx:if="{{searchlist}}">
<searchList searchlist="{{searchlist}}" bind:selectphone="selectphone"></searchList>
</block>
</view>
<view class="book-info-single flex-lr" style="align-items:flex-start;">
<input placeholder="预订人姓名(必填)" placeholder-class="gray-font font34r" class="black-font font34r" maxlength="5" style="width:450rpx;" value="{{form.rname}}"
... ...
... ... @@ -140,7 +140,7 @@
.book-info-single{
width:100%;
height:120rpx;
padding-top:80rpx;
padding-top:40rpx;
border-bottom:1px solid #efeef3;
}
.book-info-single>input{
... ...
... ... @@ -45,5 +45,6 @@ export default {
'App.SendSMS.Message':{
silence:false,
},
'App.Reserve.GetReserveUser':null
}
\ No newline at end of file
... ...