Showing
1 changed file
with
23 additions
and
5 deletions
| @@ -61,17 +61,35 @@ Page({ | @@ -61,17 +61,35 @@ Page({ | ||
| 61 | }) | 61 | }) |
| 62 | }) | 62 | }) |
| 63 | }, | 63 | }, |
| 64 | + getTableName(tables){ | ||
| 65 | + let bao=[],san=[]; | ||
| 66 | + tables.forEach(t=>{ | ||
| 67 | + if(t.tid==2){ | ||
| 68 | + bao.push(t.name); | ||
| 69 | + }else{ | ||
| 70 | + san.push(t.name); | ||
| 71 | + } | ||
| 72 | + }) | ||
| 73 | + let str=''; | ||
| 74 | + if(bao.length>0){ | ||
| 75 | + str='包厢('+bao.join('、')+')'; | ||
| 76 | + } | ||
| 77 | + if(san.length>0){ | ||
| 78 | + str+=san.join('、'); | ||
| 79 | + } | ||
| 80 | + str=str.substr(0,20); | ||
| 81 | + if(str.indexOf('(')>-1 && str.indexOf(')')<0){ | ||
| 82 | + str=str.substr(0,19)+')'; | ||
| 83 | + } | ||
| 84 | + return str; | ||
| 85 | + }, | ||
| 64 | smsData:{}, | 86 | smsData:{}, |
| 65 | getTplMsg(){ | 87 | getTplMsg(){ |
| 66 | - let region_room_name=this.bookInfo.tables[0].rname+' '+this.bookInfo.tables[0].name; | ||
| 67 | - if(this.bookInfo.tables.length>1){ | ||
| 68 | - region_room_name+='等'+this.bookInfo.tables.length+'桌' | ||
| 69 | - } | ||
| 70 | let smsData={ | 88 | let smsData={ |
| 71 | guest:this.bookInfo.rname.substr(0,1)+(this.bookInfo.sex==1?'先生':'女士'), | 89 | guest:this.bookInfo.rname.substr(0,1)+(this.bookInfo.sex==1?'先生':'女士'), |
| 72 | seller_name:this.bookInfo.seller.sellername.substr(0,20), | 90 | seller_name:this.bookInfo.seller.sellername.substr(0,20), |
| 73 | date:this.bookInfo.rdateStr, | 91 | date:this.bookInfo.rdateStr, |
| 74 | - region_room_name:region_room_name.substr(0,20), | 92 | + region_room_name:this.getTableName(this.bookInfo.tables), |
| 75 | reserve_pnum:(this.bookInfo.pnum || this.bookInfo.pnum_str)+'人', | 93 | reserve_pnum:(this.bookInfo.pnum || this.bookInfo.pnum_str)+'人', |
| 76 | seller_addr:(this.bookInfo.seller.real_address || this.bookInfo.seller.map_address).substr(0,20), | 94 | seller_addr:(this.bookInfo.seller.real_address || this.bookInfo.seller.map_address).substr(0,20), |
| 77 | seller_phone:this.bookInfo.seller.phone.substr(0,20), | 95 | seller_phone:this.bookInfo.seller.phone.substr(0,20), |
-
Please register or login to post a comment