|
@@ -432,7 +432,14 @@ const handleScanInput = (event: KeyboardEvent) => {
|
|
|
orderPay({ oid: params.number, code: code })
|
|
|
.then((res) => {
|
|
|
console.log(res)
|
|
|
- if (res != null) {
|
|
|
+ // 实际上支付成功之后,res返回的是[],如果不是实时成功,返回的是个对象, 形如:{orderId: '123456789', sn: '7895004131583689'}
|
|
|
+ if (res == null || res.length == 0) {
|
|
|
+ feedback.notifySuccess('成功结账' + orderData.payAmount + '元')
|
|
|
+ scanDialogVisible.value = false
|
|
|
+ payingDialogVisible.value = false // 隐藏支付中对话框
|
|
|
+ showOrderConsole.value = false
|
|
|
+ emit('init')
|
|
|
+ } else {
|
|
|
console.log('支付中')
|
|
|
return queryPayStatusWithRetry(res)
|
|
|
.then((paySuccess) => {
|
|
@@ -443,12 +450,6 @@ const handleScanInput = (event: KeyboardEvent) => {
|
|
|
emit('init')
|
|
|
}
|
|
|
})
|
|
|
- } else {
|
|
|
- feedback.notifySuccess('成功结账' + orderData.payAmount + '元')
|
|
|
- scanDialogVisible.value = false
|
|
|
- payingDialogVisible.value = false // 隐藏支付中对话框
|
|
|
- showOrderConsole.value = false
|
|
|
- emit('init')
|
|
|
}
|
|
|
})
|
|
|
.catch(() => {
|