Commit 0d8add071daefc3c154e58801aeba7d7730a2ba3

Authored by wangfan
2 parents 9ee494ab feda1d05

Merge remote-tracking branch 'remotes/origin/master' into online-reserve

@@ -9,6 +9,7 @@ @@ -9,6 +9,7 @@
9 </view> 9 </view>
10 </view> 10 </view>
11 <view class="tid" wx:if="{{board.tid==2}}">包间</view> 11 <view class="tid" wx:if="{{board.tid==2}}">包间</view>
  12 + <view class="tid" wx:if="{{board.tid==3}}">卡座</view>
12 <view class="status" wx:if="{{board.status_str}}" style="width: {{width}}rpx;">{{board.status_str}}</view> 13 <view class="status" wx:if="{{board.status_str}}" style="width: {{width}}rpx;">{{board.status_str}}</view>
13 <icon type="success" size="20" color="#199095" class="desk-active" wx:if="{{board.isselect==true}}"/> 14 <icon type="success" size="20" color="#199095" class="desk-active" wx:if="{{board.isselect==true}}"/>
14 </view> 15 </view>
@@ -716,8 +716,14 @@ Page({ @@ -716,8 +716,14 @@ Page({
716 App.User.GetCustomRemark({ 716 App.User.GetCustomRemark({
717 uid:util.cache('enter_params')['manager_id'], 717 uid:util.cache('enter_params')['manager_id'],
718 }).then(res=>{ 718 }).then(res=>{
  719 + let CustomRemark=[];
  720 + res.data.forEach(r=>{
  721 + if(r.often_use){
  722 + CustomRemark.push(r);
  723 + }
  724 + })
719 this.setData({ 725 this.setData({
720 - CustomRemark:res.data, 726 + CustomRemark:CustomRemark,
721 }) 727 })
722 }) 728 })
723 }, 729 },
@@ -741,6 +747,7 @@ Page({ @@ -741,6 +747,7 @@ Page({
741 CustomRemark:CustomRemark, 747 CustomRemark:CustomRemark,
742 form:form, 748 form:form,
743 }) 749 })
  750 + this.conditionInfo()
744 }, 751 },
745 CustomRemarkMore(){ 752 CustomRemarkMore(){
746 this.setData({ 753 this.setData({
@@ -190,12 +190,12 @@ @@ -190,12 +190,12 @@
190 bindblur="inputFocus" 190 bindblur="inputFocus"
191 data-key="cusdem"/> 191 data-key="cusdem"/>
192 </view> 192 </view>
193 - <view wx:if="{{CustomRemark.length>0}}" class="book-info-single" style="padding-top: 14rpx; height: 60rpx;"> 193 + <view wx:if="{{CustomRemark.length>0}}" class="book-info-single last" style="padding-top: 14rpx; height: 60rpx;">
194 <view class="flex-lr CustomRemark"> 194 <view class="flex-lr CustomRemark">
195 <view class="CustomRemarks"> 195 <view class="CustomRemarks">
196 <view class="CustomRemarksView"> 196 <view class="CustomRemarksView">
197 <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}" 197 <view class="CustomRemarkItem {{item.active?'active':''}}" wx:for="{{CustomRemark}}"
198 - wx:if="{{item.often_use}}" bindtap="oftenUse" 198 + bindtap="oftenUse"
199 data-id="{{item.id}}" 199 data-id="{{item.id}}"
200 data-value="{{item.often_use}}">{{item.often_use}}</view> 200 data-value="{{item.often_use}}">{{item.often_use}}</view>
201 </view> 201 </view>
@@ -308,7 +308,7 @@ @@ -308,7 +308,7 @@
308 .CustomRemarkMore .CustomRemarkItem{ 308 .CustomRemarkMore .CustomRemarkItem{
309 padding: 4rpx 24rpx; 309 padding: 4rpx 24rpx;
310 } 310 }
311 -.book-info-single:last-child{ 311 +.book-info-single.last{
312 border-width: 0; 312 border-width: 0;
313 } 313 }
314 .CustomRemarkItem.active{ 314 .CustomRemarkItem.active{
@@ -7,6 +7,7 @@ Page({ @@ -7,6 +7,7 @@ Page({
7 menu_active_id:'' 7 menu_active_id:''
8 }, 8 },
9 checked_tids:[], 9 checked_tids:[],
  10 + desks:[],
10 onLoad:function(opt){ 11 onLoad:function(opt){
11 console.log('onLoad',opt) 12 console.log('onLoad',opt)
12 util.setBarTitle('选择桌位'); 13 util.setBarTitle('选择桌位');
@@ -52,24 +53,35 @@ Page({ @@ -52,24 +53,35 @@ Page({
52 App.Reserve.GetTableList(formdata).then(function (json) { 53 App.Reserve.GetTableList(formdata).then(function (json) {
53 if(json.ret==200){ 54 if(json.ret==200){
54 console.log('this.checked_tids',that.checked_tids); 55 console.log('this.checked_tids',that.checked_tids);
55 - if(json.data.length>0){  
56 - json.data.forEach(function(v,i){  
57 - v.list.forEach(function(r,n){  
58 - r.isselect=false  
59 - if(that.checked_tids._indexOf(r.id)>-1){  
60 - r.isselect=true;  
61 - }  
62 - })  
63 - })  
64 - }  
65 - that.setData({  
66 - desklist:json.data,  
67 - menu_active_id:json.data[0].name  
68 - }) 56 + that.desks=json.data
  57 + that.formatDesklist(true)
69 } 58 }
70 }) 59 })
71 }, 60 },
  61 + formatDesklist(hasFirst=true){
  62 + let desks=this.desks;
  63 + if(desks.length>0){
  64 + desks.forEach((v,i)=>{
  65 + v.list.forEach((r,n)=>{
  66 + r.isselect=false
  67 + if(this.checked_tids._indexOf(r.id)>-1){
  68 + r.isselect=true;
  69 + }
  70 + })
  71 + })
  72 + let param={
  73 + desklist:desks,
  74 + }
  75 + if(hasFirst){
  76 + param.menu_active_id=desks[0].name
  77 + }
  78 + this.setData(param)
  79 + }
  80 + return desks;
  81 + },
72 switchMenu(e){ 82 switchMenu(e){
  83 +
  84 + this.formatDesklist(false)
73 this.setData({ 85 this.setData({
74 menu_active_id:util.attr(e,'id') 86 menu_active_id:util.attr(e,'id')
75 }) 87 })
@@ -5,7 +5,6 @@ Page({ @@ -5,7 +5,6 @@ Page({
5 alllabel:[ 5 alllabel:[
6 6
7 ], 7 ],
8 - focus:true  
9 }, 8 },
10 onLoad:function(){ 9 onLoad:function(){
11 this.getlabellist(); 10 this.getlabellist();
@@ -30,7 +29,10 @@ Page({ @@ -30,7 +29,10 @@ Page({
30 }).then(res=>{ 29 }).then(res=>{
31 console.log(res) 30 console.log(res)
32 this.setData({ 31 this.setData({
33 - alllabel:res.data 32 + alllabel:res.data,
  33 + })
  34 + this.setData({
  35 + focus:true,
34 }) 36 })
35 }) 37 })
36 }, 38 },
@@ -64,13 +66,10 @@ Page({ @@ -64,13 +66,10 @@ Page({
64 console.log(res) 66 console.log(res)
65 if(res.ret==200){ 67 if(res.ret==200){
66 this.setData({ 68 this.setData({
67 - defineremark:'', 69 + defineremark:null,
68 }) 70 })
69 this.getlabellist(); 71 this.getlabellist();
70 } 72 }
71 - this.setData({  
72 - focus:true  
73 - })  
74 }) 73 })
75 }, 74 },
76 }) 75 })
@@ -11,7 +11,7 @@ @@ -11,7 +11,7 @@
11 </view> 11 </view>
12 </block> 12 </block>
13 </block> 13 </block>
14 - <input class="black-font flex-cc font28r smooth label-input flex-cc" placeholder="添加备注" placeholder-class="smooth flex-cc" maxlength="10" style="width:{{defineremark.length>4 ? (defineremark.length-4)*28+160 : 160}}rpx;" value="{{defineremark}}" bindinput="inputremark" focus="{{focus}}" cursor-spacing="160" bindblur="addinputlabel" placeholder-style="color:#999;font-size:28rpx;"/> 14 + <view style="min-width:176rpx;"><input class="black-font flex-cc font28r smooth label-input flex-cc" placeholder="添加备注" maxlength="10" style="width:{{defineremark && defineremark.length>4 ? (defineremark.length-4)*28+160 : 160}}rpx;" value="{{defineremark}}" bindinput="inputremark" focus="{{focus}}" cursor-spacing="160" bindblur="addinputlabel" placeholder-style="color:#999;font-size:28rpx;text-align:center;"/></view>
15 </view> 15 </view>
16 <view class="label-title black-font font30r smooth">所有备注</view> 16 <view class="label-title black-font font30r smooth">所有备注</view>
17 <view class="label-list flex-rs"> 17 <view class="label-list flex-rs">