修改功能,现已测试注册登录忘记密码
This commit is contained in:
+81
-366
@@ -13,6 +13,7 @@
|
||||
<link rel="stylesheet" href="../public/css/public.css" />
|
||||
<link rel="stylesheet" href="../public/css/publish.css" />
|
||||
<link rel="stylesheet" href="../public/css/finance.css" />
|
||||
<link rel="stylesheet" href="../public/css/chongzhi.css" />
|
||||
</head>
|
||||
<body>
|
||||
<!-- Header -->
|
||||
@@ -33,7 +34,7 @@
|
||||
>免费注册</a
|
||||
>
|
||||
</div>
|
||||
<div id="loggedInBox" class="topbar__logged" style="display: none">
|
||||
<div id="loggedInBox" class="topbar__logged cz-hidden">
|
||||
<a href="usercenter.html" class="topbar__profile">
|
||||
<img
|
||||
id="userAvatar"
|
||||
@@ -66,8 +67,7 @@
|
||||
<div class="cz-balance-bar">
|
||||
<div class="cz-balance-bar__item">
|
||||
<div
|
||||
class="cz-balance-bar__icon"
|
||||
style="background: rgba(16, 43, 106, 0.08); color: var(--primary)"
|
||||
class="cz-balance-bar__icon account"
|
||||
>
|
||||
<i class="layui-icon layui-icon-rmb"></i>
|
||||
</div>
|
||||
@@ -103,7 +103,7 @@
|
||||
</div>
|
||||
|
||||
<!-- QR Code Payment Section -->
|
||||
<div class="cxz-form-card" id="qrcodeCard" style="display: none">
|
||||
<div class="cxz-form-card cz-hidden" id="qrcodeCard">
|
||||
<div class="cz-qr-section" id="qrSection">
|
||||
<div class="cz-qr-header">
|
||||
<div class="cz-qr-icon">
|
||||
@@ -127,7 +127,7 @@
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<div class="cz-pay-result" id="paymentSuccess" style="display: none">
|
||||
<div class="cz-pay-result cz-hidden" id="paymentSuccess">
|
||||
<div class="cz-pay-result__icon success">
|
||||
<i class="layui-icon layui-icon-ok-circle"></i>
|
||||
</div>
|
||||
@@ -136,7 +136,7 @@
|
||||
<a href="usercenter.html" class="cz-pay-result__btn">返回个人中心</a>
|
||||
</div>
|
||||
|
||||
<div class="cz-pay-result" id="paymentTimeout" style="display: none">
|
||||
<div class="cz-pay-result cz-hidden" id="paymentTimeout">
|
||||
<div class="cz-pay-result__icon timeout">
|
||||
<i class="layui-icon layui-icon-close-fill"></i>
|
||||
</div>
|
||||
@@ -176,7 +176,7 @@
|
||||
id="beian"
|
||||
href="https://beian.miit.gov.cn/"
|
||||
target="_blank"
|
||||
style="font-size: 12px; color: rgba(255, 255, 255, 0.5)"
|
||||
class="cz-footer-link"
|
||||
>工信部备案号</a
|
||||
>
|
||||
<span id="additional-info">本站仅供数据分析参考</span>
|
||||
@@ -193,359 +193,6 @@
|
||||
</button>
|
||||
|
||||
<script src="../public/js/qrcode.min.js"></script>
|
||||
<style>
|
||||
/* Balance Bar */
|
||||
.cz-balance-bar {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 16px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.cz-balance-bar__item {
|
||||
background: var(--white);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 20px 24px;
|
||||
box-shadow: var(--shadow-sm);
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 16px;
|
||||
border: 1px solid var(--border-light);
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.cz-balance-bar__item:hover {
|
||||
border-color: transparent;
|
||||
box-shadow: var(--shadow-md);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
.cz-balance-bar__icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 14px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 22px;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
.cz-balance-bar__label {
|
||||
font-size: 13px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
.cz-balance-bar__value {
|
||||
font-size: 24px;
|
||||
font-weight: 800;
|
||||
color: var(--text-dark);
|
||||
line-height: 1.2;
|
||||
}
|
||||
.cz-balance-bar__value .unit {
|
||||
font-size: 14px;
|
||||
font-weight: 400;
|
||||
color: var(--text-muted);
|
||||
margin-left: 2px;
|
||||
}
|
||||
|
||||
/* Package Grid */
|
||||
.cz-package-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
gap: 14px;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
.cz-package-loading {
|
||||
grid-column: 1/-1;
|
||||
text-align: center;
|
||||
padding: 40px;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
.cz-package-loading i {
|
||||
font-size: 28px;
|
||||
display: block;
|
||||
margin-bottom: 8px;
|
||||
color: var(--primary);
|
||||
}
|
||||
.cz-pkg {
|
||||
position: relative;
|
||||
background: var(--bg-light);
|
||||
border: 2px solid var(--border-light);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 20px 16px;
|
||||
text-align: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s;
|
||||
user-select: none;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cz-pkg:hover {
|
||||
border-color: var(--primary);
|
||||
transform: translateY(-2px);
|
||||
box-shadow: var(--shadow-sm);
|
||||
}
|
||||
.cz-pkg.selected {
|
||||
border-color: var(--primary);
|
||||
background: rgba(16, 43, 106, 0.04);
|
||||
box-shadow: 0 0 0 3px rgba(16, 43, 106, 0.12);
|
||||
}
|
||||
.cz-pkg.selected::after {
|
||||
content: "\2713";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
right: 0;
|
||||
width: 24px;
|
||||
height: 24px;
|
||||
background: var(--primary);
|
||||
color: #fff;
|
||||
font-size: 12px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 0 var(--radius-lg) 0 var(--radius-lg);
|
||||
}
|
||||
.cz-pkg__price {
|
||||
font-size: 28px;
|
||||
font-weight: 800;
|
||||
color: var(--primary);
|
||||
line-height: 1.2;
|
||||
}
|
||||
.cz-pkg__price span {
|
||||
font-size: 14px;
|
||||
font-weight: 600;
|
||||
}
|
||||
.cz-pkg__credit {
|
||||
display: inline-block;
|
||||
margin-top: 8px;
|
||||
padding: 3px 10px;
|
||||
border-radius: 999px;
|
||||
font-size: 12px;
|
||||
font-weight: 700;
|
||||
background: rgba(253, 185, 51, 0.12);
|
||||
color: var(--gold);
|
||||
}
|
||||
.cz-pkg__bonus {
|
||||
display: inline-block;
|
||||
margin-top: 4px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 999px;
|
||||
font-size: 11px;
|
||||
font-weight: 600;
|
||||
background: rgba(241, 90, 34, 0.1);
|
||||
color: var(--orange);
|
||||
}
|
||||
.cz-pkg.selected .cz-pkg__price {
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
/* Hot / Recommend tag */
|
||||
.cz-pkg__tag {
|
||||
position: absolute;
|
||||
top: 8px;
|
||||
left: 8px;
|
||||
padding: 2px 8px;
|
||||
border-radius: 999px;
|
||||
font-size: 10px;
|
||||
font-weight: 700;
|
||||
letter-spacing: 0.5px;
|
||||
color: #fff;
|
||||
}
|
||||
.cz-pkg__tag.hot {
|
||||
background: linear-gradient(135deg, #ff6b35, #f15a22);
|
||||
}
|
||||
.cz-pkg__tag.rec {
|
||||
background: linear-gradient(135deg, var(--primary), #1a3f8f);
|
||||
}
|
||||
|
||||
/* QR Code Section */
|
||||
.cz-qr-section {
|
||||
text-align: center;
|
||||
padding: 24px 0;
|
||||
}
|
||||
.cz-qr-header {
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.cz-qr-icon {
|
||||
width: 48px;
|
||||
height: 48px;
|
||||
border-radius: 50%;
|
||||
background: rgba(7, 193, 96, 0.1);
|
||||
color: #07c160;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 24px;
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.cz-qr-title {
|
||||
font-size: 18px;
|
||||
font-weight: 700;
|
||||
color: var(--text-dark);
|
||||
}
|
||||
.cz-qr-subtitle {
|
||||
font-size: 13px;
|
||||
color: var(--text-muted);
|
||||
margin-top: 4px;
|
||||
}
|
||||
.cz-qr-amount {
|
||||
font-size: 32px;
|
||||
font-weight: 800;
|
||||
color: var(--orange);
|
||||
margin: 16px 0;
|
||||
}
|
||||
.cz-qr-amount span {
|
||||
font-size: 16px;
|
||||
font-weight: 600;
|
||||
color: var(--text-muted);
|
||||
}
|
||||
.cz-qr-wrap {
|
||||
display: inline-block;
|
||||
padding: 16px;
|
||||
background: #fff;
|
||||
border: 2px solid var(--border-light);
|
||||
border-radius: var(--radius-lg);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.cz-qr-wrap img,
|
||||
.cz-qr-wrap canvas {
|
||||
display: block;
|
||||
width: 200px;
|
||||
height: 200px;
|
||||
}
|
||||
.cz-qr-hint {
|
||||
font-size: 13px;
|
||||
color: var(--text-muted);
|
||||
margin-top: 8px;
|
||||
}
|
||||
.cz-qr-timer {
|
||||
font-size: 14px;
|
||||
color: var(--orange);
|
||||
margin-top: 8px;
|
||||
font-weight: 700;
|
||||
}
|
||||
.cz-qr-cancel {
|
||||
margin-top: 16px;
|
||||
padding: 8px 24px;
|
||||
border: 1px solid var(--border-light);
|
||||
border-radius: 999px;
|
||||
background: transparent;
|
||||
color: var(--text-muted);
|
||||
font-size: 13px;
|
||||
cursor: pointer;
|
||||
transition: all 0.25s;
|
||||
}
|
||||
.cz-qr-cancel:hover {
|
||||
border-color: var(--primary);
|
||||
color: var(--primary);
|
||||
}
|
||||
|
||||
/* Payment Result */
|
||||
.cz-pay-result {
|
||||
text-align: center;
|
||||
padding: 40px 0;
|
||||
}
|
||||
.cz-pay-result__icon {
|
||||
width: 72px;
|
||||
height: 72px;
|
||||
border-radius: 50%;
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
font-size: 36px;
|
||||
margin-bottom: 16px;
|
||||
}
|
||||
.cz-pay-result__icon.success {
|
||||
background: rgba(40, 167, 69, 0.12);
|
||||
color: var(--green);
|
||||
}
|
||||
.cz-pay-result__icon.timeout {
|
||||
background: rgba(255, 193, 7, 0.15);
|
||||
color: #ffc107;
|
||||
}
|
||||
.cz-pay-result__title {
|
||||
font-size: 20px;
|
||||
font-weight: 700;
|
||||
color: var(--text-dark);
|
||||
margin-bottom: 8px;
|
||||
}
|
||||
.cz-pay-result__desc {
|
||||
font-size: 13px;
|
||||
color: var(--text-muted);
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.cz-pay-result__btn {
|
||||
display: inline-block;
|
||||
padding: 10px 32px;
|
||||
border-radius: 999px;
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
background: linear-gradient(135deg, var(--primary), #1a3f8f);
|
||||
color: #fff;
|
||||
text-decoration: none;
|
||||
cursor: pointer;
|
||||
border: none;
|
||||
transition: all 0.3s;
|
||||
}
|
||||
.cz-pay-result__btn:hover {
|
||||
box-shadow: 0 6px 20px rgba(16, 43, 106, 0.4);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
/* Tips Card */
|
||||
.cz-tips-card {
|
||||
background: var(--white);
|
||||
border-radius: var(--radius-lg);
|
||||
padding: 20px 24px;
|
||||
border: 1px solid var(--border-light);
|
||||
margin-top: 24px;
|
||||
}
|
||||
.cz-tips-title {
|
||||
font-size: 14px;
|
||||
font-weight: 700;
|
||||
color: var(--text-dark);
|
||||
margin-bottom: 12px;
|
||||
}
|
||||
.cz-tips-title i {
|
||||
color: var(--primary);
|
||||
margin-right: 4px;
|
||||
}
|
||||
.cz-tips-list {
|
||||
margin: 0;
|
||||
padding-left: 18px;
|
||||
}
|
||||
.cz-tips-list li {
|
||||
font-size: 12px;
|
||||
color: var(--text-muted);
|
||||
line-height: 2;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
/* Responsive */
|
||||
@media (max-width: 768px) {
|
||||
.cz-balance-bar {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
.cz-package-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 10px;
|
||||
}
|
||||
.cz-pkg {
|
||||
padding: 16px 12px;
|
||||
}
|
||||
.cz-pkg__price {
|
||||
font-size: 22px;
|
||||
}
|
||||
}
|
||||
@media (max-width: 480px) {
|
||||
.cz-package-grid {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
gap: 8px;
|
||||
}
|
||||
.cz-pkg__price {
|
||||
font-size: 20px;
|
||||
}
|
||||
.cz-pkg__credit {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
const $ = layui.$;
|
||||
var configList = [];
|
||||
@@ -556,6 +203,9 @@
|
||||
var countdownSeconds = 300;
|
||||
var pollingStartTime = 0;
|
||||
var MAX_POLLING_DURATION = 300000;
|
||||
var POLLING_INTERVAL = 3000;
|
||||
var currentRechargeOutTradeNo = "";
|
||||
var currentRechargeExpireTime = 0;
|
||||
|
||||
function escapeHtml(value) {
|
||||
return String(value == null ? "" : value)
|
||||
@@ -643,7 +293,7 @@
|
||||
}
|
||||
})
|
||||
.catch(function () {
|
||||
renderEmptyPackages("加载失败,请刷新重试");
|
||||
renderEmptyPackages("加载失败,请刷新重试");
|
||||
});
|
||||
}
|
||||
|
||||
@@ -751,12 +401,18 @@
|
||||
var data = ApiClient.pickData ? ApiClient.pickData(res) : res.data;
|
||||
if (ApiClient.isSuccess(res) && data) {
|
||||
var payUrl = getRechargePaymentUrl(data);
|
||||
var outTradeNo = getRechargeOutTradeNo(data);
|
||||
var expireTime = getRechargeExpireTime(data);
|
||||
var amount = data.amount || data.paidAmount || selectedConfigAmount;
|
||||
if (!payUrl) {
|
||||
layui.layer.msg("\u8ba2\u5355\u672a\u8fd4\u56de\u652f\u4ed8\u4e8c\u7ef4\u7801\u5185\u5bb9", { icon: 2 });
|
||||
return;
|
||||
}
|
||||
showQRCode(payUrl, amount);
|
||||
if (!outTradeNo) {
|
||||
layui.layer.msg("充值订单未返回订单号,无法查询支付状态", { icon: 2 });
|
||||
return;
|
||||
}
|
||||
showQRCode(payUrl, amount, outTradeNo, expireTime);
|
||||
} else {
|
||||
layui.layer.msg(res.msg || "创建订单失败", { icon: 2 });
|
||||
}
|
||||
@@ -772,9 +428,11 @@
|
||||
if (!data || typeof data !== "object") return "";
|
||||
return (
|
||||
data.qrCode ||
|
||||
data.qrcode ||
|
||||
data.payUrl ||
|
||||
data.paymentUrl ||
|
||||
data.codeUrl ||
|
||||
data.code_url ||
|
||||
data.qrCodeUrl ||
|
||||
data.nativeUrl ||
|
||||
data.url ||
|
||||
@@ -782,8 +440,22 @@
|
||||
);
|
||||
}
|
||||
|
||||
function getRechargeOutTradeNo(data) {
|
||||
if (!data || typeof data !== "object") return "";
|
||||
return data.outTradeNo || data.out_trade_no || data.orderNo || data.order_no || data.tradeNo || data.trade_no || "";
|
||||
}
|
||||
|
||||
function getRechargeExpireTime(data) {
|
||||
if (!data || typeof data !== "object") return 0;
|
||||
var value = data.expireTime || data.expire_time || data.expiredAt || data.expired_at || data.expiresAt || data.expires_at;
|
||||
if (!value) return Date.now() + MAX_POLLING_DURATION;
|
||||
var parsed = typeof value === "number" ? value : Date.parse(value);
|
||||
if (!parsed || Number.isNaN(parsed)) return Date.now() + MAX_POLLING_DURATION;
|
||||
return parsed < 10000000000 ? parsed * 1000 : parsed;
|
||||
}
|
||||
|
||||
// Show QR code
|
||||
function showQRCode(url, amount) {
|
||||
function showQRCode(url, amount, outTradeNo, expireTime) {
|
||||
$("#qrcodeCard").show();
|
||||
$("#qrSection").show();
|
||||
$("#paymentSuccess").hide();
|
||||
@@ -803,7 +475,10 @@
|
||||
|
||||
countdownSeconds = 300;
|
||||
pollingStartTime = Date.now();
|
||||
currentRechargeOutTradeNo = outTradeNo || "";
|
||||
currentRechargeExpireTime = expireTime || Date.now() + MAX_POLLING_DURATION;
|
||||
startCountdown();
|
||||
startPolling();
|
||||
|
||||
$("html,body").animate(
|
||||
{ scrollTop: $("#qrcodeCard").offset().top - 20 },
|
||||
@@ -839,7 +514,7 @@
|
||||
|
||||
function doPoll() {
|
||||
var elapsed = Date.now() - pollingStartTime;
|
||||
if (elapsed >= MAX_POLLING_DURATION) {
|
||||
if (elapsed >= MAX_POLLING_DURATION || Date.now() >= currentRechargeExpireTime) {
|
||||
stopPolling();
|
||||
clearInterval(countdownTimer);
|
||||
$("#qrSection").hide();
|
||||
@@ -847,14 +522,54 @@
|
||||
return;
|
||||
}
|
||||
|
||||
scheduleNextPoll();
|
||||
if (!currentRechargeOutTradeNo) {
|
||||
scheduleNextPoll();
|
||||
return;
|
||||
}
|
||||
|
||||
queryRechargeOrderStatus(currentRechargeOutTradeNo)
|
||||
.then(function (paid) {
|
||||
if (paid) {
|
||||
stopPolling();
|
||||
if (countdownTimer) clearInterval(countdownTimer);
|
||||
$("#qrSection").hide();
|
||||
$("#paymentTimeout").hide();
|
||||
$("#paymentSuccess").show();
|
||||
layui.layer.msg("充值成功", { icon: 1 });
|
||||
return;
|
||||
}
|
||||
scheduleNextPoll();
|
||||
})
|
||||
.catch(function () {
|
||||
scheduleNextPoll();
|
||||
});
|
||||
}
|
||||
|
||||
function scheduleNextPoll() {
|
||||
var delay = 1000 + Math.floor(Math.random() * 4000);
|
||||
var delay = POLLING_INTERVAL + Math.floor(Math.random() * 1200);
|
||||
pollingTimer = setTimeout(doPoll, delay);
|
||||
}
|
||||
|
||||
function queryRechargeOrderStatus(outTradeNo) {
|
||||
return ApiClient.get(ApiClient.API.walletRechargeOrderStatus(outTradeNo))
|
||||
.then(function (res) {
|
||||
if (!ApiClient.isSuccess(res)) return false;
|
||||
var data = ApiClient.pickData ? ApiClient.pickData(res, {}) : res.data || {};
|
||||
var status = String(data.status || data.payStatus || data.walletStatus || data.orderStatus || data.tradeStatus || "").toLowerCase();
|
||||
return (
|
||||
data.paid === true ||
|
||||
data.success === true ||
|
||||
data.paySuccess === true ||
|
||||
status === "success" ||
|
||||
status === "paid" ||
|
||||
status === "2" ||
|
||||
status === "1" ||
|
||||
Number(data.status) === 2 ||
|
||||
Number(data.payStatus) === 2
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
function stopPolling() {
|
||||
if (pollingTimer) {
|
||||
clearTimeout(pollingTimer);
|
||||
|
||||
Reference in New Issue
Block a user