feat(store): 优化门店中心订单管理和Checkout订单创建
- Checkout创建订单时直接传递payStatus和payTime字段防止未付款订单被删除 - 门店中心Tab改为三个(全部、待处理、已完成),并合并多个statusFilter查询 - 操作按钮逻辑调整为根据订单状态判断,已完成及已关闭订单无操作和删除按钮 - 状态文案和颜色适配完善,添加订单送达凭证照片预览功能 - 确认完成操作强制上传配送凭证照片,凭证支持JSON数组格式存储 - 收款操作支持上传凭证照片并追加至备注中 - 优化订单列表加载逻辑,多个请求结果合并去重并按创建时间降序排序 - 代码格式调整及UI细节优化,提升代码一致性和用户体验
This commit is contained in:
@@ -31,7 +31,7 @@ const OP_LABEL: Record<OpType, string> = {
|
||||
|
||||
const OP_DESC: Record<OpType, string> = {
|
||||
pay: '变更支付状态为已付款',
|
||||
complete: '同时变更支付状态为已付款、发货状态为已完成、订单状态为已完成',
|
||||
complete: '同时变更支付状态为已付款、收货状态为已收货、订单状态为已完成',
|
||||
}
|
||||
|
||||
// ─── 图片上传 ─────────────────────────────────────────────────────
|
||||
@@ -114,13 +114,9 @@ function isOrderActionable(order: ShopOrder): boolean {
|
||||
function getOrderActions(order: ShopOrder): { label: string; type: OpType }[] {
|
||||
if (!isOrderActionable(order)) return []
|
||||
const actions: { label: string; type: OpType }[] = []
|
||||
// 未付款 → 可确认收款,也可直接确认完成
|
||||
if (order.payStatus === false || order.payStatus === null) {
|
||||
actions.push({label: '确认收款', type: 'pay'})
|
||||
actions.push({label: '确认完成', type: 'complete'})
|
||||
}
|
||||
// 已付款但未完成 → 可确认完成
|
||||
if (order.payStatus && order.orderStatus !== 1 && order.orderStatus !== 2) {
|
||||
// 货到付款:未付款 / 已付款 都直接"确认完成",
|
||||
// 确认完成会同时设置 payStatus=true,无需单独的"确认收款"按钮
|
||||
if (order.orderStatus !== 1 && order.orderStatus !== 2) {
|
||||
actions.push({label: '确认完成', type: 'complete'})
|
||||
}
|
||||
return actions
|
||||
@@ -276,10 +272,11 @@ export default function StoreCenterPage() {
|
||||
updateData.payStatus = true
|
||||
updateData.payTime = formatDateTime(new Date())
|
||||
} else if (opType === 'complete') {
|
||||
// 确认完成:变更支付状态为已付款、发货状态为已完成、订单状态为已完成
|
||||
// 确认完成:用户已收到货
|
||||
updateData.payStatus = true
|
||||
updateData.payTime = formatDateTime(new Date())
|
||||
updateData.deliveryStatus = 20 // 发货状态 → 已完成
|
||||
updateData.deliveryStatus = 30 // 发货状态 → 已收货
|
||||
updateData.deliveryTime = formatDateTime(new Date()) // 收货时间
|
||||
updateData.orderStatus = 1 // 订单状态 → 已完成
|
||||
updateData.sendEndImg = JSON.stringify(proofImages) // 配送员送达拍照(JSON数组)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user