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