fix(order): 修改订单确认页面的商品名称显示问题

- 将商品名称替换为固定文本“时里院子市集”
- 确保配送类型和买家备注正确传递
- 优化注释说明,确保 couponId 类型正确处理
This commit is contained in:
2025-12-25 13:04:40 +08:00
parent 253613e077
commit bc8d882104
5 changed files with 117 additions and 38 deletions

View File

@@ -40,6 +40,33 @@ const OrderDetail = () => {
}
};
// 申请退款
const handleApplyRefund = async () => {
if (order) {
try {
// 更新订单状态为"退款申请中"
await updateShopOrder({
orderId: order.orderId,
orderStatus: 4 // 退款申请中
});
// 更新本地状态
setOrder(prev => prev ? {...prev, orderStatus: 4} : null);
// 跳转到退款申请页面
Taro.navigateTo({
url: `/user/order/refund/index?orderId=${order.orderId}&orderNo=${order.orderNo}`
});
} catch (error) {
console.error('更新订单状态失败:', error);
Taro.showToast({
title: '操作失败,请重试',
icon: 'none'
});
}
}
};
const getOrderStatusText = (order: ShopOrder) => {
// 优先检查订单状态
if (order.orderStatus === 2) return '已取消';
@@ -162,7 +189,7 @@ const OrderDetail = () => {
<Space>
{!order.payStatus && <Button onClick={() => console.log('取消订单')}></Button>}
{!order.payStatus && <Button type="primary" onClick={() => console.log('立即支付')}></Button>}
{order.orderStatus === 1 && <Button onClick={() => console.log('申请退款')}>退</Button>}
{order.orderStatus === 1 && <Button onClick={handleApplyRefund}>退</Button>}
{order.deliveryStatus === 20 &&
<Button type="primary" onClick={() => console.log('确认收货')}></Button>}
</Space>