统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -3,43 +3,44 @@
|
||||
@section('title', "赛马第 #{$race->id} 场下注明细")
|
||||
|
||||
@section('content')
|
||||
<div class="space-y-6">
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
{{-- 页头 --}}
|
||||
@php
|
||||
$horses = $race->horses ?? [];
|
||||
$winner = collect($horses)->firstWhere('id', $race->winner_horse_id);
|
||||
@endphp
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 flex justify-between items-center">
|
||||
@php
|
||||
$horses = $race->horses ?? [];
|
||||
$winner = collect($horses)->firstWhere('id', $race->winner_horse_id);
|
||||
$tableCellClass = 'px-4 py-3';
|
||||
$badgeClass = $adminListBadgeBaseClass;
|
||||
@endphp
|
||||
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }} flex flex-col gap-4 lg:flex-row lg:items-center lg:justify-between">
|
||||
<div>
|
||||
<h2 class="text-lg font-bold text-gray-800">🐎 赛马 #{{ $race->id }} 场下注明细</h2>
|
||||
<p class="text-xs text-gray-500 mt-1">
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">🐎 赛马 #{{ $race->id }} 场下注明细</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">
|
||||
结算时间:{{ $race->settled_at?->format('Y-m-d H:i:s') ?? '未结算' }}
|
||||
@if ($winner)
|
||||
· 胜者:<span class="font-bold text-indigo-600">{{ $winner['emoji'] ?? '' }}
|
||||
{{ $winner['name'] ?? '' }}</span>
|
||||
· 胜者:<span class="font-semibold text-indigo-600">{{ $winner['emoji'] ?? '' }} {{ $winner['name'] ?? '' }}</span>
|
||||
@endif
|
||||
· 注池:<span class="font-bold text-amber-600">{{ number_format($race->total_pool ?? 0) }}
|
||||
金币</span>
|
||||
· 注池:<span class="font-semibold text-amber-600">{{ number_format($race->total_pool ?? 0) }} 金币</span>
|
||||
</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.game-history.horse') }}"
|
||||
class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg text-sm font-bold hover:bg-gray-200 transition">
|
||||
<a href="{{ route('admin.game-history.horse') }}" class="{{ $adminListSecondaryButtonClass }}">
|
||||
← 返回场次列表
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- 马匹信息 --}}
|
||||
@if (count($horses) > 0)
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="text-sm font-bold text-gray-700 mb-3">参赛马匹</div>
|
||||
<div class="flex flex-wrap gap-3">
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div class="{{ $adminListSectionTitleClass }}">参赛马匹</div>
|
||||
<div class="{{ $adminListSectionDescClass }}">保留冠军高亮,仅统一容器与间距风格。</div>
|
||||
</div>
|
||||
<div class="flex flex-wrap gap-3 p-6">
|
||||
@foreach ($horses as $horse)
|
||||
<div
|
||||
class="px-4 py-2 rounded-lg {{ $horse['id'] === $race->winner_horse_id ? 'bg-amber-100 border-2 border-amber-400' : 'bg-gray-100' }}">
|
||||
class="rounded-lg border px-4 py-3 {{ $horse['id'] === $race->winner_horse_id ? 'border-amber-400 bg-amber-100' : 'border-gray-200 bg-gray-50' }}">
|
||||
<div class="text-lg">{{ $horse['emoji'] ?? '🐎' }}</div>
|
||||
<div
|
||||
class="text-xs font-bold {{ $horse['id'] === $race->winner_horse_id ? 'text-amber-700' : 'text-gray-600' }}">
|
||||
<div class="mt-1 text-xs font-bold {{ $horse['id'] === $race->winner_horse_id ? 'text-amber-700' : 'text-gray-600' }}">
|
||||
{{ $horse['name'] }}
|
||||
@if ($horse['id'] === $race->winner_horse_id)
|
||||
🏆
|
||||
@@ -51,71 +52,72 @@
|
||||
</div>
|
||||
@endif
|
||||
|
||||
{{-- 下注明细表 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 border-b border-gray-100">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left text-xs font-bold text-gray-500 uppercase">玩家</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-bold text-gray-500 uppercase">押注马匹</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-bold text-gray-500 uppercase">押注金额</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-bold text-gray-500 uppercase">实际获得</th>
|
||||
<th class="px-4 py-3 text-center text-xs font-bold text-gray-500 uppercase">是否中奖</th>
|
||||
<th class="px-4 py-3 text-right text-xs font-bold text-gray-500 uppercase">下注时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
@forelse ($bets as $bet)
|
||||
@php
|
||||
$betHorse = collect($horses)->firstWhere('id', $bet->horse_id);
|
||||
$isWinner = $bet->horse_id === $race->winner_horse_id;
|
||||
$won = ($bet->payout ?? 0) > 0;
|
||||
@endphp
|
||||
<tr class="hover:bg-gray-50 transition {{ $won ? 'bg-amber-50/50' : '' }}">
|
||||
<td class="px-4 py-3 font-medium text-gray-800">
|
||||
{{ $bet->user?->username ?? '已注销' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($betHorse)
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold {{ $isWinner ? 'bg-amber-100 text-amber-700' : 'bg-gray-100 text-gray-600' }}">
|
||||
{{ $betHorse['emoji'] ?? '' }} {{ $betHorse['name'] ?? '' }}
|
||||
</span>
|
||||
@else
|
||||
<span class="text-gray-400 text-xs">#{{ $bet->horse_id }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right font-mono text-sm text-gray-700">
|
||||
{{ number_format($bet->amount) }}
|
||||
</td>
|
||||
<td
|
||||
class="px-4 py-3 text-right font-mono text-sm {{ $won ? 'text-emerald-600 font-bold' : 'text-gray-400' }}">
|
||||
{{ $won ? '+' . number_format($bet->payout) : '0' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($won)
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold bg-emerald-100 text-emerald-700">🎉
|
||||
中奖</span>
|
||||
@else
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold bg-gray-100 text-gray-500">未中</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right text-xs text-gray-400">
|
||||
{{ $bet->created_at->format('H:i:s') }}
|
||||
</td>
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div class="{{ $adminListSectionTitleClass }}">下注明细</div>
|
||||
<div class="{{ $adminListSectionDescClass }}">统一下注列表样式,保留命中胜马与中奖状态颜色。</div>
|
||||
</div>
|
||||
|
||||
<div class="{{ $adminListTableWrapClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead>
|
||||
<tr class="{{ $adminListTableHeadRowClass }}">
|
||||
<th class="{{ $adminListTableHeadCellClass }}">玩家</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">押注马匹</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">押注金额</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">实际获得</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">是否中奖</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">下注时间</th>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="px-4 py-10 text-center text-gray-400 text-sm">本场无人下注</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($bets as $bet)
|
||||
@php
|
||||
$betHorse = collect($horses)->firstWhere('id', $bet->horse_id);
|
||||
$isWinner = $bet->horse_id === $race->winner_horse_id;
|
||||
$won = ($bet->payout ?? 0) > 0;
|
||||
@endphp
|
||||
<tr class="{{ $adminListTableRowClass }} {{ $won ? 'bg-amber-50/50' : '' }}">
|
||||
<td class="{{ $tableCellClass }} {{ $adminListPrimaryTextClass }}">
|
||||
{{ $bet->user?->username ?? '已注销' }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center">
|
||||
@if ($betHorse)
|
||||
<span class="{{ $badgeClass }} {{ $isWinner ? 'border-amber-200 bg-amber-100 text-amber-700' : 'border-gray-200 bg-gray-100 text-gray-600' }}">
|
||||
{{ $betHorse['emoji'] ?? '' }} {{ $betHorse['name'] ?? '' }}
|
||||
</span>
|
||||
@else
|
||||
<span class="{{ $adminListSecondaryTextClass }}">#{{ $bet->horse_id }}</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }} text-gray-700">
|
||||
{{ number_format($bet->amount) }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }} {{ $won ? 'font-semibold text-emerald-600' : 'text-gray-400' }}">
|
||||
{{ $won ? '+' . number_format($bet->payout) : '0' }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center">
|
||||
@if ($won)
|
||||
<span class="{{ $badgeClass }} border-emerald-200 bg-emerald-100 text-emerald-700">🎉 中奖</span>
|
||||
@else
|
||||
<span class="{{ $badgeClass }} border-gray-200 bg-gray-100 text-gray-500">未中</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListSecondaryTextClass }}">
|
||||
{{ $bet->created_at->format('H:i:s') }}
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="6" class="{{ $adminListEmptyClass }}">本场无人下注</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if ($bets->hasPages())
|
||||
<div class="px-4 py-3 border-t border-gray-100">
|
||||
<div class="{{ $adminListPaginationClass }}">
|
||||
{{ $bets->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user