Commit 36b98351 by Jony.L

新支付功能测试5.0

parent 4f7d23d9
...@@ -433,8 +433,8 @@ function create() { ...@@ -433,8 +433,8 @@ function create() {
.then(() => { .then(() => {
// WPGJ聚合支付处理 - 后端现在直接返回AppPayOrderSubmitRespVO // WPGJ聚合支付处理 - 后端现在直接返回AppPayOrderSubmitRespVO
if (res.data.displayContent) { if (res.data.displayContent) {
// 使用displayContent字段生成二维码,使用orderExtensionId作为payOrderId // 使用displayContent字段生成二维码,直接使用资源订单ID
getCode(res.data.displayContent, res.data.orderExtensionId); getCode(res.data.displayContent, res.data.id);
} else { } else {
ElMessage.error('获取支付信息失败'); ElMessage.error('获取支付信息失败');
} }
...@@ -513,7 +513,39 @@ function getCode(value, payOrderId) { ...@@ -513,7 +513,39 @@ function getCode(value, payOrderId) {
createQueryInterval(payOrderId) createQueryInterval(payOrderId)
} }
/** 轮询查询任务 */ /** 轮询查询任务 - WPGJ支付 */
const createQueryInterval = (id) => {
if (interval.value) {
return
}
interval.value = setInterval(async () => {
const res = await getWpgjOrder(id)
console.log(res, 'WPGJ轮询结果')
// 已支付
if (res.data.orderStatus === '1') {
clearQueryInterval()
// ElMessage.success('支付成功!')
ElMessageBox.confirm(
'支付成功',
'请前往控制台-我的订单查看',
{
confirmButtonText: '确认',
showCancelButton: false,
type: 'success'
}
).then(() => {
})
}
// 已取消或失败
if (res.data.orderStatus === '2') {
clearQueryInterval()
ElMessage.error('支付已关闭!')
}
}, 1000 * 2)
}
/** 轮询查询任务 - 老代码(已注释) */
/*
const createQueryInterval = (id) => { const createQueryInterval = (id) => {
if (interval.value) { if (interval.value) {
return return
...@@ -543,8 +575,10 @@ const createQueryInterval = (id) => { ...@@ -543,8 +575,10 @@ const createQueryInterval = (id) => {
} }
}, 1000 * 2) }, 1000 * 2)
} }
*/
// 查询详情支付订单 // 查询详情支付订单 - 老代码(已注释)
/*
const getOrder = async (id, sync) => { const getOrder = async (id, sync) => {
return await request({ return await request({
url: '/pay/order/get', url: '/pay/order/get',
...@@ -555,6 +589,18 @@ const getOrder = async (id, sync) => { ...@@ -555,6 +589,18 @@ const getOrder = async (id, sync) => {
} }
}) })
} }
*/
// WPGJ旺铺聚合支付订单查询
const getWpgjOrder = async (id) => {
return await request({
url: '/pay/order/wpgj-get',
method: 'get',
params: {
id
}
})
}
/** 清空查询任务 */ /** 清空查询任务 */
const clearQueryInterval = () => { const clearQueryInterval = () => {
......
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