forked from gxwebsoft/mp-10550
feat(order): 添加配送时间选择功能
- 在订单模型中新增 sendStartTime 字段用于预约配送时间 - 为水票套票商品添加配送时间选择器组件和日期选择逻辑 - 实现配送时间验证确保水票套票商品必须选择配送时间 - 优化支付错误处理增加配送范围提示和地址更换引导 - 调整套票购买注意事项显示动态最低起送量信息 - 移除用户票据页面重复的时间选择相关代码以保持一致性
This commit is contained in:
@@ -6,7 +6,6 @@ import {
|
||||
Cell,
|
||||
CellGroup,
|
||||
ConfigProvider,
|
||||
DatePicker,
|
||||
Input,
|
||||
InputNumber,
|
||||
Popup,
|
||||
@@ -41,8 +40,7 @@ const OrderConfirm = () => {
|
||||
const [quantity, setQuantity] = useState<number>(MIN_START_QTY)
|
||||
const [orderRemark, setOrderRemark] = useState<string>('')
|
||||
// Delivery date only (no hour/min selection).
|
||||
const [sendTime, setSendTime] = useState<Date>(() => dayjs().startOf('day').toDate())
|
||||
const [sendTimePickerVisible, setSendTimePickerVisible] = useState(false)
|
||||
const [sendTime] = useState<Date>(() => dayjs().startOf('day').toDate())
|
||||
const [loading, setLoading] = useState<boolean>(true)
|
||||
const [error, setError] = useState<string>('')
|
||||
const [submitLoading, setSubmitLoading] = useState<boolean>(false)
|
||||
@@ -705,10 +703,8 @@ const OrderConfirm = () => {
|
||||
extra={(
|
||||
<View className={'flex items-center gap-2'}>
|
||||
<View className={'text-gray-900'}>{sendTimeText}</View>
|
||||
<ArrowRight className={'text-gray-400'} size={14}/>
|
||||
</View>
|
||||
)}
|
||||
onClick={() => setSendTimePickerVisible(true)}
|
||||
/>
|
||||
</CellGroup>
|
||||
|
||||
@@ -883,23 +879,6 @@ const OrderConfirm = () => {
|
||||
|
||||
<Gap height={50}/>
|
||||
|
||||
<DatePicker
|
||||
visible={sendTimePickerVisible}
|
||||
title="选择配送时间"
|
||||
type="date"
|
||||
startDate={dayjs().startOf('day').toDate()}
|
||||
endDate={dayjs().add(30, 'day').toDate()}
|
||||
value={sendTime}
|
||||
onClose={() => setSendTimePickerVisible(false)}
|
||||
onCancel={() => setSendTimePickerVisible(false)}
|
||||
onConfirm={(_options, selectedValue) => {
|
||||
const [y, m, d] = (selectedValue || []).map(v => Number(v))
|
||||
const next = new Date(y, (m || 1) - 1, d || 1, 0, 0, 0)
|
||||
setSendTime(next)
|
||||
setSendTimePickerVisible(false)
|
||||
}}
|
||||
/>
|
||||
|
||||
<div className={'fixed z-50 bg-white w-full bottom-0 left-0 pt-4 pb-10 border-t border-gray-200'}>
|
||||
<View className={'btn-bar flex justify-between items-center'}>
|
||||
<div className={'flex flex-col justify-center items-start mx-4'}>
|
||||
|
||||
Reference in New Issue
Block a user