更新 front/templates/payPage.html
This commit is contained in:
parent
240fda37a8
commit
3d7431a8d8
|
@ -124,7 +124,7 @@
|
|||
{{if eq .code 200 }}
|
||||
<body>
|
||||
<!-- 页面内容 -->
|
||||
<div class="payment-info" id="payment-info">
|
||||
<div class="payment-info" id="payment-info" style="display: none;">
|
||||
<h2>订单支付</h2>
|
||||
<p>{{.desc}}</p>
|
||||
<p>交易号:{{ .id }}</p>
|
||||
|
@ -132,7 +132,7 @@
|
|||
</div>
|
||||
|
||||
<!-- 支付方式选择区域 -->
|
||||
<div id="pay-container">
|
||||
<div id="pay-container" style="display: none;">
|
||||
<div id="pay"></div>
|
||||
<!-- 支付方式列表 -->
|
||||
<ul id="payment-list"></ul>
|
||||
|
@ -202,6 +202,7 @@
|
|||
}
|
||||
break;
|
||||
default: // 其他状态(待支付/失败/关闭)
|
||||
alert("其他状态(待支付/失败/关闭)");
|
||||
fetchPaymentMethods();
|
||||
// window.location.reload();
|
||||
}
|
||||
|
@ -214,6 +215,7 @@
|
|||
|
||||
// 获取支付方式列表
|
||||
function fetchPaymentMethods() {
|
||||
alert(`id:${id}`);
|
||||
const id = getQueryParam('no');
|
||||
if (id) {
|
||||
fetch(`/pay/front/api/v1/payPage/list?id=${id}`, {
|
||||
|
@ -239,6 +241,7 @@
|
|||
const pay = document.getElementById('pay');
|
||||
pay.innerHTML = '<h3>支付环境异常,请检查</h3>';
|
||||
} else if (data.data.length === 1) {
|
||||
alert(localStorage.getItem('auto-redirect'));
|
||||
if(localStorage.getItem('auto-redirect') == 2){
|
||||
// 如果有自动跳转标记,展示支付界面
|
||||
renderPaymentMethods(data.data);
|
||||
|
@ -343,7 +346,6 @@
|
|||
|
||||
// 页面加载时执行
|
||||
window.onload = function() {
|
||||
showLoading();
|
||||
if (localStorage.getItem('auto-redirect') == 2) {
|
||||
handlePaymentCallback(); // 如果是支付回调且不是自动跳转,处理支付结果
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue