e834e848 by zhangmeng

开票

1 parent 4c4040a4
......@@ -287,36 +287,50 @@ async function paymentHandle() {
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
}).then(async () => {
const res = await submitOrderTicket({
...orderForm.value,
message: JSON.stringify(orderForm.value.message),
total: language.value == 0 ? price.value.total_cn : price.value.total_en
})
if (res.code == 200 && res.data.orderId > 0) {
// 去付钱
router.push({
name: 'bookingPay',
query: {
orderId: res.data.orderId,
money: res.data.total,
type: 'ticket'
}
})
} else if (res.code == 200 && res.data.orderId == -400) {
ElMessageBox.confirm(language.value == 0 ? '剩余票数不足,请选择其他日期' : 'There are not enough votes left. Please select another date', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
})
} else if (res.code == 200 && res.data.orderId == -500) {
ElMessageBox.confirm(language.value == 0 ? '每人每天限购一张票,请确认后下单' : 'One ticket per person per day, please confirm and place your order', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
try {
const res = await submitOrderTicket({
activeId: orderForm.value.activeId,
acId: orderForm.value.acId,
attId: orderForm.value.attId,
tickType: orderForm.value.tickType,
ticketDate: orderForm.value.ticketDate,
phone: orderForm.value.phone,
customerList: orderForm.value.customerList,
num: orderForm.value.num,
message: JSON.stringify(orderForm.value.message),
total: language.value == 0 ? price.value.total_cn : price.value.total_en
})
} else {
if (res.code == 200 && res.data.orderId > 0) {
// 去付钱
router.push({
name: 'bookingPay',
query: {
orderId: res.data.orderId,
money: res.data.total,
type: 'ticket'
}
})
} else if (res.code == 200 && res.data.orderId == -400) {
ElMessageBox.confirm(language.value == 0 ? '剩余票数不足,请选择其他日期' : 'There are not enough votes left. Please select another date', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
})
} else if (res.code == 200 && res.data.orderId == -500) {
ElMessageBox.confirm(language.value == 0 ? '每人每天限购一张票,请确认后下单' : 'One ticket per person per day, please confirm and place your order', {
confirmButtonText: language.value == 0 ? '确定' : 'Confirm',
cancelButtonText: language.value == 0 ? '取消' : 'Cancel',
type: 'warning'
})
} else {
ElMessage.error(language.value == 0 ? '下单失败,' : 'Order failure')
}
} catch (e) {
console.log(e)
} finally {
ElMessage.error(language.value == 0 ? '下单失败,' : 'Order failure')
}
})
}
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!