Commit bae1bb64473276b619659dfa0e0a674682485b4c

Authored by wangfan
1 parent 5445c97a

manager-invitation

... ... @@ -26,6 +26,7 @@ Page({
defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg',
tpl:{},
timeStr:'',
searchlist:[],
},
/**
... ... @@ -33,6 +34,7 @@ Page({
*/
pickerData:[],
tpl:{},
searchlist:[],
onLoad: function (options) {
this.tpl=TP.tpls(options.tplid);
this.pickerData=TP.pickerData();
... ... @@ -58,6 +60,25 @@ Page({
this.checkHasSubmit();
}
)
App.Invitation.InvitationList({
openid:getApp().openid,
offset: 0,
limit: 20,
}).then(res => {
if(res.data.length>0){
let rn=[];
res.data.forEach(r=>{
if(rn.length>4) return false;
if(rn._indexOf(r.room_name)<0){
rn.push(r.room_name);
this.searchlist.push({
phone:r.room_name,
})
console.log('this.searchlist',this.searchlist)
}
})
}
})
},
initData(options){
if(options.rid){
... ... @@ -305,4 +326,24 @@ Page({
}
});
},
selectphone(e){
console.log(e.detail.phone);
this.setData({
[`form.room`]:e.detail.phone,
})
this.hideSearchList();
this.checkHasSubmit()
},
showSearchList(){
this.setData({
searchlist:this.searchlist,
})
},
hideSearchList(){
setTimeout(()=>{
this.setData({
searchlist:[],
})
},0)
},
})
\ No newline at end of file
... ...
... ... @@ -5,6 +5,7 @@
"usingComponents": {
"userinfo": "/components/userinfo/userinfo",
"nav":"/components/nav/nav",
"formids":"/components/formids/formids"
"formids":"/components/formids/formids",
"searchList":"/components/searchlist/searchlist"
}
}
\ No newline at end of file
... ...
<!--pages/manager-invitation/editor.wxml-->
<nav>修改信息</nav>
<view class="pages">
<view class="base block">
<view class="pages" bindtap="hideSearchList">
<view class="base block" >
<view class="item Medium">预订信息</view>
<view class="item flex-ll">
<input value="{{form.name}}" bindinput="input"
data-key="name"
placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
<formids url="./setting/sellers?hasQuick=1" class="quick">快速选择</formids>
<formids url="./setting/sellers?hasQuick=1" class="quick">选择店铺</formids>
</view>
<view class="item flex-ll">
<picker
... ... @@ -29,10 +29,14 @@
</view>
</picker>
</view>
<view class="item flex-ll">
<view class="item flex-ll room-input" catchtap="catchtap">
<input value="{{form.room}}" bindinput="input"
data-key="room"
bindfocus="showSearchList"
data-key="room" cursor-spacing="340" adjust-position="{{true}}"
placeholder="请输入包间名称" placeholder-class="placeholder-class"/>
<searchList searchlist="{{searchlist}}"
catchtap="showSearchList"
bind:selectphone="selectphone" wx:if="{{searchlist.length>0}}"></searchList>
</view>
<view class="item flex-ll">
<input value="{{form.addr}}"
... ...
... ... @@ -6,7 +6,7 @@ page{
background-color: #F5F5F5;
font-size: 34rpx;
padding-top: 20rpx;
padding-bottom: 160rpx;
padding-bottom: 260rpx;
}
.block{
width: 94%;
... ... @@ -81,3 +81,6 @@ page{
height: 140rpx;
line-height: 140rpx;
}
.room-input{
position: relative;
}
\ No newline at end of file
... ...