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

@@ -13,6 +13,8 @@ import {
Empty,
InputNumber
} from '@nutui/nutui-react-taro'
import { applyAfterSale } from '@/api/afterSale'
import { updateShopOrder } from '@/api/shop/shopOrder'
import './index.scss'
// 订单商品信息
@@ -232,23 +234,55 @@ const RefundPage: React.FC = () => {
setSubmitting(true)
// 模拟API调用
await new Promise(resolve => setTimeout(resolve, 2000))
// 构造请求参数
const params = {
orderId: orderId || '',
type: 'refund' as const,
reason: refundApp.refundReason,
description: refundApp.refundDescription,
amount: refundApp.refundAmount,
contactPhone: refundApp.contactPhone,
evidenceImages: refundApp.evidenceImages,
goodsItems: refundApp.refundGoods.filter(item => item.refundNum > 0).map(item => ({
goodsId: item.goodsId,
quantity: item.refundNum
}))
}
Taro.showToast({
title: '退款申请提交成功',
icon: 'success'
})
// 调用API提交退款申请
const result = await applyAfterSale(params)
if (result.success) {
// 更新订单状态为"退款申请中"
if (orderId) {
try {
await updateShopOrder({
orderId: parseInt(orderId),
orderStatus: 4 // 退款申请中
})
} catch (updateError) {
console.error('更新订单状态失败:', updateError)
// 即使更新订单状态失败,也继续执行后续操作
}
}
// 延迟返回上一页
setTimeout(() => {
Taro.navigateBack()
}, 1500)
Taro.showToast({
title: '退款申请提交成功',
icon: 'success'
})
// 延迟返回上一页
setTimeout(() => {
Taro.navigateBack()
}, 1500)
} else {
throw new Error(result.message || '提交失败')
}
} catch (error) {
console.error('提交退款申请失败:', error)
Taro.showToast({
title: '提交失败,请重试',
title: error instanceof Error ? error.message : '提交失败,请重试',
icon: 'none'
})
} finally {
@@ -420,4 +454,4 @@ const RefundPage: React.FC = () => {
)
}
export default RefundPage
export default RefundPage