fix(order): 优化订单状态判断与收货流程
- 移除货到付款场景下的"确认收款"按钮,统一使用"确认完成"操作设置 payStatus=true - 确认完成时新增设置 deliveryStatus=30(已收货)和 deliveryTime,保持与后台确认收货逻辑一致 - sendEndImg 字段改为 JSON 数组格式,兼容多图保存,避免 OSS URL 中逗号解析错误 - 修复 OrderCard.getCardStatus 判断顺序错误,确保 orderStatus=1(已完成)优先判定,区分已收货和待收货状态显示颜色与文案
This commit is contained in:
@@ -56,3 +56,9 @@
|
|||||||
- 已完成/已关闭订单:无操作按钮,无删除按钮
|
- 已完成/已关闭订单:无操作按钮,无删除按钮
|
||||||
- 其他订单:显示"确认收款"/"确认完成"和"删除订单"
|
- 其他订单:显示"确认收款"/"确认完成"和"删除订单"
|
||||||
- 状态文案完善:已完成、已关闭、待收款、待发货、待收货、进行中
|
- 状态文案完善:已完成、已关闭、待收款、待发货、待收货、进行中
|
||||||
|
- 移除"确认收款"按钮:货到付款场景下,"确认完成"操作已包含 `payStatus=true` 设置,无需单独的"确认收款"入口
|
||||||
|
- 确认完成时设置 `deliveryStatus=30`(已收货)+ `deliveryTime`(收货时间),与后台"确认收货"逻辑对齐
|
||||||
|
- `sendEndImg` 用 JSON 数组保存多张图片(避免 OSS URL 中 `,` 解析错误),解析时兼容旧逗号分隔数据
|
||||||
|
- 修复 `OrderCard.getCardStatus` 状态判断顺序 bug:
|
||||||
|
- 旧逻辑:先判 `deliveryStatus=30` → "待收货",导致 `orderStatus=1` 的"已完成"订单状态栏错显示"待收货"
|
||||||
|
- 新逻辑:`orderStatus=1`(已完成)作为终态最先判断;`deliveryStatus=30` 单独显示"已收货"(绿色),与"待收货"(蓝色)区分
|
||||||
|
|||||||
@@ -19,10 +19,13 @@ const getCardStatus = (order: ShopOrder): { text: string; color: string } => {
|
|||||||
if (orderStatus === 4 || orderStatus === 7) return { text: '退款申请中', color: '#ee0a24' }
|
if (orderStatus === 4 || orderStatus === 7) return { text: '退款申请中', color: '#ee0a24' }
|
||||||
if (orderStatus === 5) return { text: '退款被拒绝', color: '#ee0a24' }
|
if (orderStatus === 5) return { text: '退款被拒绝', color: '#ee0a24' }
|
||||||
|
|
||||||
|
// 终态:orderStatus=1 必须最先判断,盖过 deliveryStatus/payStatus
|
||||||
|
if (orderStatus === 1) return { text: '已完成', color: '#0e932e' }
|
||||||
|
|
||||||
if (!payStatus) return { text: '待付款', color: '#ee0a24' }
|
if (!payStatus) return { text: '待付款', color: '#ee0a24' }
|
||||||
if (deliveryStatus === 10) return { text: '待发货', color: '#4b9cf5' }
|
if (deliveryStatus === 10) return { text: '待发货', color: '#4b9cf5' }
|
||||||
if (deliveryStatus === 20 || deliveryStatus === 30) return { text: '待收货', color: '#4b9cf5' }
|
if (deliveryStatus === 20) return { text: '待收货', color: '#4b9cf5' }
|
||||||
if (orderStatus === 1) return { text: '已完成', color: '#0e932e' }
|
if (deliveryStatus === 30) return { text: '已收货', color: '#0e932e' }
|
||||||
|
|
||||||
return { text: '已付款', color: '#0e932e' }
|
return { text: '已付款', color: '#0e932e' }
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user