Commit 837d2057dfa5a1bf3f68bc8941812c0e3ce9bd9c

Authored by wangfan
1 parent 7d7ebab4

pack

Showing 1 changed file with 13 additions and 4 deletions
@@ -319,7 +319,7 @@ Page({ @@ -319,7 +319,7 @@ Page({
319 tid:form.tabid, 319 tid:form.tabid,
320 rid:this.reserve_id, 320 rid:this.reserve_id,
321 }).then(res=>{ 321 }).then(res=>{
322 - let tables=[]; 322 + let tables=[],tables_tmp=[];
323 let tablesLength=0; 323 let tablesLength=0;
324 if(tableid.length>0){ 324 if(tableid.length>0){
325 res.data.forEach(p=>{ 325 res.data.forEach(p=>{
@@ -336,13 +336,22 @@ Page({ @@ -336,13 +336,22 @@ Page({
336 wx.removeStorage({key:'tableid'}) 336 wx.removeStorage({key:'tableid'})
337 }else{ 337 }else{
338 res.data.forEach(p=>{ 338 res.data.forEach(p=>{
339 - //if(tables.length>=3) return true;  
340 p.list.forEach(t=>{ 339 p.list.forEach(t=>{
341 tablesLength++; 340 tablesLength++;
342 - if(tables.length>=3) return true;  
343 - tables.push(t); 341 + //if(tables.length>=3) return true;
  342 + if(t.tid==2) {
  343 + tables.push(t);
  344 + }else{
  345 + tables_tmp.push(t);
  346 + }
344 }) 347 })
345 }) 348 })
  349 + if(tables.length<3){
  350 + tables=tables.concat(tables_tmp);
  351 + }
  352 + if(tables.length>=3){
  353 + tables=tables.slice(0,3);
  354 + }
346 } 355 }
347 this.tablesLength=tablesLength; 356 this.tablesLength=tablesLength;
348 this.setData({ 357 this.setData({