|
@@ -19,11 +19,15 @@ Page({ |
|
@@ -19,11 +19,15 @@ Page({ |
|
19
|
},
|
19
|
},
|
|
20
|
id: null,
|
20
|
id: null,
|
|
21
|
tpls: TP.tpls(),
|
21
|
tpls: TP.tpls(),
|
|
|
|
22
|
+ hasGetSellerDetail:false,
|
|
22
|
/**
|
23
|
/**
|
|
23
|
* 生命周期函数--监听页面加载
|
24
|
* 生命周期函数--监听页面加载
|
|
24
|
*/
|
25
|
*/
|
|
25
|
onLoad: function (options) {
|
26
|
onLoad: function (options) {
|
|
26
|
this.id = options.id;
|
27
|
this.id = options.id;
|
|
|
|
28
|
+ if(!options.firstShowMsg){
|
|
|
|
29
|
+ this.hasGetSellerDetail=true
|
|
|
|
30
|
+ }
|
|
27
|
this.setData({
|
31
|
this.setData({
|
|
28
|
firstShowMsg:options.firstShowMsg,
|
32
|
firstShowMsg:options.firstShowMsg,
|
|
29
|
})
|
33
|
})
|
|
@@ -68,13 +72,39 @@ Page({ |
|
@@ -68,13 +72,39 @@ Page({ |
|
68
|
App.Reserve.Detail({
|
72
|
App.Reserve.Detail({
|
|
69
|
openid: getApp().openid,
|
73
|
openid: getApp().openid,
|
|
70
|
rid: this.id
|
74
|
rid: this.id
|
|
71
|
- }).then(res => {
|
75
|
+ }).then(async res => {
|
|
72
|
this.detail=this.formatDatail(res.data)
|
76
|
this.detail=this.formatDatail(res.data)
|
|
73
|
this.detail.ddate_solt=Number(this.detail.ddate_solt);
|
77
|
this.detail.ddate_solt=Number(this.detail.ddate_solt);
|
|
74
|
this.setData({
|
78
|
this.setData({
|
|
75
|
detail: this.detail,
|
79
|
detail: this.detail,
|
|
76
|
hasOnlineReserve:res.data.type==1,
|
80
|
hasOnlineReserve:res.data.type==1,
|
|
77
|
})
|
81
|
})
|
|
|
|
82
|
+ if(this.hasGetSellerDetail){
|
|
|
|
83
|
+ let sellerRes=await App.Customer.GetSellerDetail({sid:this.detail.sid})
|
|
|
|
84
|
+ let seller=sellerRes.data
|
|
|
|
85
|
+ let flag=false,stime='',etime='',time=parseInt(new Date()/1000)
|
|
|
|
86
|
+ let today=util.unixtoTime(time,"YYYY-MM-DD")
|
|
|
|
87
|
+ stime=util.timetouUnix(today+' '+seller.rec_stime+':00')
|
|
|
|
88
|
+ etime=util.timetouUnix(today+' '+seller.rec_etime+':00')
|
|
|
|
89
|
+ if(etime<=stime){
|
|
|
|
90
|
+ if(time<=etime){
|
|
|
|
91
|
+ flag=true
|
|
|
|
92
|
+ }
|
|
|
|
93
|
+ etime+=86400
|
|
|
|
94
|
+ }
|
|
|
|
95
|
+ if(!flag){
|
|
|
|
96
|
+ if(time>=stime && time<=etime){
|
|
|
|
97
|
+ flag=true;
|
|
|
|
98
|
+ }
|
|
|
|
99
|
+ }
|
|
|
|
100
|
+ let firstShowMsg='预计10分钟左右餐厅将告知您结果(请留意短息或微信通知)'
|
|
|
|
101
|
+ if(!flag){
|
|
|
|
102
|
+ firstShowMsg=seller.rec_stime
|
|
|
|
103
|
+ }
|
|
|
|
104
|
+ this.setData({
|
|
|
|
105
|
+ firstShowMsg:firstShowMsg,
|
|
|
|
106
|
+ })
|
|
|
|
107
|
+ }
|
|
78
|
})
|
108
|
})
|
|
79
|
},
|
109
|
},
|
|
80
|
formatDatail(detail) {
|
110
|
formatDatail(detail) {
|