diff --git a/front/templates/payPage.html b/front/templates/payPage.html index 26d9acc..bf5dd97 100644 --- a/front/templates/payPage.html +++ b/front/templates/payPage.html @@ -177,7 +177,10 @@ // 处理支付回调 function handlePaymentCallback() { const id = getQueryParam('no'); - if (!id) return; + if (!id) { + closeLoading(); + return; + }; // 查询订单状态 fetch(`/pay/front/api/v1/payPage/query?no=${id}`, { @@ -188,6 +191,7 @@ return await response.json(); }) .then(data => { + closeLoading(); switch(data.status) { case 2: // 处理中 handlePaymentCallback(); // 重查状态 @@ -198,7 +202,6 @@ } break; default: // 其他状态(待支付/失败/关闭) - closeLoading() fetchPaymentMethods(); // window.location.reload(); } @@ -230,12 +233,12 @@ } }) .then(data => { + closeLoading(); // 处理返回的数据,例如渲染支付方式列表 if (data === null || data.data.length === 0) { const pay = document.getElementById('pay'); pay.innerHTML = '