统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
@section('title', '签到奖励管理')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
@php
|
||||
$signInRulePayload = $rules->mapWithKeys(
|
||||
fn($rule) => [
|
||||
@@ -27,60 +29,63 @@
|
||||
|
||||
<script type="application/json" id="admin-sign-in-rules-data">@json($signInRulePayload)</script>
|
||||
|
||||
<div class="space-y-6">
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 p-6 flex justify-between items-center">
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<div class="flex items-center justify-between gap-4">
|
||||
<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>
|
||||
</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">
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListTableWrapClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead class="{{ $adminListTableHeadRowClass }}">
|
||||
<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-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-right text-xs font-bold text-gray-500 uppercase">操作</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 }}">身份</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">有效期</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">状态</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-50">
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($rules as $rule)
|
||||
<tr id="rule-row-{{ $rule->id }}" class="{{ $rule->is_enabled ? '' : 'opacity-50' }}">
|
||||
<td class="px-4 py-3 font-bold text-gray-800">第 {{ $rule->streak_days }} 天</td>
|
||||
<td class="px-4 py-3 text-center text-amber-600 font-mono">+{{ $rule->gold_reward }}</td>
|
||||
<td class="px-4 py-3 text-center text-emerald-600 font-mono">+{{ $rule->exp_reward }}</td>
|
||||
<td class="px-4 py-3 text-center text-pink-600 font-mono">+{{ $rule->charm_reward }}</td>
|
||||
<tr id="rule-row-{{ $rule->id }}" class="{{ $adminListTableRowClass }} {{ $rule->is_enabled ? '' : 'opacity-50' }}">
|
||||
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">第 {{ $rule->streak_days }} 天</td>
|
||||
<td class="px-4 py-3 text-center text-amber-600 {{ $adminListNumericTextClass }}">+{{ $rule->gold_reward }}</td>
|
||||
<td class="px-4 py-3 text-center text-emerald-600 {{ $adminListNumericTextClass }}">+{{ $rule->exp_reward }}</td>
|
||||
<td class="px-4 py-3 text-center text-pink-600 {{ $adminListNumericTextClass }}">+{{ $rule->charm_reward }}</td>
|
||||
<td class="px-4 py-3">
|
||||
@if ($rule->identity_badge_name)
|
||||
<span class="inline-flex items-center gap-1 rounded-full border px-2 py-1 text-xs font-bold"
|
||||
<span class="{{ $adminListBadgeBaseClass }} px-2 py-1"
|
||||
style="color: {{ $rule->identity_badge_color ?: '#0f766e' }}; border-color: #99f6e4; background: #f0fdfa;">
|
||||
<span>{{ $rule->identity_badge_icon ?: '✅' }}</span>
|
||||
<span>{{ $rule->identity_badge_name }}</span>
|
||||
</span>
|
||||
<div class="mt-1 text-[11px] text-gray-400">{{ $rule->identity_badge_code }}</div>
|
||||
<div class="mt-1 {{ $adminListSecondaryTextClass }}">{{ $rule->identity_badge_code }}</div>
|
||||
@else
|
||||
<span class="text-xs text-gray-400">未配置身份</span>
|
||||
<span class="{{ $adminListSecondaryTextClass }}">未配置身份</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-xs text-gray-600">
|
||||
<td class="px-4 py-3 text-center {{ $adminListBodyTextClass }}">
|
||||
{{ $rule->identity_duration_days > 0 ? $rule->identity_duration_days . ' 天' : '永久' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<button type="button" data-sign-in-rule-toggle-url="{{ route('admin.sign-in-rules.toggle', $rule) }}"
|
||||
id="toggle-rule-{{ $rule->id }}"
|
||||
class="px-2 py-1 rounded-full text-xs font-bold transition {{ $rule->is_enabled ? 'bg-emerald-100 text-emerald-700 hover:bg-emerald-200' : 'bg-gray-100 text-gray-500 hover:bg-gray-200' }}">
|
||||
class="{{ $adminListBadgeBaseClass }} px-2 py-1 transition {{ $rule->is_enabled ? 'border-emerald-200 bg-emerald-100 text-emerald-700 hover:bg-emerald-200' : 'border-gray-200 bg-gray-100 text-gray-500 hover:bg-gray-200' }}">
|
||||
{{ $rule->is_enabled ? '启用' : '停用' }}
|
||||
</button>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-right">
|
||||
<button type="button" data-sign-in-rule-edit-id="{{ $rule->id }}"
|
||||
class="px-3 py-1 bg-indigo-50 text-indigo-700 rounded text-xs font-bold hover:bg-indigo-100 transition mr-1">
|
||||
class="{{ $adminListActionButtonClass }} bg-indigo-50 text-indigo-700 hover:bg-indigo-100 mr-1">
|
||||
编辑
|
||||
</button>
|
||||
<form action="{{ route('admin.sign-in-rules.destroy', $rule) }}" method="POST"
|
||||
@@ -88,7 +93,7 @@
|
||||
@csrf
|
||||
@method('DELETE')
|
||||
<button type="submit"
|
||||
class="px-3 py-1 bg-red-50 text-red-600 rounded text-xs font-bold hover:bg-red-100 transition">
|
||||
class="{{ $adminListActionButtonClass }} bg-red-50 text-red-600 hover:bg-red-100">
|
||||
删除
|
||||
</button>
|
||||
</form>
|
||||
@@ -96,23 +101,23 @@
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="px-4 py-8 text-center text-sm text-gray-400">暂无签到奖励规则。</td>
|
||||
<td colspan="8" class="{{ $adminListEmptyClass }}">暂无签到奖励规则。</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border border-gray-100 overflow-hidden">
|
||||
<div class="p-5 border-b border-gray-100 bg-gray-50">
|
||||
<h3 class="font-bold text-gray-700 text-sm">➕ 新增签到档位</h3>
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<h3 class="{{ $adminListSectionTitleClass }}">➕ 新增签到档位</h3>
|
||||
</div>
|
||||
<form action="{{ route('admin.sign-in-rules.store') }}" method="POST" class="p-5">
|
||||
@csrf
|
||||
@include('admin.sign-in-rules.partials.form-fields', ['rule' => null])
|
||||
<div class="mt-4 flex items-center gap-4">
|
||||
<button type="submit"
|
||||
class="px-5 py-2 bg-indigo-600 text-white rounded-lg font-bold hover:bg-indigo-700 transition text-sm shadow-sm">
|
||||
<button type="submit" class="{{ $adminListPrimaryButtonClass }}">
|
||||
💾 添加规则
|
||||
</button>
|
||||
<label class="flex items-center gap-2 text-sm text-gray-600 cursor-pointer">
|
||||
@@ -124,9 +129,9 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="edit-rule-modal" class="hidden fixed inset-0 bg-black/40 z-50 flex items-center justify-center p-4">
|
||||
<div class="bg-white rounded-xl w-full max-w-3xl shadow-2xl">
|
||||
<div class="p-5 border-b border-gray-100 flex justify-between items-center">
|
||||
<div id="edit-rule-modal" class="hidden fixed inset-0 bg-black/40 z-50 flex items-center justify-center p-4">
|
||||
<div class="bg-white rounded-xl w-full max-w-3xl shadow-2xl">
|
||||
<div class="p-5 border-b border-gray-100 flex justify-between items-center">
|
||||
<h3 class="font-bold text-gray-800">✏️ 编辑签到规则</h3>
|
||||
<button type="button" data-sign-in-rule-close class="text-gray-400 hover:text-gray-600 text-xl">✕</button>
|
||||
</div>
|
||||
@@ -135,8 +140,7 @@
|
||||
@method('PUT')
|
||||
@include('admin.sign-in-rules.partials.form-fields', ['rule' => null, 'prefix' => 'edit-'])
|
||||
<div class="mt-5 flex items-center gap-4">
|
||||
<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 type="submit" class="{{ $adminListPrimaryButtonClass }}">
|
||||
💾 保存修改
|
||||
</button>
|
||||
<label class="flex items-center gap-2 text-sm text-gray-600 cursor-pointer">
|
||||
@@ -144,7 +148,7 @@
|
||||
启用此规则
|
||||
</label>
|
||||
<button type="button" data-sign-in-rule-close
|
||||
class="px-4 py-2 bg-gray-100 text-gray-700 rounded-lg font-bold hover:bg-gray-200 transition text-sm">
|
||||
class="{{ $adminListSecondaryButtonClass }}">
|
||||
取消
|
||||
</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user