统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -3,49 +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;
|
||||
$gradeAll = [
|
||||
'jackpot' => ['label' => '上上签', 'color' => 'text-amber-600'],
|
||||
'good' => ['label' => '上签', 'color' => 'text-emerald-600'],
|
||||
'normal' => ['label' => '中签', 'color' => 'text-gray-500'],
|
||||
'bad' => ['label' => '下签', 'color' => 'text-orange-500'],
|
||||
'curse' => ['label' => '大凶签', 'color' => 'text-red-600'],
|
||||
];
|
||||
@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_times']) }}</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="text-2xl font-bold text-amber-500">{{ number_format($summary['grade_dist']['jackpot'] ?? 0) }}
|
||||
</div>
|
||||
<div class="text-xs text-gray-500 mt-1">✨ 上上签次数</div>
|
||||
<div class="rounded-xl border border-gray-100 bg-white p-5 shadow-sm">
|
||||
<div class="text-2xl font-bold text-amber-500">{{ number_format($summary['grade_dist']['jackpot'] ?? 0) }}</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-red-500">{{ number_format($summary['grade_dist']['curse'] ?? 0) }}</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="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">
|
||||
@php
|
||||
$gradeAll = [
|
||||
'jackpot' => ['label' => '上上签', 'color' => 'text-amber-600'],
|
||||
'good' => ['label' => '上签', 'color' => 'text-emerald-600'],
|
||||
'normal' => ['label' => '中签', 'color' => 'text-gray-500'],
|
||||
'bad' => ['label' => '下签', 'color' => 'text-orange-500'],
|
||||
'curse' => ['label' => '大凶签', 'color' => 'text-red-600'],
|
||||
];
|
||||
@endphp
|
||||
@foreach ($gradeAll as $key => $meta)
|
||||
<div class="flex justify-between text-xs">
|
||||
<div class="flex items-center justify-between text-xs">
|
||||
<span class="{{ $meta['color'] }}">{{ $meta['label'] }}</span>
|
||||
<span class="font-bold text-gray-700">{{ $summary['grade_dist'][$key] ?? 0 }}</span>
|
||||
</div>
|
||||
@@ -54,107 +54,100 @@
|
||||
</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="grade"
|
||||
class="border border-gray-300 rounded-lg px-3 py-2 text-sm focus:border-indigo-400 min-w-[130px]">
|
||||
<option value="">全部等级</option>
|
||||
@foreach ($gradeAll as $key => $meta)
|
||||
<option value="{{ $key }}" {{ request('grade') === $key ? 'selected' : '' }}>
|
||||
{{ $meta['label'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="{{ $adminListFilterCardClass }}">
|
||||
<div class="{{ $adminListFilterInnerClass }}">
|
||||
<form method="GET" class="{{ $adminListFilterFormClass }}">
|
||||
<div>
|
||||
<label class="{{ $adminListFilterLabelClass }}">签文等级</label>
|
||||
<select name="grade" class="min-w-[130px] {{ $adminListFilterInputClass }}">
|
||||
<option value="">全部等级</option>
|
||||
@foreach ($gradeAll as $key => $meta)
|
||||
<option value="{{ $key }}" {{ request('grade') === $key ? 'selected' : '' }}>
|
||||
{{ $meta['label'] }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="{{ $adminListFilterLabelClass }}">玩家名称</label>
|
||||
<input type="text" name="username" value="{{ request('username') }}" placeholder="模糊搜索..."
|
||||
class="w-40 {{ $adminListFilterInputClass }}">
|
||||
</div>
|
||||
<button type="submit" class="{{ $adminListPrimaryButtonClass }}">筛选</button>
|
||||
<a href="{{ route('admin.game-history.fortune') }}" class="{{ $adminListSecondaryButtonClass }}">重置</a>
|
||||
</form>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">玩家名称</label>
|
||||
<input type="text" name="username" value="{{ request('username') }}" placeholder="模糊搜索..."
|
||||
class="border border-gray-300 rounded-lg px-3 py-2 text-sm focus:border-indigo-400 w-40">
|
||||
</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.fortune') }}"
|
||||
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-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-left text-xs font-bold text-gray-500 uppercase w-1/3">签文内容</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-right text-xs font-bold text-gray-500 uppercase">消耗金币</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
@forelse ($logs as $log)
|
||||
@php
|
||||
$gradeInfo = match ($log->grade) {
|
||||
'jackpot' => ['label' => '✨ 上上签', 'color' => 'bg-amber-100 text-amber-700'],
|
||||
'good' => ['label' => '🌸 上签', 'color' => 'bg-emerald-100 text-emerald-700'],
|
||||
'normal' => ['label' => '📜 中签', 'color' => 'bg-gray-100 text-gray-600'],
|
||||
'bad' => ['label' => '😞 下签', 'color' => 'bg-orange-100 text-orange-700'],
|
||||
'curse' => ['label' => '💀 大凶签', 'color' => 'bg-red-100 text-red-700'],
|
||||
default => ['label' => $log->grade, 'color' => 'bg-gray-100 text-gray-500'],
|
||||
};
|
||||
@endphp
|
||||
<tr
|
||||
class="hover:bg-gray-50 transition {{ in_array($log->grade, ['jackpot']) ? 'bg-amber-50/50' : (in_array($log->grade, ['curse']) ? 'bg-red-50/30' : '') }}">
|
||||
<td class="px-4 py-3 text-xs text-gray-400">
|
||||
{{ $log->created_at->format('m-d H:i') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 font-medium text-gray-800">
|
||||
{{ $log->user?->username ?? '已注销' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span class="px-2 py-0.5 rounded-full text-xs font-bold {{ $gradeInfo['color'] }}">
|
||||
{{ $gradeInfo['label'] }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-600 leading-relaxed">
|
||||
{{ \Illuminate\Support\Str::limit($log->text, 50) }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500">
|
||||
{{ $log->buff_desc ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($log->is_free)
|
||||
<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-amber-100 text-amber-700">付费</span>
|
||||
@endif
|
||||
</td>
|
||||
<td
|
||||
class="px-4 py-3 text-right font-mono text-xs {{ $log->cost > 0 ? 'text-red-500' : 'text-gray-400' }}">
|
||||
{{ $log->cost > 0 ? '-' . number_format($log->cost) : '0' }}
|
||||
</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 }}">玩家</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">签文等级</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} w-1/3">签文内容</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">加成/减益</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">是否免费</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">消耗金币</th>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-10 text-center text-gray-400 text-sm">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($logs as $log)
|
||||
@php
|
||||
$gradeInfo = match ($log->grade) {
|
||||
'jackpot' => ['label' => '✨ 上上签', 'color' => 'bg-amber-100 text-amber-700 border-amber-200'],
|
||||
'good' => ['label' => '🌸 上签', 'color' => 'bg-emerald-100 text-emerald-700 border-emerald-200'],
|
||||
'normal' => ['label' => '📜 中签', 'color' => 'bg-gray-100 text-gray-600 border-gray-200'],
|
||||
'bad' => ['label' => '😞 下签', 'color' => 'bg-orange-100 text-orange-700 border-orange-200'],
|
||||
'curse' => ['label' => '💀 大凶签', 'color' => 'bg-red-100 text-red-700 border-red-200'],
|
||||
default => ['label' => $log->grade, 'color' => 'bg-gray-100 text-gray-500 border-gray-200'],
|
||||
};
|
||||
@endphp
|
||||
<tr class="{{ $adminListTableRowClass }} {{ in_array($log->grade, ['jackpot']) ? 'bg-amber-50/50' : (in_array($log->grade, ['curse']) ? 'bg-red-50/30' : '') }}">
|
||||
<td class="{{ $tableCellClass }} {{ $adminListSecondaryTextClass }}">
|
||||
{{ $log->created_at->format('m-d H:i') }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} {{ $adminListPrimaryTextClass }}">
|
||||
{{ $log->user?->username ?? '已注销' }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center">
|
||||
<span class="{{ $badgeClass }} {{ $gradeInfo['color'] }}">{{ $gradeInfo['label'] }}</span>
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-xs leading-relaxed text-gray-600">
|
||||
{{ \Illuminate\Support\Str::limit($log->text, 50) }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-xs text-gray-500">
|
||||
{{ $log->buff_desc ?? '—' }}
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-center">
|
||||
@if ($log->is_free)
|
||||
<span class="{{ $badgeClass }} border-emerald-200 bg-emerald-100 text-emerald-700">免费</span>
|
||||
@else
|
||||
<span class="{{ $badgeClass }} border-amber-200 bg-amber-100 text-amber-700">付费</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="{{ $tableCellClass }} text-right {{ $adminListNumericTextClass }} {{ $log->cost > 0 ? 'text-red-500' : 'text-gray-400' }}">
|
||||
{{ $log->cost > 0 ? '-' . number_format($log->cost) : '0' }}
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="{{ $adminListEmptyClass }}">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@if ($logs->hasPages())
|
||||
<div class="px-4 py-3 border-t border-gray-100">
|
||||
<div class="{{ $adminListPaginationClass }}">
|
||||
{{ $logs->links() }}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
Reference in New Issue
Block a user