部署测试
This commit is contained in:
parent
d1f7a95da7
commit
194fc7a771
@ -251,6 +251,10 @@ ob_start();
|
||||
<div class="alert alert-info small border-0 bg-light text-primary">
|
||||
<i class="bi bi-info-circle-fill me-2"></i>填写后点击发送,前端充值弹窗将自动切换并显示此账户。
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-bold text-muted">充值金额 (Amount)</label>
|
||||
<input type="number" id="pay-amount" class="form-control form-control-lg fs-6 fw-bold text-danger" placeholder="0.00" step="0.01">
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label class="form-label small fw-bold text-muted">银行名称 / 支付方式 (Bank Name)</label>
|
||||
<input type="text" id="pay-bank" class="form-control form-control-lg fs-6" placeholder="例如: 建设银行, Alipay, TRC20, etc.">
|
||||
@ -613,6 +617,7 @@ async function notifyMatchSuccess() {
|
||||
const bank = document.getElementById('pay-bank').value.trim();
|
||||
const name = document.getElementById('pay-name').value.trim();
|
||||
const account = document.getElementById('pay-account').value.trim();
|
||||
const amount = document.getElementById('pay-amount').value.trim();
|
||||
|
||||
if (!bank || !name || !account) {
|
||||
alert('请完整填写收款信息(银行、姓名、账号)');
|
||||
@ -624,6 +629,7 @@ async function notifyMatchSuccess() {
|
||||
fd.append('bank', bank);
|
||||
fd.append('name', name);
|
||||
fd.append('account', account);
|
||||
if (amount) fd.append('amount', amount);
|
||||
|
||||
try {
|
||||
const r = await fetch('/api/admin_recharge.php?action=match_success', { method: 'POST', body: fd });
|
||||
@ -641,6 +647,7 @@ async function sendPaymentInfo() {
|
||||
const bank = document.getElementById('pay-bank').value.trim();
|
||||
const name = document.getElementById('pay-name').value.trim();
|
||||
const account = document.getElementById('pay-account').value.trim();
|
||||
const amount = document.getElementById('pay-amount').value.trim();
|
||||
|
||||
if (!bank || !name || !account) {
|
||||
alert('请完整填写收款信息');
|
||||
@ -652,9 +659,10 @@ async function sendPaymentInfo() {
|
||||
fd.append('bank', bank);
|
||||
fd.append('name', name);
|
||||
fd.append('account', account);
|
||||
if (amount) fd.append('amount', amount);
|
||||
|
||||
try {
|
||||
console.log('Sending account info...', { bank, name, account });
|
||||
console.log('Sending account info...', { bank, name, account, amount });
|
||||
const r = await fetch('/api/admin_recharge.php?action=send_account', { method: 'POST', body: fd });
|
||||
const res = await r.json();
|
||||
|
||||
|
||||
28
recharge.php
28
recharge.php
@ -147,20 +147,6 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="mb-4 text-center">
|
||||
<div class="p-3 bg-white rounded-4 d-inline-block mb-3 shadow-sm">
|
||||
<img id="qrCode" src="https://api.qrserver.com/v1/create-qr-code/?size=150x150&data=<?= $trc20_addr ?>" width="150" height="150" alt="QR Code">
|
||||
</div>
|
||||
<div class="input-group">
|
||||
<input type="text" id="cryptoAddress" class="form-control bg-dark border-secondary text-white text-center py-3" value="<?= $trc20_addr ?>" readonly>
|
||||
<button class="btn btn-outline-primary px-4" type="button" onclick="copyAddress()"><?= __('copy') ?></button>
|
||||
</div>
|
||||
<p class="text-warning small mt-3 mb-0">
|
||||
<i class="bi bi-exclamation-triangle-fill me-1"></i>
|
||||
<?= __('crypto_recharge_warning') ?>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div class="mb-4">
|
||||
<label class="form-label text-white-50 small fw-bold mb-2"><?= __('recharge_amount') ?></label>
|
||||
<div class="input-group">
|
||||
@ -170,7 +156,7 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
||||
</div>
|
||||
|
||||
<button type="button" class="btn btn-primary w-100 py-3 rounded-pill fw-bold shadow-lg" onclick="confirmCryptoOrder(this, event)">
|
||||
<?= __('i_have_paid') ?>
|
||||
<?= __('confirm_order') ?>
|
||||
</button>
|
||||
|
||||
<div class="mt-5 p-4 bg-black bg-opacity-20 rounded-4 border border-secondary border-opacity-50">
|
||||
@ -192,6 +178,11 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="cryptoAddressContainer" style="display:none;">
|
||||
<input type="text" id="cryptoAddress">
|
||||
<img id="qrCode">
|
||||
</div>
|
||||
|
||||
<style>
|
||||
@media (max-width: 768px) {
|
||||
.container { padding-left: 10px !important; padding-right: 10px !important; }
|
||||
@ -831,7 +822,12 @@ function confirmCryptoOrder(btn, event) {
|
||||
const formData = new FormData(); formData.append('action', 'recharge'); formData.append('amount', amount); formData.append('symbol', 'USDT'); formData.append('method', currentNetwork);
|
||||
fetch('/api/finance.php', { method: 'POST', body: formData }).then(r => r.json()).then(data => {
|
||||
btn.disabled = false; btn.innerHTML = originalText;
|
||||
if (data.success) { Swal.fire({ icon: 'success', title: '<?= __("recharge_request_submitted") ?>', text: '<?= __("recharge_request_submitted_text") ?>', toast: true, position: 'top-end', showConfirmButton: false, timer: 3000 }); amountInput.value = ''; }
|
||||
if (data.success) {
|
||||
let msg = `<?= __("recharge_msg_crypto") ?>`;
|
||||
msg = msg.replace('%uid%', userId).replace('%amount%', amount).replace('%network%', currentNetwork);
|
||||
openRechargeModal(msg, false, data.id);
|
||||
amountInput.value = '';
|
||||
}
|
||||
else notify('error', data.error || '<?= __("request_failed") ?>');
|
||||
}).catch(err => { btn.disabled = false; btn.innerHTML = originalText; notify('error', err.message); });
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user