统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -3,108 +3,115 @@
|
||||
@section('title', '赛马竞猜历史记录')
|
||||
|
||||
@section('content')
|
||||
<div class="space-y-6">
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
{{-- 页头 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 flex justify-between items-center">
|
||||
@php
|
||||
$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">🐎 赛马竞猜历史记录</h2>
|
||||
<p class="text-xs text-gray-500 mt-1">查询所有已完成的赛马场次及下注明细。</p>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">🐎 赛马竞猜历史记录</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">查询所有已完成的赛马场次及下注明细。</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.game-configs.index') }}"
|
||||
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-configs.index') }}" class="{{ $adminListSecondaryButtonClass }}">
|
||||
⚙️ 游戏配置
|
||||
</a>
|
||||
</div>
|
||||
|
||||
{{-- 统计卡片 --}}
|
||||
<div class="grid grid-cols-2 md:grid-cols-3 gap-4">
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-3">
|
||||
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-indigo-600">{{ number_format($summary['total_races']) }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">历史总场次</div>
|
||||
<div class="mt-1 text-xs text-gray-500">历史总场次</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-amber-600">{{ number_format($summary['total_bets']) }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">历史总下注笔</div>
|
||||
<div class="mt-1 text-xs text-gray-500">历史总下注笔</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
|
||||
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-emerald-600">{{ number_format($summary['total_pool']) }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">累计注池金币</div>
|
||||
<div class="mt-1 text-xs text-gray-500">累计注池金币</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{-- 场次列表 --}}
|
||||
<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">场次ID</th>
|
||||
<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-center 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-right text-xs font-bold text-gray-500 uppercase">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
@forelse ($races as $race)
|
||||
@php
|
||||
$horses = $race->horses ?? [];
|
||||
$winner = collect($horses)->firstWhere('id', $race->winner_horse_id);
|
||||
$statusLabel = match ($race->status) {
|
||||
'betting' => ['label' => '押注中', 'color' => 'bg-blue-100 text-blue-700'],
|
||||
'running' => ['label' => '比赛中', 'color' => 'bg-amber-100 text-amber-700'],
|
||||
'settled' => ['label' => '已结算', 'color' => 'bg-emerald-100 text-emerald-700'],
|
||||
'canceled' => ['label' => '已取消', 'color' => 'bg-red-100 text-red-600'],
|
||||
default => ['label' => $race->status, 'color' => 'bg-gray-100 text-gray-500'],
|
||||
};
|
||||
@endphp
|
||||
<tr class="hover:bg-gray-50 transition">
|
||||
<td class="px-4 py-3 text-gray-400 text-xs font-mono">#{{ $race->id }}</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-600">
|
||||
{{ $race->settled_at ? $race->settled_at->format('m-d H:i') : '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-sm">
|
||||
{{ collect($horses)->pluck('emoji')->implode('') ?: '—' }}
|
||||
<span class="text-xs text-gray-400">({{ count($horses) }} 匹)</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-bold text-indigo-700">
|
||||
@if ($winner)
|
||||
{{ $winner['emoji'] ?? '' }} {{ $winner['name'] ?? '' }}
|
||||
@else
|
||||
<span class="text-gray-400">—</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span class="px-2 py-0.5 rounded-full text-xs font-bold {{ $statusLabel['color'] }}">
|
||||
{{ $statusLabel['label'] }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right font-mono text-xs text-indigo-600 font-bold">
|
||||
{{ number_format($race->total_bets ?? 0) }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right font-mono text-xs text-amber-600 font-bold">
|
||||
{{ number_format($race->total_pool ?? 0) }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<a href="{{ route('admin.game-history.horse.race', $race->id) }}"
|
||||
class="px-3 py-1 bg-indigo-50 text-indigo-700 rounded text-xs font-bold hover:bg-indigo-100 transition">
|
||||
下注明细
|
||||
</a>
|
||||
</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 }}">场次ID</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">结算时间</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">参赛马匹</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">胜者</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">状态</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">下注总笔</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">注池总额</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">操作</th>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="px-4 py-10 text-center text-gray-400 text-sm">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($races as $race)
|
||||
@php
|
||||
$horses = $race->horses ?? [];
|
||||
$winner = collect($horses)->firstWhere('id', $race->winner_horse_id);
|
||||
$statusLabel = match ($race->status) {
|
||||
'betting' => ['label' => '押注中', 'color' => 'bg-blue-100 text-blue-700 border-blue-200'],
|
||||
'running' => ['label' => '比赛中', 'color' => 'bg-amber-100 text-amber-700 border-amber-200'],
|
||||
'settled' => ['label' => '已结算', 'color' => 'bg-emerald-100 text-emerald-700 border-emerald-200'],
|
||||
'canceled' => ['label' => '已取消', 'color' => 'bg-red-100 text-red-600 border-red-200'],
|
||||
default => ['label' => $race->status, 'color' => 'bg-gray-100 text-gray-500 border-gray-200'],
|
||||
};
|
||||
@endphp
|
||||
<tr class="{{ $adminListTableRowClass }}">
|
||||
<td class="{{ $tableCellClass }} {{ $adminListSecondaryTextClass }} font-mono">#{{ $race->id }}</td>
|
||||
<td class="{{ $tableCellClass }} {{ $adminListBodyTextClass }}">
|
||||
{{ $race->settled_at ? $race->settled_at->format('m-d H:i') : '—' }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center {{ $adminListBodyTextClass }}">
|
||||
{{ collect($horses)->pluck('emoji')->implode('') ?: '—' }}
|
||||
<span class="{{ $adminListSecondaryTextClass }}">({{ count($horses) }} 匹)</span>
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center font-semibold text-indigo-700">
|
||||
@if ($winner)
|
||||
{{ $winner['emoji'] ?? '' }} {{ $winner['name'] ?? '' }}
|
||||
@else
|
||||
<span class="{{ $adminListSecondaryTextClass }}">—</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center">
|
||||
<span class="{{ $badgeClass }} {{ $statusLabel['color'] }}">{{ $statusLabel['label'] }}</span>
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }} font-semibold text-indigo-600">
|
||||
{{ number_format($race->total_bets ?? 0) }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }} font-semibold text-amber-600">
|
||||
{{ number_format($race->total_pool ?? 0) }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right">
|
||||
<a href="{{ route('admin.game-history.horse.race', $race->id) }}"
|
||||
class="{{ $adminListActionButtonClass }} bg-indigo-50 text-indigo-700 hover:bg-indigo-100">
|
||||
下注明细
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="{{ $adminListEmptyClass }}">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if ($races->hasPages())
|
||||
<div class="px-4 py-3 border-t border-gray-100">
|
||||
<div class="{{ $adminListPaginationClass }}">
|
||||
{{ $races->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user