订单支付逻辑代码优化
This commit is contained in:
@@ -271,7 +271,7 @@
|
|||||||
async function confirmModelConfirm() {
|
async function confirmModelConfirm() {
|
||||||
if (modal.key == 'cash') {
|
if (modal.key == 'cash') {
|
||||||
await pay()
|
await pay()
|
||||||
setModalShow('cash', false)
|
confirmModelCancel()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -586,24 +586,7 @@
|
|||||||
return infoBox.showToast(tipsMap[payStatus])
|
return infoBox.showToast(tipsMap[payStatus])
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
payStatus = 'paying'
|
pay()
|
||||||
await Api.$payOrder({
|
|
||||||
tableId: order.tableId,
|
|
||||||
masterId: order.masterId,
|
|
||||||
orderId: order.id || order.orderId,
|
|
||||||
payType,
|
|
||||||
vipUserId: order.memberId,
|
|
||||||
discount: discount.discount / 100,
|
|
||||||
code: '',
|
|
||||||
pointsNum: accountPoints.sel ? accountPoints.num : 0,
|
|
||||||
userCouponInfos: pays.quan.map(v => {
|
|
||||||
return {
|
|
||||||
userCouponId: v.id,
|
|
||||||
num: v.num
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
paySuccess()
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
//TODO handle the exception
|
//TODO handle the exception
|
||||||
payStatus = ''
|
payStatus = ''
|
||||||
@@ -645,25 +628,7 @@
|
|||||||
success: function(res) {
|
success: function(res) {
|
||||||
console.log('条码类型:' + res.scanType);
|
console.log('条码类型:' + res.scanType);
|
||||||
console.log('条码内容:' + res.result);
|
console.log('条码内容:' + res.result);
|
||||||
Api.$payOrder({
|
pay({code: res.result})
|
||||||
orderId: order.id || order.orderId,
|
|
||||||
payType: item.payType, //
|
|
||||||
discount: discount.discount / 100,
|
|
||||||
code: res.result,
|
|
||||||
tableId: order.tableId,
|
|
||||||
masterId: order.masterId,
|
|
||||||
vipUserId: order.memberId,
|
|
||||||
pointsNum: accountPoints.sel ? accountPoints.num : 0,
|
|
||||||
userCouponInfos: pays.quan.map(v => {
|
|
||||||
return {
|
|
||||||
userCouponId: v.id,
|
|
||||||
num: v.num
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}).then(res => {
|
|
||||||
console.log(res);
|
|
||||||
paySuccess()
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user