fix(payment): 调整货到付款支付方式及状态逻辑

- 将支付方式默认值修改为8表示货到付款
- 删除前端创建订单时对payStatus和payTime的传递,改为后端自动处理
- 更新订单详情页支付方式映射,新增多种支付方式及货到付款标识
- 修改订单状态展示逻辑,针对货到付款订单调整状态标签和流程判断
- 优化订单列表卡片状态显示,支持货到付款的特殊显示需求
- 更新订单模型注释,统一支付方式编码及对应说明
This commit is contained in:
2026-07-14 19:26:43 +08:00
parent b60e5c976a
commit a6a34da3cb
4 changed files with 32 additions and 27 deletions

View File

@@ -10,9 +10,10 @@ interface OrderCardProps {
onClick?: () => void
}
/** 综合 payStatus + deliveryStatus + orderStatus 计算列表卡片状态文案 */
/** 综合 payStatus + deliveryStatus + orderStatus + payType 计算列表卡片状态文案 */
const getCardStatus = (order: ShopOrder): { text: string; color: string } => {
const { payStatus, deliveryStatus, orderStatus } = order
const { payStatus, deliveryStatus, orderStatus, payType } = order
const isCod = payType === 8 // 货到付款
if (orderStatus === 2) return { text: '已取消', color: '#999' }
if (orderStatus === 3) return { text: '取消中', color: '#ff7d00' }
@@ -23,7 +24,9 @@ const getCardStatus = (order: ShopOrder): { text: string; color: string } => {
// 终态orderStatus=1 必须最先判断,盖过 deliveryStatus/payStatus
if (orderStatus === 1) return { text: '已完成', color: '#0e932e' }
if (!payStatus) return { text: '待付款', color: '#ee0a24' }
// 货到付款payStatus=true 直接进入待发货
if (!payStatus && !isCod) return { text: '待付款', color: '#ee0a24' }
if (isCod && deliveryStatus === 10) return { text: '货到付款·待发货', color: '#4b9cf5' }
if (deliveryStatus === 10) return { text: '待发货', color: '#4b9cf5' }
if (deliveryStatus === 20) return { text: '待收货', color: '#4b9cf5' }
if (deliveryStatus === 30) return { text: '已收货', color: '#0e932e' }