diff --git a/src/pages/order/return.vue b/src/pages/order/return.vue index 9bc8d95..b873d6b 100644 --- a/src/pages/order/return.vue +++ b/src/pages/order/return.vue @@ -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 } - uni.showToast({ title: '退货成功', icon: 'success' }) - // TODO: 调用后端创建退货订单 - this.closePopup() - this.loadReturnableGoods() + + try { + await orderApi.refundOrder(this.currentItem.orderId) + uni.showToast({ title: '退货成功', icon: 'success' }) + this.closePopup() + this.loadReturnableGoods() + } catch (e) { + console.error(e) + uni.showToast({ title: e.message || '退货失败', icon: 'none' }) + } } } }