This commit is contained in:
@@ -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' })
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user