订单支付逻辑代码优化
This commit is contained in:
@@ -271,7 +271,7 @@
|
||||
async function confirmModelConfirm() {
|
||||
if (modal.key == 'cash') {
|
||||
await pay()
|
||||
setModalShow('cash', false)
|
||||
confirmModelCancel()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -586,24 +586,7 @@
|
||||
return infoBox.showToast(tipsMap[payStatus])
|
||||
}
|
||||
try {
|
||||
payStatus = 'paying'
|
||||
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()
|
||||
pay()
|
||||
} catch (e) {
|
||||
//TODO handle the exception
|
||||
payStatus = ''
|
||||
@@ -645,25 +628,7 @@
|
||||
success: function(res) {
|
||||
console.log('条码类型:' + res.scanType);
|
||||
console.log('条码内容:' + res.result);
|
||||
Api.$payOrder({
|
||||
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()
|
||||
})
|
||||
pay({code: res.result})
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user