统一后台列表页样式并调整站长菜单

This commit is contained in:
2026-04-26 18:10:37 +08:00
parent 61cfc2091c
commit 00270b3904
36 changed files with 2590 additions and 2345 deletions
@@ -3,46 +3,49 @@
@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-4 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-2 xl:grid-cols-4">
<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_dropped']) }}</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-emerald-50 rounded-xl shadow-sm border border-emerald-100 p-5">
<div class="rounded-xl border border-emerald-100 bg-emerald-50 p-5 shadow-sm">
<div class="text-2xl font-bold text-emerald-600">{{ number_format($summary['total_claimed']) }}</div>
<div class="text-xs text-emerald-500 mt-1">已被领取</div>
<div class="mt-1 text-xs text-emerald-500">已被领取</div>
</div>
<div class="bg-gray-50 rounded-xl shadow-sm border border-gray-200 p-5">
<div class="rounded-xl border border-gray-200 bg-gray-50 p-5 shadow-sm">
<div class="text-2xl font-bold text-gray-500">{{ number_format($summary['total_expired']) }}</div>
<div class="text-xs text-gray-400 mt-1">已过期/未领取</div>
<div class="mt-1 text-xs text-gray-400">已过期/未领取</div>
</div>
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-5">
<div class="text-sm font-bold text-gray-700 mb-2">类型分布</div>
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
<div class="mb-2 text-sm font-bold text-gray-700">类型分布</div>
<div class="space-y-1">
<div class="flex justify-between text-xs">
<div class="flex items-center justify-between text-xs">
<span class="text-gray-500">📦 普通箱</span>
<span class="font-bold">{{ $summary['type_dist']['normal'] ?? 0 }}</span>
</div>
<div class="flex justify-between text-xs">
<div class="flex items-center justify-between text-xs">
<span class="text-gray-500">💎 稀有箱</span>
<span class="font-bold text-purple-600">{{ $summary['type_dist']['rare'] ?? 0 }}</span>
</div>
<div class="flex justify-between text-xs">
<div class="flex items-center justify-between text-xs">
<span class="text-gray-500">☠️ 黑化箱</span>
<span class="font-bold text-red-600">{{ $summary['type_dist']['trap'] ?? 0 }}</span>
</div>
@@ -50,122 +53,115 @@
</div>
</div>
{{-- 筛选条件 --}}
<form method="GET"
class="bg-white rounded-xl shadow-sm border border-gray-100 p-4 flex flex-wrap items-end gap-4">
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">箱子类型</label>
<select name="box_type"
class="border border-gray-300 rounded-lg px-3 py-2 text-sm focus:border-indigo-400 min-w-[130px]">
<option value="">全部类型</option>
<option value="normal" {{ request('box_type') === 'normal' ? 'selected' : '' }}>📦 普通</option>
<option value="rare" {{ request('box_type') === 'rare' ? 'selected' : '' }}>💎 稀有</option>
<option value="trap" {{ request('box_type') === 'trap' ? 'selected' : '' }}>☠️ 黑化箱</option>
</select>
<div class="{{ $adminListFilterCardClass }}">
<div class="{{ $adminListFilterInnerClass }}">
<form method="GET" class="{{ $adminListFilterFormClass }}">
<div>
<label class="{{ $adminListFilterLabelClass }}">箱子类型</label>
<select name="box_type" class="min-w-[130px] {{ $adminListFilterInputClass }}">
<option value="">全部类型</option>
<option value="normal" {{ request('box_type') === 'normal' ? 'selected' : '' }}>📦 普通箱</option>
<option value="rare" {{ request('box_type') === 'rare' ? 'selected' : '' }}>💎 稀有</option>
<option value="trap" {{ request('box_type') === 'trap' ? 'selected' : '' }}>☠️ 黑化</option>
</select>
</div>
<div>
<label class="{{ $adminListFilterLabelClass }}">状态</label>
<select name="status" class="min-w-[120px] {{ $adminListFilterInputClass }}">
<option value="">全部状态</option>
<option value="open" {{ request('status') === 'open' ? 'selected' : '' }}>等待领取</option>
<option value="claimed" {{ request('status') === 'claimed' ? 'selected' : '' }}>已领取</option>
<option value="expired" {{ request('status') === 'expired' ? 'selected' : '' }}>已过期</option>
</select>
</div>
<button type="submit" class="{{ $adminListPrimaryButtonClass }}">筛选</button>
<a href="{{ route('admin.game-history.mystery-box') }}" class="{{ $adminListSecondaryButtonClass }}">重置</a>
</form>
</div>
<div>
<label class="block text-xs font-bold text-gray-600 mb-1">状态</label>
<select name="status"
class="border border-gray-300 rounded-lg px-3 py-2 text-sm focus:border-indigo-400 min-w-[120px]">
<option value="">全部状态</option>
<option value="open" {{ request('status') === 'open' ? 'selected' : '' }}>等待领取</option>
<option value="claimed" {{ request('status') === 'claimed' ? 'selected' : '' }}>已领取</option>
<option value="expired" {{ request('status') === 'expired' ? 'selected' : '' }}>已过期</option>
</select>
</div>
<div class="flex gap-2">
<button type="submit"
class="px-5 py-2 bg-indigo-600 text-white rounded-lg font-bold hover:bg-indigo-700 transition text-sm">
🔍 筛选
</button>
<a href="{{ route('admin.game-history.mystery-box') }}"
class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg font-bold hover:bg-gray-200 transition text-sm">
重置
</a>
</div>
</form>
</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">投放时间</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-center text-xs font-bold text-gray-500 uppercase">状态</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-right text-xs font-bold text-gray-500 uppercase">实际奖励</th>
<th class="px-4 py-3 text-left text-xs font-bold text-gray-500 uppercase">领取时间</th>
</tr>
</thead>
<tbody class="divide-y divide-gray-50">
@forelse ($boxes as $box)
@php
$typeInfo = match ($box->box_type) {
'normal' => ['label' => '📦 普通箱', 'color' => 'bg-emerald-100 text-emerald-700'],
'rare' => ['label' => '💎 稀有箱', 'color' => 'bg-purple-100 text-purple-700'],
'trap' => ['label' => '☠️ 黑化箱', 'color' => 'bg-red-100 text-red-700'],
default => ['label' => '📦 未知', 'color' => 'bg-gray-100 text-gray-600'],
};
$statusInfo = match ($box->status) {
'open' => ['label' => '等待领取', 'color' => 'bg-blue-100 text-blue-700'],
'claimed' => ['label' => '✅ 已领取', 'color' => 'bg-emerald-100 text-emerald-700'],
'expired' => ['label' => '⏰ 已过期', 'color' => 'bg-gray-100 text-gray-500'],
default => ['label' => $box->status, 'color' => 'bg-gray-100 text-gray-500'],
};
$claim = $box->claim;
@endphp
<tr class="hover:bg-gray-50 transition">
<td class="px-4 py-3 text-xs text-gray-400">
{{ $box->created_at->format('m-d H:i:s') }}
</td>
<td class="px-4 py-3 text-center">
<span class="px-2 py-0.5 rounded-full text-xs font-bold {{ $typeInfo['color'] }}">
{{ $typeInfo['label'] }}
</span>
</td>
<td class="px-4 py-3 text-center text-xs text-gray-600 font-mono">
{{ number_format($box->reward_min) }} ~ {{ number_format($box->reward_max) }}
</td>
<td class="px-4 py-3 text-center">
<code class="bg-gray-100 px-2 py-0.5 rounded text-xs text-indigo-700 font-bold">
{{ $box->passcode ?? '—' }}
</code>
</td>
<td class="px-4 py-3 text-center">
<span class="px-2 py-0.5 rounded-full text-xs font-bold {{ $statusInfo['color'] }}">
{{ $statusInfo['label'] }}
</span>
</td>
<td class="px-4 py-3 font-medium text-gray-700 text-sm">
{{ $claim?->user?->username ?? '—' }}
</td>
<td class="px-4 py-3 text-right font-mono text-xs">
@if ($claim)
<span
class="{{ $claim->reward_amount > 0 ? 'text-emerald-600 font-bold' : 'text-red-500 font-bold' }}">
{{ $claim->reward_amount > 0 ? '+' : '' }}{{ number_format($claim->reward_amount) }}
</span>
@else
<span class="text-gray-400"></span>
@endif
</td>
<td class="px-4 py-3 text-xs text-gray-400">
{{ $claim?->created_at?->format('m-d 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-center">奖励范围</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">暗号</th>
<th class="{{ $adminListTableHeadCellClass }} text-center">状态</th>
<th class="{{ $adminListTableHeadCellClass }}">领取者</th>
<th class="{{ $adminListTableHeadCellClass }} text-right">实际奖励</th>
<th class="{{ $adminListTableHeadCellClass }}">领取时间</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 ($boxes as $box)
@php
$typeInfo = match ($box->box_type) {
'normal' => ['label' => '📦 普通箱', 'color' => 'bg-emerald-100 text-emerald-700 border-emerald-200'],
'rare' => ['label' => '💎 稀有箱', 'color' => 'bg-purple-100 text-purple-700 border-purple-200'],
'trap' => ['label' => '☠️ 黑化箱', 'color' => 'bg-red-100 text-red-700 border-red-200'],
default => ['label' => '📦 未知', 'color' => 'bg-gray-100 text-gray-600 border-gray-200'],
};
$statusInfo = match ($box->status) {
'open' => ['label' => '等待领取', 'color' => 'bg-blue-100 text-blue-700 border-blue-200'],
'claimed' => ['label' => '✅ 已领取', 'color' => 'bg-emerald-100 text-emerald-700 border-emerald-200'],
'expired' => ['label' => '⏰ 已过期', 'color' => 'bg-gray-100 text-gray-500 border-gray-200'],
default => ['label' => $box->status, 'color' => 'bg-gray-100 text-gray-500 border-gray-200'],
};
$claim = $box->claim;
@endphp
<tr class="{{ $adminListTableRowClass }}">
<td class="{{ $tableCellClass }} {{ $adminListSecondaryTextClass }}">
{{ $box->created_at->format('m-d H:i:s') }}
</td>
<td class="{{ $tableCellClass }} text-center">
<span class="{{ $badgeClass }} {{ $typeInfo['color'] }}">{{ $typeInfo['label'] }}</span>
</td>
<td class="{{ $tableCellClass }} text-center {{ $adminListNumericTextClass }} text-gray-600">
{{ number_format($box->reward_min) }} ~ {{ number_format($box->reward_max) }}
</td>
<td class="{{ $tableCellClass }} text-center">
<code class="rounded bg-gray-100 px-2 py-0.5 text-xs font-bold text-indigo-700">
{{ $box->passcode ?? '—' }}
</code>
</td>
<td class="{{ $tableCellClass }} text-center">
<span class="{{ $badgeClass }} {{ $statusInfo['color'] }}">{{ $statusInfo['label'] }}</span>
</td>
<td class="{{ $tableCellClass }} {{ $adminListPrimaryTextClass }}">
{{ $claim?->user?->username ?? '—' }}
</td>
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }}">
@if ($claim)
<span class="{{ $claim->reward_amount > 0 ? 'font-semibold text-emerald-600' : 'font-semibold text-red-500' }}">
{{ $claim->reward_amount > 0 ? '+' : '' }}{{ number_format($claim->reward_amount) }}
</span>
@else
<span class="{{ $adminListSecondaryTextClass }}"></span>
@endif
</td>
<td class="{{ $tableCellClass }} {{ $adminListSecondaryTextClass }}">
{{ $claim?->created_at?->format('m-d H:i:s') ?? '—' }}
</td>
</tr>
@empty
<tr>
<td colspan="8" class="{{ $adminListEmptyClass }}">暂无记录</td>
</tr>
@endforelse
</tbody>
</table>
</div>
@if ($boxes->hasPages())
<div class="px-4 py-3 border-t border-gray-100">
<div class="{{ $adminListPaginationClass }}">
{{ $boxes->links() }}
</div>
@endif