Showing
2 changed files
with
19 additions
and
13 deletions
| @@ -64,16 +64,20 @@ Page({ | @@ -64,16 +64,20 @@ Page({ | ||
| 64 | */ | 64 | */ |
| 65 | reserve_id:'', | 65 | reserve_id:'', |
| 66 | onLoad: async function (options) { | 66 | onLoad: async function (options) { |
| 67 | - this.reserve_id=options.id||''; | ||
| 68 | - this.setDateStr(); | 67 | + this.initLoad(options) |
| 68 | + }, | ||
| 69 | + async initLoad(options={}){ | ||
| 70 | + this.reserve_id=options.id||''; | ||
| 71 | + this.setDateStr(); | ||
| 69 | this.sellerid=util.cache('sellerid'); | 72 | this.sellerid=util.cache('sellerid'); |
| 70 | - let timePickerArray= await comm.getDayTimeSpace(); | ||
| 71 | - this.setData({ | ||
| 72 | - timePickerArray: timePickerArray, | ||
| 73 | - }) | ||
| 74 | - if(this.reserve_id>0){ | ||
| 75 | - this.initModify(this.reserve_id); | ||
| 76 | - } | 73 | + let timePickerArray= await comm.getDayTimeSpace(); |
| 74 | + this.setData({ | ||
| 75 | + timePickerArray: timePickerArray, | ||
| 76 | + }) | ||
| 77 | + if(this.reserve_id>0){ | ||
| 78 | + this.initModify(this.reserve_id); | ||
| 79 | + } | ||
| 80 | + this.getTables(); | ||
| 77 | }, | 81 | }, |
| 78 | /** | 82 | /** |
| 79 | * | 83 | * |
| @@ -117,7 +121,8 @@ Page({ | @@ -117,7 +121,8 @@ Page({ | ||
| 117 | * 生命周期函数--监听页面显示 | 121 | * 生命周期函数--监听页面显示 |
| 118 | */ | 122 | */ |
| 119 | onShow: function () { | 123 | onShow: function () { |
| 120 | - if(!this.reserve_id || util.cache('tableid').length>0){ | 124 | + //if(!this.reserve_id || util.cache('tableid').length>0){ |
| 125 | + if(util.cache('tableid').length>0){ | ||
| 121 | this.getTables(); | 126 | this.getTables(); |
| 122 | } | 127 | } |
| 123 | setTimeout(()=>{ | 128 | setTimeout(()=>{ |
| @@ -323,9 +328,10 @@ Page({ | @@ -323,9 +328,10 @@ Page({ | ||
| 323 | if(res.ret==200){ | 328 | if(res.ret==200){ |
| 324 | let _id=(res.data.id || res.data) | 329 | let _id=(res.data.id || res.data) |
| 325 | this.setData({ | 330 | this.setData({ |
| 326 | - form:JSON.parse(JSON.stringify(formTpl)), | ||
| 327 | - tablesed:null, | 331 | + form:JSON.parse(JSON.stringify(formTpl)), |
| 332 | + tables:[], | ||
| 328 | }) | 333 | }) |
| 334 | + this.initLoad(); | ||
| 329 | App.Reserve.Detail({rid:_id,openid:''},'clear') | 335 | App.Reserve.Detail({rid:_id,openid:''},'clear') |
| 330 | wx.navigateTo({ | 336 | wx.navigateTo({ |
| 331 | url:'b_detail?id='+_id, | 337 | url:'b_detail?id='+_id, |
-
Please register or login to post a comment