fix(order): 统一线下付款已发货未付款状态显示
- 用户端订单卡的已发货待收款状态调整,线下付款且未付款状态显示红色标识 - 用户端订单详情新增该状态的红色展示和提示信息 - 门店端订单列表状态文案和颜色同步更新,保持与用户端一致 - 门店端订单操作按钮逻辑调整,未付款已发货订单显示“确认完成”按钮 - 解决线下付款先发货后付款订单的状态显示和按钮操作不一致问题
This commit is contained in:
@@ -25,6 +25,9 @@ const getCardStatus = (order: ShopOrder): { text: string; color: string } => {
|
||||
// 终态:orderStatus=1 必须最先判断,盖过 deliveryStatus/payStatus
|
||||
if (orderStatus === 1) return { text: '已完成', color: '#0e932e' }
|
||||
|
||||
// 线下付款(9)已发货但未确认收款:显示"已发货待收款"(红色),与门店端一致
|
||||
if (!payStatus && payType === 9 && deliveryStatus === 20) return { text: '已发货待收款', color: '#ee0a24' }
|
||||
|
||||
// 物流状态优先于付款状态(已发货/已收货的订单,即使未付款也显示物流状态)
|
||||
if (deliveryStatus === 20) return { text: '待收货', color: '#4b9cf5' }
|
||||
if (deliveryStatus === 30) return { text: '已收货', color: '#0e932e' }
|
||||
|
||||
@@ -71,6 +71,11 @@ const getOrderDisplayStatus = (order: ShopOrder): { title: string; bgColor: stri
|
||||
return { bgColor: '#ee0a24', title: '退款被拒绝', subtitle: '退款申请已被拒绝' }
|
||||
}
|
||||
|
||||
// 线下付款已发货但未确认收款:显示"已发货待收款"(红色),与门店端一致
|
||||
if (isOffline && !payStatus && (deliveryStatus === 20 || deliveryStatus === 30)) {
|
||||
return { bgColor: '#ee0a24', title: '已发货待收款', subtitle: '商品已发货,请尽快转账付款' }
|
||||
}
|
||||
|
||||
// 物流状态优先于付款状态(已发货/已收货的订单,即使未付款也显示物流状态)
|
||||
if (deliveryStatus === 20 || deliveryStatus === 30) {
|
||||
return { bgColor: '#4b9cf5', title: '待收货', subtitle: '商品运输中,请注意查收' }
|
||||
|
||||
@@ -100,22 +100,25 @@ function parseSendEndImg(raw: string): string[] {
|
||||
function getStatusText(order: ShopOrder): string {
|
||||
if (order.orderStatus === 1) return '已完成'
|
||||
if (order.orderStatus === 2) return '已关闭'
|
||||
// 线下付款·已发货待收款(先发货后结款)
|
||||
if (order.payType === 9 && order.deliveryStatus === 20) return '已发货待收款'
|
||||
if (order.payStatus === false || order.payStatus === null) {
|
||||
// 线下付款·已发货待收款(先发货后结款)
|
||||
if (order.payType === 9 && order.deliveryStatus === 20) return '已发货待收款'
|
||||
// 线下付款待确认收款
|
||||
if (order.payType === 9) return '待确认收款'
|
||||
return '待收款'
|
||||
// 线下付款待确认收款
|
||||
if (order.payType === 9) return '待确认收款'
|
||||
return '待收款'
|
||||
}
|
||||
if (order.payStatus && order.deliveryStatus === 10) return '待发货'
|
||||
if (order.payStatus && order.deliveryStatus === 20) return '待收货'
|
||||
if (order.payStatus && order.deliveryStatus === 10) return '待发货'
|
||||
return '进行中'
|
||||
}
|
||||
|
||||
function getStatusColor(order: ShopOrder): string {
|
||||
if (order.orderStatus === 1) return '#0e932e'
|
||||
if (order.orderStatus === 2) return '#999'
|
||||
// 已发货待收款:红色(与用户端一致)
|
||||
if (order.payType === 9 && order.deliveryStatus === 20) return '#ee0a24'
|
||||
if (order.payStatus === false || order.payStatus === null) return '#ee0a24'
|
||||
if (order.deliveryStatus === 20) return '#4b9cf5'
|
||||
if (order.payStatus) return '#ff7d00'
|
||||
return '#999'
|
||||
}
|
||||
@@ -131,7 +134,7 @@ function getOrderActions(order: ShopOrder): { label: string; type: OpType }[] {
|
||||
const actions: { label: string; type: OpType }[] = []
|
||||
// 修改金额:仅在确认收款前显示(未付款时才可改价)
|
||||
if (!order.payStatus) {
|
||||
actions.push({label: '修改金额', type: 'editPrice'})
|
||||
actions.push({label: '改价', type: 'editPrice'})
|
||||
}
|
||||
// 线下付款·待确认收款:显示"确认收款"按钮
|
||||
if (!order.payStatus && order.payType === 9 && order.orderStatus === 0) {
|
||||
@@ -146,8 +149,9 @@ function getOrderActions(order: ShopOrder): { label: string; type: OpType }[] {
|
||||
actions.push({label: '发货', type: 'ship'})
|
||||
}
|
||||
}
|
||||
// 确认完成:仅在确认收款后显示(已付款才能确认完成)
|
||||
if (order.payStatus) {
|
||||
// 确认完成:已发货即可确认完成(无论是否付款,线下付款先发货后结款场景也需要上传送达照片)
|
||||
const shipped = order.deliveryStatus != null && order.deliveryStatus >= 20
|
||||
if (shipped) {
|
||||
actions.push({label: '确认完成', type: 'complete'})
|
||||
}
|
||||
return actions
|
||||
|
||||
Reference in New Issue
Block a user