diff --git a/admin/finance.php b/admin/finance.php
index 0e681eb..5bd95c8 100644
--- a/admin/finance.php
+++ b/admin/finance.php
@@ -256,19 +256,19 @@ $requests = $stmt->fetchAll();
= $r['status'] == '4' ? '已拒绝' : '已通过' ?>
-
+
-
+
-
+
等待用户转账...
-
+
-
@@ -276,12 +276,12 @@ $requests = $stmt->fetchAll();
-
+
= htmlspecialchars($r['status']) ?>
diff --git a/recharge.php b/recharge.php
index f7a200f..c0f83ee 100644
--- a/recharge.php
+++ b/recharge.php
@@ -410,6 +410,7 @@ let rechargeCountdownInterval;
let modalChatLastIds = new Set();
let remainingSeconds = 1800;
let modalChatPolling = false;
+window.lastRechargeStatus = null; // Track status to prevent flickering
function notify(icon, title, text = '') {
return Swal.fire({
@@ -553,20 +554,21 @@ function startStatusPolling(order_id) {
const modalEl = document.getElementById('rechargeModal');
if (!modalEl || !modalEl.classList.contains('show')) return;
try {
- const r = await fetch(apiPath + `recharge_status.php?id=${order_id}&v=${Date.now()}`);
+ // Add cache busting
+ const r = await fetch(apiPath + `recharge_status.php?id=${order_id}&t=${Date.now()}`);
const data = await r.json();
if (data.success) {
- // console.log('Order status update:', data.status, data);
- // Ensure data status is treated as string for comparison
+ // Force status to string
const currentStatus = String(data.status);
- // Only re-render if status has changed to avoid UI flickering
- if (window.lastRechargeStatus !== currentStatus) {
+ // Only re-render if status has changed or UI is empty
+ const side = document.querySelector('.info-side');
+ if (window.lastRechargeStatus !== currentStatus || (side && side.innerHTML.trim() === "")) {
window.lastRechargeStatus = currentStatus;
renderRechargeUI(data);
}
- if (currentStatus === 'completed' || currentStatus === '3' || currentStatus === 'rejected' || currentStatus === '4') {
+ if (currentStatus === '3' || currentStatus === '4' || currentStatus === 'completed' || currentStatus === 'rejected') {
clearInterval(window.statusPollingInterval);
}
}
@@ -583,6 +585,7 @@ function renderRechargeUI(data) {
// Normalize status to string
const status = String(data.status || '0');
+ // Check if approved or rejected
if (status === 'completed' || status === '3') {
finishTransferUI();
return;
@@ -610,6 +613,7 @@ function renderRechargeUI(data) {
return;
}
+ // Workflow phases
if (status === 'pending' || status === '0') {
side.innerHTML = `