Commit bae1bb64473276b619659dfa0e0a674682485b4c

Authored by wangfan
1 parent 5445c97a

manager-invitation

@@ -26,6 +26,7 @@ Page({ @@ -26,6 +26,7 @@ Page({
26 defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg', 26 defImage:'http://qn.colorcun.com/manager-invitation/wx/upload2.jpg',
27 tpl:{}, 27 tpl:{},
28 timeStr:'', 28 timeStr:'',
  29 + searchlist:[],
29 }, 30 },
30 31
31 /** 32 /**
@@ -33,6 +34,7 @@ Page({ @@ -33,6 +34,7 @@ Page({
33 */ 34 */
34 pickerData:[], 35 pickerData:[],
35 tpl:{}, 36 tpl:{},
  37 + searchlist:[],
36 onLoad: function (options) { 38 onLoad: function (options) {
37 this.tpl=TP.tpls(options.tplid); 39 this.tpl=TP.tpls(options.tplid);
38 this.pickerData=TP.pickerData(); 40 this.pickerData=TP.pickerData();
@@ -58,6 +60,25 @@ Page({ @@ -58,6 +60,25 @@ Page({
58 this.checkHasSubmit(); 60 this.checkHasSubmit();
59 } 61 }
60 ) 62 )
  63 + App.Invitation.InvitationList({
  64 + openid:getApp().openid,
  65 + offset: 0,
  66 + limit: 20,
  67 + }).then(res => {
  68 + if(res.data.length>0){
  69 + let rn=[];
  70 + res.data.forEach(r=>{
  71 + if(rn.length>4) return false;
  72 + if(rn._indexOf(r.room_name)<0){
  73 + rn.push(r.room_name);
  74 + this.searchlist.push({
  75 + phone:r.room_name,
  76 + })
  77 + console.log('this.searchlist',this.searchlist)
  78 + }
  79 + })
  80 + }
  81 + })
61 }, 82 },
62 initData(options){ 83 initData(options){
63 if(options.rid){ 84 if(options.rid){
@@ -305,4 +326,24 @@ Page({ @@ -305,4 +326,24 @@ Page({
305 } 326 }
306 }); 327 });
307 }, 328 },
  329 + selectphone(e){
  330 + console.log(e.detail.phone);
  331 + this.setData({
  332 + [`form.room`]:e.detail.phone,
  333 + })
  334 + this.hideSearchList();
  335 + this.checkHasSubmit()
  336 + },
  337 + showSearchList(){
  338 + this.setData({
  339 + searchlist:this.searchlist,
  340 + })
  341 + },
  342 + hideSearchList(){
  343 + setTimeout(()=>{
  344 + this.setData({
  345 + searchlist:[],
  346 + })
  347 + },0)
  348 + },
308 }) 349 })
@@ -5,6 +5,7 @@ @@ -5,6 +5,7 @@
5 "usingComponents": { 5 "usingComponents": {
6 "userinfo": "/components/userinfo/userinfo", 6 "userinfo": "/components/userinfo/userinfo",
7 "nav":"/components/nav/nav", 7 "nav":"/components/nav/nav",
8 - "formids":"/components/formids/formids" 8 + "formids":"/components/formids/formids",
  9 + "searchList":"/components/searchlist/searchlist"
9 } 10 }
10 } 11 }
1 <!--pages/manager-invitation/editor.wxml--> 1 <!--pages/manager-invitation/editor.wxml-->
2 <nav>修改信息</nav> 2 <nav>修改信息</nav>
3 -<view class="pages">  
4 - <view class="base block"> 3 +<view class="pages" bindtap="hideSearchList">
  4 + <view class="base block" >
5 <view class="item Medium">预订信息</view> 5 <view class="item Medium">预订信息</view>
6 <view class="item flex-ll"> 6 <view class="item flex-ll">
7 <input value="{{form.name}}" bindinput="input" 7 <input value="{{form.name}}" bindinput="input"
8 data-key="name" 8 data-key="name"
9 placeholder="请输入店铺名称" placeholder-class="placeholder-class"/> 9 placeholder="请输入店铺名称" placeholder-class="placeholder-class"/>
10 - <formids url="./setting/sellers?hasQuick=1" class="quick">快速选择</formids> 10 + <formids url="./setting/sellers?hasQuick=1" class="quick">选择店铺</formids>
11 </view> 11 </view>
12 <view class="item flex-ll"> 12 <view class="item flex-ll">
13 <picker 13 <picker
@@ -29,10 +29,14 @@ @@ -29,10 +29,14 @@
29 </view> 29 </view>
30 </picker> 30 </picker>
31 </view> 31 </view>
32 - <view class="item flex-ll"> 32 + <view class="item flex-ll room-input" catchtap="catchtap">
33 <input value="{{form.room}}" bindinput="input" 33 <input value="{{form.room}}" bindinput="input"
34 - data-key="room" 34 + bindfocus="showSearchList"
  35 + data-key="room" cursor-spacing="340" adjust-position="{{true}}"
35 placeholder="请输入包间名称" placeholder-class="placeholder-class"/> 36 placeholder="请输入包间名称" placeholder-class="placeholder-class"/>
  37 + <searchList searchlist="{{searchlist}}"
  38 + catchtap="showSearchList"
  39 + bind:selectphone="selectphone" wx:if="{{searchlist.length>0}}"></searchList>
36 </view> 40 </view>
37 <view class="item flex-ll"> 41 <view class="item flex-ll">
38 <input value="{{form.addr}}" 42 <input value="{{form.addr}}"
@@ -6,7 +6,7 @@ page{ @@ -6,7 +6,7 @@ page{
6 background-color: #F5F5F5; 6 background-color: #F5F5F5;
7 font-size: 34rpx; 7 font-size: 34rpx;
8 padding-top: 20rpx; 8 padding-top: 20rpx;
9 - padding-bottom: 160rpx; 9 + padding-bottom: 260rpx;
10 } 10 }
11 .block{ 11 .block{
12 width: 94%; 12 width: 94%;
@@ -81,3 +81,6 @@ page{ @@ -81,3 +81,6 @@ page{
81 height: 140rpx; 81 height: 140rpx;
82 line-height: 140rpx; 82 line-height: 140rpx;
83 } 83 }
  84 +.room-input{
  85 + position: relative;
  86 +}