Showing
3 changed files
with
10 additions
and
5 deletions
| @@ -74,7 +74,7 @@ Component({ | @@ -74,7 +74,7 @@ Component({ | ||
| 74 | if (this.data.detail.tableFirst) { | 74 | if (this.data.detail.tableFirst) { |
| 75 | tableSubInfo = (this.data.detail.tableFirst || '') + ' ' + (this.data.detail.tableSubInfo || ''); | 75 | tableSubInfo = (this.data.detail.tableFirst || '') + ' ' + (this.data.detail.tableSubInfo || ''); |
| 76 | tableFirst = this.data.detail.tableFirst | 76 | tableFirst = this.data.detail.tableFirst |
| 77 | - } else if(this.data.detail.tables.length>0) { | 77 | + } else if(this.data.detail.tables && this.data.detail.tables.length>0) { |
| 78 | tableFirst = this.data.detail.tables[0].name | 78 | tableFirst = this.data.detail.tables[0].name |
| 79 | tableSubInfo = this.data.detail.tables[0].name; | 79 | tableSubInfo = this.data.detail.tables[0].name; |
| 80 | if (this.data.detail.tables.length > 1) { | 80 | if (this.data.detail.tables.length > 1) { |
| @@ -255,25 +255,30 @@ Page({ | @@ -255,25 +255,30 @@ Page({ | ||
| 255 | }) | 255 | }) |
| 256 | }, | 256 | }, |
| 257 | reserve:{}, | 257 | reserve:{}, |
| 258 | - selectpeople(e){ | 258 | + selectpeople(e){//人数改变 |
| 259 | console.log(e); | 259 | console.log(e); |
| 260 | this.reserve.pnum=e.detail.people; | 260 | this.reserve.pnum=e.detail.people; |
| 261 | if(e.detail.action=='click'){ | 261 | if(e.detail.action=='click'){ |
| 262 | 262 | ||
| 263 | } | 263 | } |
| 264 | }, | 264 | }, |
| 265 | - selecttime(e){ | 265 | + selecttime(e){//时间改变 |
| 266 | console.log(e); | 266 | console.log(e); |
| 267 | this.reserve.time=e.detail.time; | 267 | this.reserve.time=e.detail.time; |
| 268 | if(e.detail.action=='click'){ | 268 | if(e.detail.action=='click'){ |
| 269 | this.reserve.sid=this.options.id | 269 | this.reserve.sid=this.options.id |
| 270 | this.reserve.ddate=util.timetouUnix(this.reserve.date+' '+this.reserve.time+':00') | 270 | this.reserve.ddate=util.timetouUnix(this.reserve.date+' '+this.reserve.time+':00') |
| 271 | + //date=2019-07-25&pnum=6&time=20%3A00&sid=154&ddate=1564056000 | ||
| 271 | wx.navigateTo({ | 272 | wx.navigateTo({ |
| 272 | url:util.http_build_query(this.reserve,'./submit') | 273 | url:util.http_build_query(this.reserve,'./submit') |
| 273 | }) | 274 | }) |
| 274 | } | 275 | } |
| 275 | }, | 276 | }, |
| 276 | - selectdate(e){ | 277 | + selectdate(e){//日期改变 |
| 277 | console.log(e); | 278 | console.log(e); |
| 279 | + this.reserve.date=e.detail.date; | ||
| 280 | + this.setData({ | ||
| 281 | + reserveDate:e.detail.date | ||
| 282 | + }) | ||
| 278 | } | 283 | } |
| 279 | }) | 284 | }) |
| @@ -198,6 +198,6 @@ | @@ -198,6 +198,6 @@ | ||
| 198 | <view class="olreserve"> | 198 | <view class="olreserve"> |
| 199 | <calendar seller="{{seller}}" bindselectdate="selectdate"></calendar> | 199 | <calendar seller="{{seller}}" bindselectdate="selectdate"></calendar> |
| 200 | <people seller="{{seller}}" bindselectpeople="selectpeople"></people> | 200 | <people seller="{{seller}}" bindselectpeople="selectpeople"></people> |
| 201 | - <dur seller="{{seller}}" bindselecttime="selecttime"></dur> | 201 | + <dur seller="{{seller}}" date="{{reserveDate}}" bindselecttime="selecttime"></dur> |
| 202 | </view> | 202 | </view> |
| 203 | </view> | 203 | </view> |
-
Please register or login to post a comment