更新 front/templates/payPage.html

This commit is contained in:
zhangguoping 2025-07-21 16:51:26 +08:00
parent a527a44e20
commit 707c1d20c1
1 changed files with 8 additions and 3 deletions

View File

@ -124,7 +124,7 @@
{{if eq .code 200 }} {{if eq .code 200 }}
<body> <body>
<!-- 页面内容 --> <!-- 页面内容 -->
<div class="payment-info" id="payment-info"> <div class="payment-info" id="payment-info" style="display: none;">
<h2>订单支付</h2> <h2>订单支付</h2>
<p>{{.desc}}</p> <p>{{.desc}}</p>
<p>交易号:{{ .id }}</p> <p>交易号:{{ .id }}</p>
@ -132,14 +132,14 @@
</div> </div>
<!-- 支付方式选择区域 --> <!-- 支付方式选择区域 -->
<div id="pay-container"> <div id="pay-container" style="display: none;">
<div id="pay"></div> <div id="pay"></div>
<!-- 支付方式列表 --> <!-- 支付方式列表 -->
<ul id="payment-list"></ul> <ul id="payment-list"></ul>
</div> </div>
<!-- Loading状态 --> <!-- Loading状态 -->
<div id="loading" class="loading-container" style="display: none;"> <div id="loading" class="loading-container">
<div class="loading-spinner"></div> <div class="loading-spinner"></div>
<p class="loading-text">支付处理中,请稍等...</p> <p class="loading-text">支付处理中,请稍等...</p>
</div> </div>
@ -177,6 +177,7 @@
// 处理支付回调 // 处理支付回调
function handlePaymentCallback() { function handlePaymentCallback() {
const id = getQueryParam('no'); const id = getQueryParam('no');
alert(id, 'id')
if (!id) return; if (!id) return;
showLoading(); // 显示加载状态 showLoading(); // 显示加载状态
@ -344,9 +345,13 @@
// 页面加载时执行 // 页面加载时执行
window.onload = function() { window.onload = function() {
showLoading()
alert(1, 'zgp')
if (getQueryParam('return') == 'true' && !localStorage.getItem('auto-redirect')) { if (getQueryParam('return') == 'true' && !localStorage.getItem('auto-redirect')) {
alert(2, 'zgp')
handlePaymentCallback(); // 如果是支付回调且不是自动跳转,处理支付结果 handlePaymentCallback(); // 如果是支付回调且不是自动跳转,处理支付结果
} else { } else {
alert(3, 'zgp')
localStorage.removeItem('auto-redirect'); // 清除可能的auto-redirect标记 localStorage.removeItem('auto-redirect'); // 清除可能的auto-redirect标记
fetchPaymentMethods(); // 获取支付方式 fetchPaymentMethods(); // 获取支付方式
} }