diff --git a/front/templates/payPage.html b/front/templates/payPage.html index 62b12c8..d58d496 100644 --- a/front/templates/payPage.html +++ b/front/templates/payPage.html @@ -164,7 +164,7 @@ function showLoading() { document.getElementById('payment-info').style.display = 'none'; document.getElementById('pay-container').style.display = 'none'; - document.getElementById('loading').style.display = 'flex'; + document.getElementById('loading').style.display = 'block'; } // 关闭Loading效果 @@ -177,11 +177,8 @@ // 处理支付回调 function handlePaymentCallback() { const id = getQueryParam('no'); - alert(id, 'id') if (!id) return; - showLoading(); // 显示加载状态 - // 查询订单状态 fetch(`/pay/front/api/v1/payPage/query?no=${id}`, { method: 'POST', @@ -193,7 +190,7 @@ .then(data => { switch(data.status) { case 2: // 处理中 - setTimeout(handlePaymentCallback, 1000); // 1秒后重查 + handlePaymentCallback(); // 重查状态 break; case 3: // 支付成功 if (data.return_url) { @@ -201,6 +198,7 @@ } break; default: // 其他状态(待支付/失败/关闭) + alert('其他状态:待支付/失败/关闭'); closeLoading(); // window.location.reload(); } @@ -215,7 +213,7 @@ // 获取支付方式列表 function fetchPaymentMethods() { const id = getQueryParam('no'); - console.log('Order no:', id); + alert(`订单id:${id}`); if (id) { fetch(`/pay/front/api/v1/payPage/list?id=${id}`, { method: 'POST', @@ -239,25 +237,27 @@ const pay = document.getElementById('pay'); pay.innerHTML = '