feat: 重构代码架构 + 新增报表/跟单/输赢统计功能
- 拆分 HomeController → TransactionController, ReportWebController, FollowPlanController - 新增 Service 层: TransactionService, ReportService, FollowPlanService - pk10.php JS 抽离为 4 个独立文件 (sound/race/bet/poll) - 前台新增报表查询页面 (/report) + 跟单计划页面 (/follow-plan) - 后台新增跟单计划管理 + 用户输赢明细统计 - 封盘状态显示倒计时 (x:xx) - 音效仅在开奖弹窗打开时播放 - 路由按模块分组整理 - autoload 支持 App\Services 命名空间
This commit is contained in:
+43
-3
@@ -44,15 +44,15 @@
|
||||
<div class="user-balance"><?=number_format($user['balance']??0,2)?></div>
|
||||
</div>
|
||||
<div class="action-buttons">
|
||||
<button class="act-btn" onclick="alert('<?=$t('deposit')?>')">
|
||||
<button class="act-btn" onclick="doDeposit()">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="#1E90FF" stroke-width="2"><line x1="12" y1="5" x2="12" y2="19"/><polyline points="19 12 12 19 5 12"/></svg>
|
||||
<span><?=$t('deposit')?></span>
|
||||
</button>
|
||||
<button class="act-btn" onclick="alert('<?=$t('withdraw')?>')">
|
||||
<button class="act-btn" onclick="doWithdraw()">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="#1E90FF" stroke-width="2"><line x1="12" y1="19" x2="12" y2="5"/><polyline points="5 12 12 5 19 12"/></svg>
|
||||
<span><?=$t('withdraw')?></span>
|
||||
</button>
|
||||
<button class="act-btn" onclick="alert('<?=$t('transfer')?>')">
|
||||
<button class="act-btn" onclick="doTransfer()">
|
||||
<svg viewBox="0 0 24 24" fill="none" stroke="#1E90FF" stroke-width="2"><polyline points="17 1 21 5 17 9"/><path d="M3 11V9a4 4 0 0 1 4-4h14"/><polyline points="7 23 3 19 7 15"/><path d="M21 13v2a4 4 0 0 1-4 4H3"/></svg>
|
||||
<span><?=$t('transfer')?></span>
|
||||
</button>
|
||||
@@ -93,5 +93,45 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function doDeposit(){
|
||||
var url='<?=\App\Core\SettingsHelper::get("customer_service_url")?>';
|
||||
if(!url){alert('<?=$t("contact_admin")?>');return;}
|
||||
var amount=prompt('<?=$t("deposit_amount")?>');
|
||||
if(!amount||isNaN(amount)||parseFloat(amount)<=0)return;
|
||||
fetch('/api/fund-request',{
|
||||
method:'POST',headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify({type:'deposit',amount:parseFloat(amount)})
|
||||
}).then(function(r){return r.json();}).then(function(d){
|
||||
if(d.success){alert('<?=$t("deposit_submitted")?>');window.open(url,'_blank');location.reload();}
|
||||
else{alert(d.message||'<?=$t("error")?>');}
|
||||
});
|
||||
}
|
||||
function doWithdraw(){
|
||||
var amount=prompt('<?=$t("withdraw_amount")?>');
|
||||
if(!amount||isNaN(amount)||parseFloat(amount)<=0)return;
|
||||
fetch('/api/fund-request',{
|
||||
method:'POST',headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify({type:'withdraw',amount:parseFloat(amount)})
|
||||
}).then(function(r){return r.json();}).then(function(d){
|
||||
if(d.success){alert('<?=$t("withdraw_submitted")?>');location.reload();}
|
||||
else{alert(d.message||'<?=$t("error")?>');}
|
||||
});
|
||||
}
|
||||
function doTransfer(){
|
||||
var to=prompt('<?=$t("transfer_to")?>');
|
||||
if(!to||!to.trim())return;
|
||||
var amount=prompt('<?=$t("transfer_amount")?>');
|
||||
if(!amount||isNaN(amount)||parseFloat(amount)<=0)return;
|
||||
if(!confirm('<?=$t("transfer_confirm")?> '+to+' , <?=$t("amount")?>: '+amount))return;
|
||||
fetch('/api/transfer',{
|
||||
method:'POST',headers:{'Content-Type':'application/json'},
|
||||
body:JSON.stringify({to_username:to.trim(),amount:parseFloat(amount)})
|
||||
}).then(function(r){return r.json();}).then(function(d){
|
||||
if(d.success){alert(d.message||'<?=$t("transfer_success")?>');location.reload();}
|
||||
else{alert(d.message||'<?=$t("error")?>');}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<?php $navActive='game'; include __DIR__.'/_nav.php'; ?>
|
||||
</body></html>
|
||||
|
||||
Reference in New Issue
Block a user