This commit is contained in:
Flatlogic Bot 2026-02-22 12:46:20 +00:00
parent 99732244e3
commit 3e2db33621
2 changed files with 17 additions and 13 deletions

View File

@ -256,19 +256,19 @@ $requests = $stmt->fetchAll();
<span class="badge bg-light text-muted border"><?= $r['status'] == '4' ? '已拒绝' : '已通过' ?></span>
<?php else: ?>
<div class="btn-group btn-group-sm">
<?php if ($r['status'] == '0' || $r['status'] == 'pending'): ?>
<?php if ($r['status'] === '0' || $r['status'] === 'pending'): ?>
<button type="button" class="btn btn-primary" onclick="submitMatchOnly(<?= $r['id'] ?>)">
匹配成功
</button>
<?php elseif ($r['status'] == '1' || $r['status'] == 'matched'): ?>
<?php elseif ($r['status'] === '1' || $r['status'] === 'matched'): ?>
<button type="button" class="btn btn-info text-white" onclick="showSendModal(<?= $r['id'] ?>, '<?= htmlspecialchars($r['account_bank'] ?? '') ?>', '<?= htmlspecialchars($r['account_name'] ?? '') ?>', '<?= htmlspecialchars($r['account_number'] ?? '') ?>')">
发送账户
</button>
<?php elseif ($r['status'] == '2' || $r['status'] == 'account_sent'): ?>
<?php elseif ($r['status'] === '2' || $r['status'] === 'account_sent'): ?>
<span class="badge bg-light text-muted border d-flex align-items-center px-2">等待用户转账...</span>
<?php elseif ($r['status'] == 'finished'): ?>
<?php elseif ($r['status'] === 'finished'): ?>
<?php if ($r['type'] === 'recharge'): ?>
<button type="button" class="btn btn-outline-success"
<button type="button" class="btn btn-outline-success fw-bold"
onclick="showApproveModal(<?= $r['id'] ?>, <?= $r['fiat_amount'] ?: 0 ?>, '<?= $r['fiat_currency'] ?: 'USDT' ?>', <?= $display_amount ?>)">
通过
</button>
@ -276,12 +276,12 @@ $requests = $stmt->fetchAll();
<form method="POST" class="d-inline">
<input type="hidden" name="request_id" value="<?= $r['id'] ?>">
<input type="hidden" name="action" value="approve">
<button type="submit" class="btn btn-outline-success" onclick="return confirm('确定要通过该提现申请吗?')">
<button type="submit" class="btn btn-outline-success fw-bold" onclick="return confirm('确定要通过该提现申请吗?')">
通过
</button>
</form>
<?php endif; ?>
<button class="btn btn-outline-danger" onclick="showRejectModal(<?= $r['id'] ?>)">拒绝</button>
<button class="btn btn-outline-danger fw-bold ms-1" onclick="showRejectModal(<?= $r['id'] ?>)">拒绝</button>
<?php else: ?>
<span class="badge bg-light text-muted border"><?= htmlspecialchars($r['status']) ?></span>
<?php endif; ?>

View File

@ -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 = `
<div class="text-center text-lg-start position-relative" style="z-index: 2;">