feat(order): 优化订单备注结构及线下付款状态显示
- 门店订单修改金额时,修改原因从追加 comments 改为保存 merchantRemarks 字段 - ShopOrder 和 OrderCreateRequest 接口新增 buyerRemarks 和 merchantRemarks 字段,实现订单备注字段分离 - 结算页由 comments 注入变更为 buyerRemarks,门店订单列表新增买家备注展示块 - 修复线下付款订单状态显示:统一线下付款(payType=9)与货到付款(payType=8)的待发货状态显示 - 取消按钮逻辑优化,已付款订单不显示取消按钮,文案由"关闭订单"改为"取消订单" - 订单列表和详情页弹窗标题及提示文案更新,确保状态描述准确,提升用户体验
This commit is contained in:
@@ -26,11 +26,8 @@ const getCardStatus = (order: ShopOrder): { text: string; color: string } => {
|
||||
// 终态:orderStatus=1 必须最先判断,盖过 deliveryStatus/payStatus
|
||||
if (orderStatus === 1) return { text: '已完成', color: '#0e932e' }
|
||||
|
||||
// 线下付款·待确认:下单后等待商家确认收款
|
||||
if (isOffline && !payStatus) return { text: '线下付款·待确认', color: '#ff7d00' }
|
||||
// 货到付款:payStatus=true 直接进入待发货
|
||||
if (!payStatus && !isCod) return { text: '待付款', color: '#ee0a24' }
|
||||
if (isCod && deliveryStatus === 10) return { text: '货到付款·待发货', color: '#4b9cf5' }
|
||||
// 货到付款(8)/线下付款(9):无需在线支付,下单即进入发货流程
|
||||
if (!payStatus && !isCod && !isOffline) return { text: '待付款', color: '#ee0a24' }
|
||||
if (deliveryStatus === 10) return { text: '待发货', color: '#4b9cf5' }
|
||||
if (deliveryStatus === 20) return { text: '待收货', color: '#4b9cf5' }
|
||||
if (deliveryStatus === 30) return { text: '已收货', color: '#0e932e' }
|
||||
@@ -54,8 +51,9 @@ const OrderCard: React.FC<OrderCardProps> = ({ order, onClick, onCloseOrder }) =
|
||||
|
||||
const { text: statusText, color: statusColor } = getCardStatus(order)
|
||||
|
||||
// 待发货状态(deliveryStatus=10 未发货)才显示关闭订单按钮
|
||||
const showCloseButton = order.deliveryStatus === 10 && order.orderStatus !== 2 && order.orderStatus !== 3
|
||||
// 仅未付款/待确认收款的订单(payStatus=false)才显示取消按钮
|
||||
// 已付款的待发货订单需到详情页申请退款
|
||||
const showCloseButton = order.deliveryStatus === 10 && !order.payStatus && order.orderStatus !== 2 && order.orderStatus !== 3
|
||||
|
||||
// 获取首个商品图片作为封面,或显示默认占位
|
||||
const coverImage = order.orderGoods?.[0]?.image || ''
|
||||
@@ -157,7 +155,7 @@ const OrderCard: React.FC<OrderCardProps> = ({ order, onClick, onCloseOrder }) =
|
||||
className='px-3 py-1 rounded-full border border-gray-300'
|
||||
onClick={handleClose}
|
||||
>
|
||||
<Text className='text-xs text-gray-600'>关闭订单</Text>
|
||||
<Text className='text-xs text-gray-600'>取消订单</Text>
|
||||
</View>
|
||||
</View>
|
||||
)}
|
||||
|
||||
Reference in New Issue
Block a user