forked from gxwebsoft/mp-10550
feat(order): 添加配送时间选择功能
- 在订单模型中新增 sendStartTime 字段用于预约配送时间 - 为水票套票商品添加配送时间选择器组件和日期选择逻辑 - 实现配送时间验证确保水票套票商品必须选择配送时间 - 优化支付错误处理增加配送范围提示和地址更换引导 - 调整套票购买注意事项显示动态最低起送量信息 - 移除用户票据页面重复的时间选择相关代码以保持一致性
This commit is contained in:
@@ -372,6 +372,17 @@ export class PaymentHandler {
|
||||
|
||||
const message = error.message;
|
||||
|
||||
// 配送范围/电子围栏相关错误(优先于“地址信息有误”的兜底)
|
||||
if (
|
||||
message.includes('不在配送范围') ||
|
||||
message.includes('配送范围') ||
|
||||
message.includes('电子围栏') ||
|
||||
message.includes('围栏')
|
||||
) {
|
||||
// Toast 文案尽量短(小程序 showToast 标题长度有限),更详细的引导可在业务页面用 Modal 呈现。
|
||||
return '暂不支持配送';
|
||||
}
|
||||
|
||||
// 余额相关错误
|
||||
if (message.includes('余额不足') || message.includes('balance')) {
|
||||
return '账户余额不足,请充值后重试';
|
||||
@@ -453,6 +464,7 @@ export function buildSingleGoodsOrder(
|
||||
skuId?: number;
|
||||
specInfo?: string;
|
||||
buyerRemarks?: string;
|
||||
sendStartTime?: string;
|
||||
}
|
||||
): OrderCreateRequest {
|
||||
return {
|
||||
@@ -467,6 +479,7 @@ export function buildSingleGoodsOrder(
|
||||
addressId,
|
||||
payType: PaymentType.WECHAT, // 默认微信支付,会被PaymentHandler覆盖
|
||||
comments: options?.buyerRemarks || options?.comments || '',
|
||||
sendStartTime: options?.sendStartTime,
|
||||
deliveryType: options?.deliveryType || 0,
|
||||
couponId: options?.couponId,
|
||||
selfTakeMerchantId: options?.selfTakeMerchantId
|
||||
|
||||
Reference in New Issue
Block a user