|
...
|
...
|
@@ -19,11 +19,15 @@ Page({ |
|
|
|
},
|
|
|
|
id: null,
|
|
|
|
tpls: TP.tpls(),
|
|
|
|
hasGetSellerDetail:false,
|
|
|
|
/**
|
|
|
|
* 生命周期函数--监听页面加载
|
|
|
|
*/
|
|
|
|
onLoad: function (options) {
|
|
|
|
this.id = options.id;
|
|
|
|
if(!options.firstShowMsg){
|
|
|
|
this.hasGetSellerDetail=true
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
firstShowMsg:options.firstShowMsg,
|
|
|
|
})
|
|
...
|
...
|
@@ -68,13 +72,39 @@ Page({ |
|
|
|
App.Reserve.Detail({
|
|
|
|
openid: getApp().openid,
|
|
|
|
rid: this.id
|
|
|
|
}).then(res => {
|
|
|
|
}).then(async res => {
|
|
|
|
this.detail=this.formatDatail(res.data)
|
|
|
|
this.detail.ddate_solt=Number(this.detail.ddate_solt);
|
|
|
|
this.setData({
|
|
|
|
detail: this.detail,
|
|
|
|
hasOnlineReserve:res.data.type==1,
|
|
|
|
})
|
|
|
|
if(this.hasGetSellerDetail){
|
|
|
|
let sellerRes=await App.Customer.GetSellerDetail({sid:this.detail.sid})
|
|
|
|
let seller=sellerRes.data
|
|
|
|
let flag=false,stime='',etime='',time=parseInt(new Date()/1000)
|
|
|
|
let today=util.unixtoTime(time,"YYYY-MM-DD")
|
|
|
|
stime=util.timetouUnix(today+' '+seller.rec_stime+':00')
|
|
|
|
etime=util.timetouUnix(today+' '+seller.rec_etime+':00')
|
|
|
|
if(etime<=stime){
|
|
|
|
if(time<=etime){
|
|
|
|
flag=true
|
|
|
|
}
|
|
|
|
etime+=86400
|
|
|
|
}
|
|
|
|
if(!flag){
|
|
|
|
if(time>=stime && time<=etime){
|
|
|
|
flag=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let firstShowMsg='预计10分钟左右餐厅将告知您结果(请留意短息或微信通知)'
|
|
|
|
if(!flag){
|
|
|
|
firstShowMsg=seller.rec_stime
|
|
|
|
}
|
|
|
|
this.setData({
|
|
|
|
firstShowMsg:firstShowMsg,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
formatDatail(detail) {
|
...
|
...
|
|