Commit 4f7d23d9 by Jony.L

新支付功能测试2.0

parent 7d6edd26
...@@ -420,43 +420,42 @@ function create() { ...@@ -420,43 +420,42 @@ function create() {
// 创建订单(使用旺铺聚合支付) // 创建订单(使用旺铺聚合支付)
createOrderSubmitWpgj(createData).then(res => { createOrderSubmitWpgj(createData).then(res => {
console.log('WPGJ支付响应数据:', res.data); console.log('WPGJ支付响应数据:', res.data);
if (res.data.payOrderId) { // 直接弹出确认对话框(WPGJ接口调用成功就显示)
// 弹出确认对话框 ElMessageBox.confirm(
ElMessageBox.confirm( '确定购买吗?', // 对话框提示文字
'确定购买吗?', // 对话框提示文字 '购买确认', // 对话框标题
'购买确认', // 对话框标题 {
{ confirmButtonText: '确认', // 确认按钮文字
confirmButtonText: '确认', // 确认按钮文字 cancelButtonText: '取消', // 取消按钮文字
cancelButtonText: '取消', // 取消按钮文字 type: 'warning' // 对话框类型(警告样式)
type: 'warning' // 对话框类型(警告样式) }
)
.then(() => {
// WPGJ聚合支付处理 - 后端现在直接返回AppPayOrderSubmitRespVO
if (res.data.displayContent) {
// 使用displayContent字段生成二维码,使用orderExtensionId作为payOrderId
getCode(res.data.displayContent, res.data.orderExtensionId);
} else {
ElMessage.error('获取支付信息失败');
} }
) showDrawer.value = false;
.then(() => { })
// WPGJ聚合支付处理 - 后端现在直接返回AppPayOrderSubmitRespVO .catch(() => {
if (res.data.displayContent) { ElMessageBox.confirm(
// 使用displayContent字段生成二维码 '订单已创建,请前往控制台-我的订单查看',
getCode(res.data.displayContent, null); // WPGJ接口不需要payOrderId '提示',
} else { {
ElMessage.error('获取支付信息失败'); confirmButtonText: '确认',
} showCancelButton: false,
type: 'success'
}
).then(() => {
showDrawer.value = false; showDrawer.value = false;
}) })
.catch(() => { });
ElMessageBox.confirm(
'订单已创建,请前往控制台-我的订单查看',
'提示',
{
confirmButtonText: '确认',
showCancelButton: false,
type: 'success'
}
).then(() => {
showDrawer.value = false;
})
});
}
}).catch(err => { }).catch(err => {
// 接口调用失败的处理(如提示错误) console.error('创建订单失败:', err);
ElMessage.error('创建订单失败,请重试');
}); });
// 原有支付方式代码(已注释) // 原有支付方式代码(已注释)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment