|
|
|
@ -348,7 +348,15 @@ |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="now-make-inline-tip" v-if="isPaotui ==false && !isStoreGroupOrder"> |
|
|
|
如果选择“否”,后续可在订单详情页面再次点击“立即出餐”提示商家出餐 |
|
|
|
选择“否”需预约用餐时间,系统会在用餐前30分钟提醒商家出餐 |
|
|
|
</view> |
|
|
|
<view class="fee-row" v-if="isPaotui == false && !isStoreGroupOrder && nowMake === false" @tap="openPickupTimePicker"> |
|
|
|
<view class="fee-label"> |
|
|
|
用餐时间 |
|
|
|
</view> |
|
|
|
<view class="pickup-time-value" :class="{'pickup-time-placeholder': !formData.deliveryTime}"> |
|
|
|
{{formData.deliveryTime || '选择时间 >'}} |
|
|
|
</view> |
|
|
|
</view> |
|
|
|
<view class="fee-row" v-if="isPaotui == false && !isStoreGroupOrder"> |
|
|
|
<view class="fee-label"> |
|
|
|
@ -445,7 +453,7 @@ |
|
|
|
<view class="now-make-popup-title">是否立即出餐</view> |
|
|
|
<view class="now-make-popup-desc">请选择是否需要商家立即出餐。</view> |
|
|
|
<view class="now-make-popup-tip"> |
|
|
|
如果选择“否”,后续可在订单详情页面再次点击“立即出餐”提示商家出餐 |
|
|
|
选择“否”后需要预约用餐时间,系统会在用餐前30分钟通知商家并打印小票 |
|
|
|
</view> |
|
|
|
<view class="now-make-popup-actions"> |
|
|
|
<view class="now-make-popup-cancel" @tap="confirmNowMake(false)">否</view> |
|
|
|
@ -596,7 +604,7 @@ |
|
|
|
</view> |
|
|
|
</uni-popup> |
|
|
|
<delivery-time-op @timeCallback="timeCallback" :dodge="false" ref='model' :content="content" :barHidth='600' |
|
|
|
title="选择送达时间"> |
|
|
|
:title="timePickerTitle"> |
|
|
|
> </delivery-time-op> |
|
|
|
<view class="free-order-mask" v-if="freeOrderEffectVisible" @tap.stop="closeFreeOrderEffect"> |
|
|
|
<view class="free-order-card" @tap.stop> |
|
|
|
@ -649,6 +657,7 @@ |
|
|
|
deliveryTime: '', |
|
|
|
peisongyuan: '' |
|
|
|
}, |
|
|
|
timePickerScene: 'delivery', |
|
|
|
nowMake:null, |
|
|
|
pageToastText: '', |
|
|
|
pageToastTimer: null, |
|
|
|
@ -777,6 +786,12 @@ |
|
|
|
shouldChooseNowMake() { |
|
|
|
return this.isPaotui == false && !this.isStoreGroupOrder; |
|
|
|
}, |
|
|
|
needsPickupAppointment() { |
|
|
|
return this.shouldChooseNowMake && this.nowMake === false; |
|
|
|
}, |
|
|
|
timePickerTitle() { |
|
|
|
return this.timePickerScene === 'pickup' ? '选择用餐时间' : '选择送达时间'; |
|
|
|
}, |
|
|
|
highFloorFeeCalc() { |
|
|
|
if (this.selected === 'shopDelivery') return 0; |
|
|
|
if (this.selected === 'zhiding' && this.assignedWorker) { |
|
|
|
@ -1003,6 +1018,11 @@ |
|
|
|
methods: { |
|
|
|
checkNowMake(value){ |
|
|
|
this.nowMake = value; |
|
|
|
if (value === true) { |
|
|
|
this.formData.isImmediately = true; |
|
|
|
return; |
|
|
|
} |
|
|
|
this.openPickupTimePicker(); |
|
|
|
}, |
|
|
|
openNowMakePopup() { |
|
|
|
this.$refs.nowMakePopup.open('center'); |
|
|
|
@ -1011,9 +1031,19 @@ |
|
|
|
this.nowMake = value; |
|
|
|
this.$refs.nowMakePopup.close(); |
|
|
|
this.$nextTick(() => { |
|
|
|
this.submitOrderToBackend(); |
|
|
|
if (value === false) { |
|
|
|
this.openPickupTimePicker(); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.submitPay(); |
|
|
|
}); |
|
|
|
}, |
|
|
|
openPickupTimePicker() { |
|
|
|
this.formData.isImmediately = false; |
|
|
|
this.timePickerScene = 'pickup'; |
|
|
|
this.generateDeliveryTimes(); |
|
|
|
this.$refs.model.open(); |
|
|
|
}, |
|
|
|
checkPack(type) { |
|
|
|
if (this.isPack === type) return; |
|
|
|
this.isPack = type; |
|
|
|
@ -1334,6 +1364,13 @@ |
|
|
|
const duration = Number(this.deliveryDurationMinutes); |
|
|
|
return !isNaN(duration) && duration > 0 ? duration : 30; |
|
|
|
}, |
|
|
|
getEffectiveAppointmentLeadMinutes() { |
|
|
|
if (this.timePickerScene === 'pickup') { |
|
|
|
const cookingTime = Number(this.shopItem.shopTakeaway && this.shopItem.shopTakeaway.cookingTime ? this.shopItem.shopTakeaway.cookingTime : 0); |
|
|
|
return !isNaN(cookingTime) && cookingTime > 0 ? cookingTime : 30; |
|
|
|
} |
|
|
|
return this.getEffectiveDeliveryDurationMinutes(); |
|
|
|
}, |
|
|
|
updateImmediateTimeStr() { |
|
|
|
const now = new Date(); |
|
|
|
const startTime = new Date(now); |
|
|
|
@ -1529,6 +1566,14 @@ |
|
|
|
this.openNowMakePopup(); |
|
|
|
return; |
|
|
|
} |
|
|
|
if (this.needsPickupAppointment && !this.formData.deliveryTime) { |
|
|
|
uni.showToast({ |
|
|
|
title: '请选择用餐时间', |
|
|
|
icon: 'none' |
|
|
|
}); |
|
|
|
this.openPickupTimePicker(); |
|
|
|
return; |
|
|
|
} |
|
|
|
this.submitOrderToBackend(); |
|
|
|
}, |
|
|
|
goDetail() { |
|
|
|
@ -1585,6 +1630,7 @@ |
|
|
|
}); |
|
|
|
}, |
|
|
|
checkTime(type) { |
|
|
|
this.timePickerScene = 'delivery'; |
|
|
|
if (type === this.formData.isImmediately) { |
|
|
|
if (type === false) { |
|
|
|
this.generateDeliveryTimes() |
|
|
|
@ -1726,7 +1772,10 @@ |
|
|
|
let [h, m] = timeStr.split(':'); |
|
|
|
let targetHour = parseInt(h); |
|
|
|
let d = new Date(); |
|
|
|
if (targetHour < d.getHours()) d.setDate(d.getDate() + 1); |
|
|
|
let targetMinute = parseInt(m); |
|
|
|
if (targetHour < d.getHours() || (targetHour === d.getHours() && targetMinute <= d.getMinutes())) { |
|
|
|
d.setDate(d.getDate() + 1); |
|
|
|
} |
|
|
|
let yyyy = d.getFullYear(); |
|
|
|
let MM = String(d.getMonth() + 1).padStart(2, '0'); |
|
|
|
let DD = String(d.getDate()).padStart(2, '0'); |
|
|
|
@ -1804,7 +1853,8 @@ |
|
|
|
}; |
|
|
|
|
|
|
|
let mft = this.getMustFinishTime(); |
|
|
|
if (mft) payload.mustFinishTime = mft; |
|
|
|
if (deliveryType === 1 && mft) payload.mustFinishTime = mft; |
|
|
|
if (this.needsPickupAppointment && mft) payload.userRequireMakeTime = mft; |
|
|
|
payload.appointmentDelivery = deliveryType === 1 && this.formData.isImmediately === false ? 1 : 0; |
|
|
|
|
|
|
|
if (deliveryType === 1 && !isJoiningFaceToFace) { |
|
|
|
@ -1992,7 +2042,7 @@ |
|
|
|
|
|
|
|
// ----- 生成今天的时间列表 ----- |
|
|
|
const earliestTime = new Date(now); |
|
|
|
earliestTime.setMinutes(earliestTime.getMinutes() + this.getEffectiveDeliveryDurationMinutes()); |
|
|
|
earliestTime.setMinutes(earliestTime.getMinutes() + this.getEffectiveAppointmentLeadMinutes()); |
|
|
|
|
|
|
|
const todayStartTime = this.getNextDeliverySlot(earliestTime); |
|
|
|
const todayEndTime = this.getAppointmentEndTime(today); |
|
|
|
@ -2732,6 +2782,17 @@ |
|
|
|
font-weight: 800; |
|
|
|
} |
|
|
|
|
|
|
|
.pickup-time-value { |
|
|
|
color: $primary; |
|
|
|
font-size: 26rpx; |
|
|
|
font-weight: 800; |
|
|
|
} |
|
|
|
|
|
|
|
.pickup-time-placeholder { |
|
|
|
color: #8b9993; |
|
|
|
font-weight: normal; |
|
|
|
} |
|
|
|
|
|
|
|
.pack-options { |
|
|
|
display: flex; |
|
|
|
align-items: center; |
|
|
|
|