|
@@ -22,6 +22,7 @@ Page({ |
|
@@ -22,6 +22,7 @@ Page({ |
|
22
|
navColor:'',
|
22
|
navColor:'',
|
|
23
|
height:wx.getSystemInfoSync().windowWidth*1,
|
23
|
height:wx.getSystemInfoSync().windowWidth*1,
|
|
24
|
is_show_price:'',
|
24
|
is_show_price:'',
|
|
|
|
25
|
+ changeType:'1',//1不允许修改 2开餐1小时之前 3开餐2小时之前 4预订日期1天前 5预订日期2天前
|
|
25
|
},
|
26
|
},
|
|
26
|
myToast :'',
|
27
|
myToast :'',
|
|
27
|
imageLoad(e) {
|
28
|
imageLoad(e) {
|
|
@@ -404,6 +405,7 @@ Page({ |
|
@@ -404,6 +405,7 @@ Page({ |
|
404
|
navColor,
|
405
|
navColor,
|
|
405
|
textsInfoColor,
|
406
|
textsInfoColor,
|
|
406
|
is_show_price:res.data.is_show_price,
|
407
|
is_show_price:res.data.is_show_price,
|
|
|
|
408
|
+ changeType:res.data.is_allow_update,
|
|
407
|
})
|
409
|
})
|
|
408
|
}
|
410
|
}
|
|
409
|
}).catch(res => {
|
411
|
}).catch(res => {
|
|
@@ -417,7 +419,69 @@ Page({ |
|
@@ -417,7 +419,69 @@ Page({ |
|
417
|
},
|
419
|
},
|
|
418
|
// 菜品更换
|
420
|
// 菜品更换
|
|
419
|
continueOrdering() {
|
421
|
continueOrdering() {
|
|
420
|
- this.myToast.showToast('您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。',3000)
|
422
|
+ if (this.data.changeType == '1') {
|
|
|
|
423
|
+ return this.myToast.showToast('您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。', 3000)
|
|
|
|
424
|
+ }
|
|
|
|
425
|
+ App.Reserve.Detail({
|
|
|
|
426
|
+ rid: this.data.options.rid
|
|
|
|
427
|
+ }).then(res => {
|
|
|
|
428
|
+ let daily = res.data.seller.daily
|
|
|
|
429
|
+ let str = ''
|
|
|
|
430
|
+ switch (res.data.ddate_solt) {
|
|
|
|
431
|
+ case '1':
|
|
|
|
432
|
+ str = 'morning'
|
|
|
|
433
|
+ break;
|
|
|
|
434
|
+ case '2':
|
|
|
|
435
|
+ str = 'noon'
|
|
|
|
436
|
+ break;
|
|
|
|
437
|
+ case '3':
|
|
|
|
438
|
+ str = 'night'
|
|
|
|
439
|
+ break;
|
|
|
|
440
|
+ }
|
|
|
|
441
|
+ const currentTimestamp = Date.now();
|
|
|
|
442
|
+ let dur;
|
|
|
|
443
|
+ Object.keys(daily).forEach(k => {
|
|
|
|
444
|
+ if (k == str) {
|
|
|
|
445
|
+ dur = daily[k].split('-')[0];
|
|
|
|
446
|
+ }
|
|
|
|
447
|
+ })
|
|
|
|
448
|
+ let ddate = util.unixtoTime(this.data.seller.reserev.ddate, 'YYYY-MM-DD');
|
|
|
|
449
|
+ const dateTimeString = `${ddate}T${dur}:00`;
|
|
|
|
450
|
+ const timestamp = new Date(dateTimeString).getTime();
|
|
|
|
451
|
+ let times = 0;
|
|
|
|
452
|
+ const oneHour = 60 * 60 * 1000; // 1小时的毫秒数
|
|
|
|
453
|
+ const twoHours = 2 * oneHour; // 2小时的毫秒数
|
|
|
|
454
|
+ const oneDay = 24 * 60 * 60 * 1000; // 1天的毫秒数
|
|
|
|
455
|
+ const twoDays = 2 * oneDay; // 2天的毫秒数
|
|
|
|
456
|
+ switch (this.data.changeType) {
|
|
|
|
457
|
+ case '2':
|
|
|
|
458
|
+ times = timestamp - oneHour;
|
|
|
|
459
|
+ break;
|
|
|
|
460
|
+ case '3':
|
|
|
|
461
|
+ times = timestamp - twoHours;
|
|
|
|
462
|
+ break;
|
|
|
|
463
|
+ case '4':
|
|
|
|
464
|
+ times = timestamp - oneDay;
|
|
|
|
465
|
+ break;
|
|
|
|
466
|
+ case '5':
|
|
|
|
467
|
+ times = timestamp - twoDays;
|
|
|
|
468
|
+ break;
|
|
|
|
469
|
+ }
|
|
|
|
470
|
+ if (currentTimestamp >= times) {
|
|
|
|
471
|
+ return this.myToast.showToast('您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。', 3000)
|
|
|
|
472
|
+ } else {
|
|
|
|
473
|
+ let url = util.http_build_query({
|
|
|
|
474
|
+ sid: this.data.options.sid,
|
|
|
|
475
|
+ sellerName: this.data.options.sellerName,
|
|
|
|
476
|
+ rid: this.data.options.rid,
|
|
|
|
477
|
+ oid: this.data.options.oid,
|
|
|
|
478
|
+ identity: '1',
|
|
|
|
479
|
+ }, '/pack-cookbook/pages/index_new')
|
|
|
|
480
|
+ wx.redirectTo({
|
|
|
|
481
|
+ url
|
|
|
|
482
|
+ })
|
|
|
|
483
|
+ }
|
|
|
|
484
|
+ })
|
|
421
|
},
|
485
|
},
|
|
422
|
// 点击了解更多会员优惠政策
|
486
|
// 点击了解更多会员优惠政策
|
|
423
|
gotoFavourableList() {
|
487
|
gotoFavourableList() {
|
|
@@ -462,6 +526,7 @@ Page({ |
|
@@ -462,6 +526,7 @@ Page({ |
|
462
|
date: dateSmart,
|
526
|
date: dateSmart,
|
|
463
|
tableNum,
|
527
|
tableNum,
|
|
464
|
tablesText,
|
528
|
tablesText,
|
|
|
|
529
|
+ reserev,
|
|
465
|
map_address:reserev.seller.map_address,
|
530
|
map_address:reserev.seller.map_address,
|
|
466
|
}
|
531
|
}
|
|
467
|
})
|
532
|
})
|