fix: 退货页面调用后端退款接口恢复库存
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Agent
2026-04-03 06:58:31 +00:00
parent 6dfc201c66
commit 756444ef2b

View File

@@ -219,15 +219,21 @@ export default {
this.returnQty++
}
},
confirmReturn() {
async confirmReturn() {
if (this.returnQty <= 0 || this.returnQty > this.currentItem.returnableQty) {
uni.showToast({ title: '退货数量无效', icon: 'none' })
return
}
try {
await orderApi.refundOrder(this.currentItem.orderId)
uni.showToast({ title: '退货成功', icon: 'success' })
// TODO: 调用后端创建退货订单
this.closePopup()
this.loadReturnableGoods()
} catch (e) {
console.error(e)
uni.showToast({ title: e.message || '退货失败', icon: 'none' })
}
}
}
}