diff --git a/front/templates/payPage.html b/front/templates/payPage.html
index 975a968..8f9fe40 100644
--- a/front/templates/payPage.html
+++ b/front/templates/payPage.html
@@ -59,7 +59,7 @@
flex-direction: column;
align-items: center;
justify-content: center;
- height: 200px;
+ height: 100%;
}
.loading-spinner {
@@ -139,7 +139,7 @@
-
+
@@ -214,9 +214,7 @@
// 获取支付方式列表
function fetchPaymentMethods() {
-
const id = getQueryParam('no');
- alert(id, 'zgp')
if (id) {
fetch(`/pay/front/api/v1/payPage/list?id=${id}`, {
method: 'POST',
@@ -235,9 +233,9 @@
}
})
.then(data => {
- closeLoading();
// 处理返回的数据,例如渲染支付方式列表
if (data === null || data.data.length === 0) {
+ closeLoading();
const pay = document.getElementById('pay');
pay.innerHTML = '
支付环境异常,请检查
';
} else if (data.data.length === 1) {
@@ -249,6 +247,7 @@
}
} else {
// 多种支付方式,展示支付界面
+ closeLoading();
renderPaymentMethods(data.data);
}
})
@@ -343,14 +342,16 @@
// 页面加载时执行
window.onload = function() {
+ alert(1)
if (localStorage.getItem('auto-redirect') && localStorage.getItem('auto-redirect') == 2) {
+ alert(2)
handlePaymentCallback(); // 如果是支付回调且不是自动跳转,处理支付结果
} else {
+ alert(3)
localStorage.setItem('auto-redirect', 1); // 设置自动跳转标记
fetchPaymentMethods(); // 获取支付方式
}
};
-
{{ else}}