diff --git a/admin/customer_service.php b/admin/customer_service.php index 10cd196..71acece 100644 --- a/admin/customer_service.php +++ b/admin/customer_service.php @@ -175,12 +175,49 @@ ob_start(); + + + + ${remark ? `
[备注: ${remark}]
` : ''} -
${u.message}
+
${lastMsgText}
UID: ${uid} ${ip} @@ -351,11 +393,23 @@ function appendMessageHTML(m) { const timeStr = msgDate.toLocaleTimeString('zh-CN', {hour: '2-digit', minute:'2-digit', second: '2-digit'}); const recallHtml = m.sender === 'admin' ? `撤回` : ''; const isImage = typeof m.message === 'string' && m.message.indexOf(' +
已发送收款账号
+
${info.bank} - ${info.name}
+
`; + } catch(e) { displayMsg = '[支付信息错误]'; } + } + if (isImage) { div.style.padding = '5px'; div.style.background = m.sender === 'admin' ? '#007bff' : '#f0f0f0'; @@ -363,7 +417,7 @@ function appendMessageHTML(m) { } div.innerHTML = ` -
${m.message}
+
${displayMsg}
${timeStr} ${recallHtml}
`; @@ -374,6 +428,45 @@ document.getElementById('plus-btn').addEventListener('click', () => { document.getElementById('image-input').click(); }); +const paymentModal = new bootstrap.Modal(document.getElementById('paymentModal')); +document.getElementById('payment-btn').addEventListener('click', () => { + paymentModal.show(); +}); + +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 note = document.getElementById('pay-note').value.trim(); + + if (!bank || !name || !account) { + alert('请完整填写收款信息'); + return; + } + + const info = { bank, name, account, note }; + const msg = `[PAYMENT_INFO]${JSON.stringify(info)}`; + + const fd = new URLSearchParams(); + fd.append('message', msg); + fd.append('user_id', selectedUser); + fd.append('ip_address', selectedIp); + + try { + const r = await fetch('/api/chat.php?action=admin_send', { method: 'POST', body: fd }); + const res = await r.json(); + if (res.success) { + paymentModal.hide(); + // Clear inputs + document.getElementById('pay-bank').value = ''; + document.getElementById('pay-name').value = ''; + document.getElementById('pay-account').value = ''; + document.getElementById('pay-note').value = ''; + fetchMessages(); + } + } catch(err) {} +} + document.getElementById('image-input').addEventListener('change', async (e) => { const file = e.target.files[0]; if (!file) return; diff --git a/assets/pasted-20260220-151143-1fc00a8c.png b/assets/pasted-20260220-151143-1fc00a8c.png new file mode 100644 index 0000000..86ad672 Binary files /dev/null and b/assets/pasted-20260220-151143-1fc00a8c.png differ diff --git a/db/exchange_rates.json b/db/exchange_rates.json index a9faf03..44e9a35 100644 --- a/db/exchange_rates.json +++ b/db/exchange_rates.json @@ -1 +1 @@ -{"USD":1,"AED":3.67,"AFN":62.82,"ALL":81.38,"AMD":377.18,"ANG":1.79,"AOA":921.13,"ARS":1452.25,"AUD":1.42,"AWG":1.79,"AZN":1.7,"BAM":1.66,"BBD":2,"BDT":122.19,"BGN":1.6,"BHD":0.376,"BIF":2967.31,"BMD":1,"BND":1.27,"BOB":6.92,"BRL":5.22,"BSD":1,"BTN":90.77,"BWP":13.29,"BYN":2.84,"BZD":2,"CAD":1.37,"CDF":2281.91,"CHF":0.772,"CLF":0.0219,"CLP":866.65,"CNH":6.9,"CNY":6.91,"COP":3648.29,"CRC":481.3,"CUP":24,"CVE":93.37,"CZK":20.52,"DJF":177.72,"DKK":6.31,"DOP":61.55,"DZD":129.72,"EGP":46.95,"ERN":15,"ETB":154.44,"EUR":0.847,"FJD":2.2,"FKP":0.739,"FOK":6.31,"GBP":0.739,"GEL":2.68,"GGP":0.739,"GHS":11.02,"GIP":0.739,"GMD":74.1,"GNF":8762.47,"GTQ":7.67,"GYD":209.26,"HKD":7.82,"HNL":26.44,"HRK":6.38,"HTG":131.36,"HUF":320.31,"IDR":16895.02,"ILS":3.11,"IMP":0.739,"INR":90.77,"IQD":1310.4,"IRR":1281616.32,"ISK":122.37,"JEP":0.739,"JMD":155.71,"JOD":0.709,"JPY":154.42,"KES":129,"KGS":87.48,"KHR":4017.09,"KID":1.42,"KMF":416.61,"KRW":1447.31,"KWD":0.306,"KYD":0.833,"KZT":489.38,"LAK":21513.29,"LBP":89500,"LKR":309.13,"LRD":185.55,"LSL":16.06,"LYD":6.3,"MAD":9.14,"MDL":17.01,"MGA":4331.69,"MKD":52.14,"MMK":2100.51,"MNT":3550.21,"MOP":8.05,"MRU":39.97,"MUR":45.96,"MVR":15.45,"MWK":1739.99,"MXN":17.18,"MYR":3.9,"MZN":63.72,"NAD":16.06,"NGN":1338.38,"NIO":36.78,"NOK":9.52,"NPR":145.24,"NZD":1.67,"OMR":0.384,"PAB":1,"PEN":3.35,"PGK":4.33,"PHP":57.94,"PKR":279.71,"PLN":3.57,"PYG":6522.64,"QAR":3.64,"RON":4.3,"RSD":99.15,"RUB":76.67,"RWF":1460.55,"SAR":3.75,"SBD":8.02,"SCR":14.01,"SDG":543.58,"SEK":9.02,"SGD":1.27,"SHP":0.739,"SLE":24.46,"SLL":24455.37,"SOS":570.65,"SRD":37.71,"SSP":4568.21,"STN":20.75,"SYP":113.49,"SZL":16.06,"THB":31.26,"TJS":9.4,"TMT":3.5,"TND":2.86,"TOP":2.36,"TRY":43.77,"TTD":6.75,"TVD":1.42,"TWD":31.47,"TZS":2574.76,"UAH":43.3,"UGX":3532.39,"UYU":38.82,"UZS":12156.76,"VES":398.75,"VND":25919.9,"VUV":118.59,"WST":2.68,"XAF":555.48,"XCD":2.7,"XCG":1.79,"XDR":0.726,"XOF":555.48,"XPF":101.05,"YER":238.28,"ZAR":16.06,"ZMW":18.61,"ZWG":25.6,"ZWL":25.6} \ No newline at end of file +{"USD":1,"AED":3.67,"AFN":62.82,"ALL":81.84,"AMD":377.04,"ANG":1.79,"AOA":921.61,"ARS":1452.25,"AUD":1.42,"AWG":1.79,"AZN":1.7,"BAM":1.66,"BBD":2,"BDT":122.38,"BGN":1.61,"BHD":0.376,"BIF":2970.24,"BMD":1,"BND":1.27,"BOB":6.95,"BRL":5.23,"BSD":1,"BTN":91.07,"BWP":13.49,"BYN":2.85,"BZD":2,"CAD":1.37,"CDF":2274.65,"CHF":0.775,"CLF":0.0218,"CLP":862.61,"CNH":6.9,"CNY":6.92,"COP":3681.92,"CRC":482.89,"CUP":24,"CVE":93.67,"CZK":20.6,"DJF":177.72,"DKK":6.34,"DOP":61.77,"DZD":130.18,"EGP":47.56,"ERN":15,"ETB":155,"EUR":0.85,"FJD":2.2,"FKP":0.743,"FOK":6.34,"GBP":0.743,"GEL":2.68,"GGP":0.743,"GHS":11.02,"GIP":0.743,"GMD":74.11,"GNF":8759.48,"GTQ":7.69,"GYD":209.23,"HKD":7.81,"HNL":26.53,"HRK":6.4,"HTG":131.33,"HUF":322.26,"IDR":16900.93,"ILS":3.14,"IMP":0.743,"INR":91.08,"IQD":1310.74,"IRR":1286967.92,"ISK":123.16,"JEP":0.743,"JMD":156.2,"JOD":0.709,"JPY":155.01,"KES":128.98,"KGS":87.45,"KHR":4018.24,"KID":1.42,"KMF":417.93,"KRW":1449.41,"KWD":0.307,"KYD":0.833,"KZT":492.36,"LAK":21626,"LBP":89500,"LKR":309.19,"LRD":186.21,"LSL":16.17,"LYD":6.31,"MAD":9.16,"MDL":17.07,"MGA":4341.94,"MKD":52.1,"MMK":2106.54,"MNT":3543.97,"MOP":8.05,"MRU":40,"MUR":46.19,"MVR":15.47,"MWK":1741.99,"MXN":17.26,"MYR":3.91,"MZN":63.61,"NAD":16.17,"NGN":1345.77,"NIO":36.91,"NOK":9.56,"NPR":145.72,"NZD":1.67,"OMR":0.384,"PAB":1,"PEN":3.36,"PGK":4.34,"PHP":58.05,"PKR":280,"PLN":3.59,"PYG":6549.98,"QAR":3.64,"RON":4.33,"RSD":99.77,"RUB":76.79,"RWF":1460.66,"SAR":3.75,"SBD":7.96,"SCR":14.14,"SDG":511.55,"SEK":9.07,"SGD":1.27,"SHP":0.743,"SLE":24.46,"SLL":24455.37,"SOS":570.82,"SRD":37.72,"SSP":4576.76,"STN":20.81,"SYP":113.2,"SZL":16.17,"THB":31.2,"TJS":9.4,"TMT":3.5,"TND":2.87,"TOP":2.37,"TRY":43.81,"TTD":6.77,"TVD":1.42,"TWD":31.59,"TZS":2582.55,"UAH":43.32,"UGX":3547.23,"UYU":38.91,"UZS":12177.35,"VES":402.33,"VND":25905.86,"VUV":118.62,"WST":2.68,"XAF":557.24,"XCD":2.7,"XCG":1.79,"XDR":0.728,"XOF":557.24,"XPF":101.37,"YER":238.87,"ZAR":16.17,"ZMW":18.72,"ZWG":25.57,"ZWL":25.57} \ No newline at end of file diff --git a/includes/lang.php b/includes/lang.php index 9a2d27c..6f73adf 100644 --- a/includes/lang.php +++ b/includes/lang.php @@ -528,6 +528,29 @@ $translations = [ 'swap_success_desc' => '您的兑换已成功完成!', 'unknown_error' => '发生未知错误', 'rate_fetch_failed' => '获取汇率失败(服务商问题)', + 'matching_account' => '正在匹配充值账户', + 'matching_desc' => '系统正在为您匹配最合适的充值账户,请稍后...', + 'security_instructions' => '安全说明', + 'security_tip_1' => '请在倒计时结束前完成充值', + 'security_tip_2' => '转账时请务必备注您的用户ID', + 'security_tip_3' => '如有任何疑问请及时联系客服', + 'safe_payment' => '安全支付', + 'instant_confirmation' => '即时确认', + 'remaining_time' => '剩余时间', + 'account_matched' => '已成功匹配收款账户', + 'account_matched_desc' => '请按照以下信息完成转账汇款。', + 'bank_name' => '银行/支付方式', + 'payee_name' => '收款人姓名', + 'account_number' => '收款账号', + 'transfer_note' => '转账备注', + 'copy_info' => '复制', + 'transfer_steps_title' => '转账步骤说明', + 'step_1' => '打开您的银行 APP 或支付应用', + 'step_2' => '按照匹配金额准确转账至上方账户', + 'step_3' => '务必填写转账备注(如有)并保留凭证', + 'step_4' => '转账完成后在聊天框告知客服或等待系统同步', + 'recharge_success_title' => '申请已提交', + 'recharge_success_text' => '您的充值申请已收到,请等待审核通过。', ], 'en' => [ 'home' => 'Home', @@ -1035,6 +1058,29 @@ $translations = [ 'swap_success_desc' => 'Your exchange has been completed successfully!', 'unknown_error' => 'Unknown error occurred', 'rate_fetch_failed' => 'Failed to fetch exchange rate (Provider issue)', + 'matching_account' => 'Matching Account', + 'matching_desc' => 'System is matching the most suitable recharge account for you, please wait...', + 'security_instructions' => 'Security Instructions', + 'security_tip_1' => 'Please complete the recharge before the countdown ends', + 'security_tip_2' => 'Be sure to note your User ID when transferring', + 'security_tip_3' => 'Contact customer service if you have any questions', + 'safe_payment' => 'Safe Payment', + 'instant_confirmation' => 'Instant Confirmation', + 'remaining_time' => 'Remaining Time', + 'account_matched' => 'Account Matched Successfully', + 'account_matched_desc' => 'Please complete the transfer according to the following info.', + 'bank_name' => 'Bank Name', + 'payee_name' => 'Payee Name', + 'account_number' => 'Account Number', + 'transfer_note' => 'Transfer Note', + 'copy_info' => 'Copy', + 'transfer_steps_title' => 'Transfer Steps', + 'step_1' => 'Open your banking app or wallet', + 'step_2' => 'Transfer exact amount to the matched account', + 'step_3' => 'Keep your transfer receipt for verification', + 'step_4' => 'Click "I have paid" in chat or wait for system sync', + 'recharge_success_title' => 'Request Submitted', + 'recharge_success_text' => 'Your recharge request has been received. Please wait for approval.', ], ]; diff --git a/recharge.php b/recharge.php index d4870f0..ce7a838 100644 --- a/recharge.php +++ b/recharge.php @@ -190,6 +190,174 @@ $bep20_addr = $settings['usdt_bep20_address'] ?? '0x742d35Cc6634C0532925a3b844Bc } + + + + +