|
...
|
...
|
@@ -22,6 +22,7 @@ Page({ |
|
|
|
navColor:'',
|
|
|
|
height:wx.getSystemInfoSync().windowWidth*1,
|
|
|
|
is_show_price:'',
|
|
|
|
changeType:'1',//1不允许修改 2开餐1小时之前 3开餐2小时之前 4预订日期1天前 5预订日期2天前
|
|
|
|
},
|
|
|
|
myToast :'',
|
|
|
|
imageLoad(e) {
|
|
...
|
...
|
@@ -404,6 +405,7 @@ Page({ |
|
|
|
navColor,
|
|
|
|
textsInfoColor,
|
|
|
|
is_show_price:res.data.is_show_price,
|
|
|
|
changeType:res.data.is_allow_update,
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}).catch(res => {
|
|
...
|
...
|
@@ -417,7 +419,69 @@ Page({ |
|
|
|
},
|
|
|
|
// 菜品更换
|
|
|
|
continueOrdering() {
|
|
|
|
this.myToast.showToast('您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。',3000)
|
|
|
|
if (this.data.changeType == '1') {
|
|
|
|
return this.myToast.showToast('您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。', 3000)
|
|
|
|
}
|
|
|
|
App.Reserve.Detail({
|
|
|
|
rid: this.data.options.rid
|
|
|
|
}).then(res => {
|
|
|
|
let daily = res.data.seller.daily
|
|
|
|
let str = ''
|
|
|
|
switch (res.data.ddate_solt) {
|
|
|
|
case '1':
|
|
|
|
str = 'morning'
|
|
|
|
break;
|
|
|
|
case '2':
|
|
|
|
str = 'noon'
|
|
|
|
break;
|
|
|
|
case '3':
|
|
|
|
str = 'night'
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
const currentTimestamp = Date.now();
|
|
|
|
let dur;
|
|
|
|
Object.keys(daily).forEach(k => {
|
|
|
|
if (k == str) {
|
|
|
|
dur = daily[k].split('-')[0];
|
|
|
|
}
|
|
|
|
})
|
|
|
|
let ddate = util.unixtoTime(this.data.seller.reserev.ddate, 'YYYY-MM-DD');
|
|
|
|
const dateTimeString = `${ddate}T${dur}:00`;
|
|
|
|
const timestamp = new Date(dateTimeString).getTime();
|
|
|
|
let times = 0;
|
|
|
|
const oneHour = 60 * 60 * 1000; // 1小时的毫秒数
|
|
|
|
const twoHours = 2 * oneHour; // 2小时的毫秒数
|
|
|
|
const oneDay = 24 * 60 * 60 * 1000; // 1天的毫秒数
|
|
|
|
const twoDays = 2 * oneDay; // 2天的毫秒数
|
|
|
|
switch (this.data.changeType) {
|
|
|
|
case '2':
|
|
|
|
times = timestamp - oneHour;
|
|
|
|
break;
|
|
|
|
case '3':
|
|
|
|
times = timestamp - twoHours;
|
|
|
|
break;
|
|
|
|
case '4':
|
|
|
|
times = timestamp - oneDay;
|
|
|
|
break;
|
|
|
|
case '5':
|
|
|
|
times = timestamp - twoDays;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (currentTimestamp >= times) {
|
|
|
|
return this.myToast.showToast('您的订单已经下达给商家,如果需要改菜需和商家确认,以免产生误解。', 3000)
|
|
|
|
} else {
|
|
|
|
let url = util.http_build_query({
|
|
|
|
sid: this.data.options.sid,
|
|
|
|
sellerName: this.data.options.sellerName,
|
|
|
|
rid: this.data.options.rid,
|
|
|
|
oid: this.data.options.oid,
|
|
|
|
identity: '1',
|
|
|
|
}, '/pack-cookbook/pages/index_new')
|
|
|
|
wx.redirectTo({
|
|
|
|
url
|
|
|
|
})
|
|
|
|
}
|
|
|
|
})
|
|
|
|
},
|
|
|
|
// 点击了解更多会员优惠政策
|
|
|
|
gotoFavourableList() {
|
|
...
|
...
|
@@ -462,6 +526,7 @@ Page({ |
|
|
|
date: dateSmart,
|
|
|
|
tableNum,
|
|
|
|
tablesText,
|
|
|
|
reserev,
|
|
|
|
map_address:reserev.seller.map_address,
|
|
|
|
}
|
|
|
|
})
|
...
|
...
|
|