统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -10,95 +10,108 @@
|
||||
@section('title', '婚礼红包记录')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
<div class="flex items-center justify-between mb-5">
|
||||
<h2 class="text-xl font-bold text-gray-800">🎊 婚礼红包记录</h2>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="text-sm text-indigo-600 hover:underline">← 返回总览</a>
|
||||
</div>
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">🎊 婚礼红包记录</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">统一查看婚礼红包发放进度与领取详情。</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="{{ $adminListSecondaryButtonClass }}">返回总览</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-gray-600 text-xs uppercase">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left">ID</th>
|
||||
<th class="px-4 py-3 text-left">新人</th>
|
||||
<th class="px-4 py-3 text-left">档位</th>
|
||||
<th class="px-4 py-3 text-center">总金额</th>
|
||||
<th class="px-4 py-3 text-center">在线人数</th>
|
||||
<th class="px-4 py-3 text-center">领取进度</th>
|
||||
<th class="px-4 py-3 text-center">状态</th>
|
||||
<th class="px-4 py-3 text-left">时间</th>
|
||||
<th class="px-4 py-3 text-center">详情</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y">
|
||||
@forelse ($ceremonies as $c)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-4 py-3 text-gray-400 font-mono text-xs">{{ $c->id }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="font-bold">{{ $c->marriage?->user?->username }}</span>
|
||||
<span class="text-gray-400 mx-1">×</span>
|
||||
<span class="font-bold">{{ $c->marriage?->partner?->username }}</span>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
{{ $c->tier?->icon }} {{ $c->tier?->name ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-bold text-amber-600">
|
||||
{{ number_format($c->total_amount) }} 金
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-gray-600">
|
||||
{{ $c->online_count ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($c->total_amount > 0)
|
||||
<div class="text-xs text-gray-600">
|
||||
{{ $c->claimed_count }} / {{ $c->online_count ?? '?' }} 人
|
||||
</div>
|
||||
<div class="text-xs text-emerald-600 font-bold">
|
||||
{{ number_format($c->claimed_amount) }} / {{ number_format($c->total_amount) }}
|
||||
</div>
|
||||
@else
|
||||
<span class="text-gray-300 text-xs">无红包</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold
|
||||
{{ match ($c->status) {
|
||||
'completed' => 'bg-green-100 text-green-700',
|
||||
'active' => 'bg-blue-100 text-blue-700',
|
||||
'pending' => 'bg-amber-100 text-amber-700',
|
||||
'expired' => 'bg-gray-100 text-gray-500',
|
||||
'cancelled' => 'bg-red-100 text-red-600',
|
||||
default => 'bg-gray-100 text-gray-600',
|
||||
} }}">
|
||||
{{ ['completed' => '已完成', 'active' => '进行中', 'pending' => '待触发', 'expired' => '已过期', 'cancelled' => '已取消'][$c->status] ?? $c->status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500">
|
||||
{{ $c->ceremony_at?->format('Y-m-d H:i') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div>
|
||||
<h3 class="{{ $adminListSectionTitleClass }}">婚礼红包列表</h3>
|
||||
<p class="{{ $adminListSectionDescClass }}">保留婚礼状态色彩与金额语义,其他布局统一到后台列表样式。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ $adminListTableWrapClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead>
|
||||
<tr class="{{ $adminListTableHeadRowClass }}">
|
||||
<th class="{{ $adminListTableHeadCellClass }}">ID</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">新人</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-center">状态</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">时间</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">详情</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($ceremonies as $c)
|
||||
<tr class="{{ $adminListTableRowClass }}">
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }} {{ $adminListNumericTextClass }}">{{ $c->id }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="{{ $adminListPrimaryTextClass }}">{{ $c->marriage?->user?->username }}</span>
|
||||
<span class="mx-1 text-gray-400">×</span>
|
||||
<span class="{{ $adminListPrimaryTextClass }}">{{ $c->marriage?->partner?->username }}</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListBodyTextClass }}">
|
||||
{{ $c->tier?->icon }} {{ $c->tier?->name ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-semibold text-amber-600">
|
||||
{{ number_format($c->total_amount) }} 金
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center {{ $adminListBodyTextClass }}">
|
||||
{{ $c->online_count ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($c->total_amount > 0)
|
||||
<div class="text-xs text-gray-600">
|
||||
{{ $c->claimed_count }} / {{ $c->online_count ?? '?' }} 人
|
||||
</div>
|
||||
<div class="text-xs font-semibold text-emerald-600">
|
||||
{{ number_format($c->claimed_amount) }} / {{ number_format($c->total_amount) }}
|
||||
</div>
|
||||
@else
|
||||
<span class="text-gray-300 text-xs">无红包</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="{{ $adminListBadgeBaseClass }} {{ match ($c->status) {
|
||||
'completed' => 'border-green-200 bg-green-100 text-green-700',
|
||||
'active' => 'border-blue-200 bg-blue-100 text-blue-700',
|
||||
'pending' => 'border-amber-200 bg-amber-100 text-amber-700',
|
||||
'expired' => 'border-gray-200 bg-gray-100 text-gray-500',
|
||||
'cancelled' => 'border-red-200 bg-red-100 text-red-600',
|
||||
default => 'border-gray-200 bg-gray-100 text-gray-600',
|
||||
} }}">
|
||||
{{ ['completed' => '已完成', 'active' => '进行中', 'pending' => '待触发', 'expired' => '已过期', 'cancelled' => '已取消'][$c->status] ?? $c->status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">
|
||||
{{ $c->ceremony_at?->format('Y-m-d H:i') }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($c->total_amount > 0)
|
||||
<a href="{{ route('admin.marriages.claim-detail', $c->id) }}"
|
||||
class="text-xs text-indigo-600 hover:underline font-bold">明细</a>
|
||||
class="{{ $adminListActionButtonClass }} bg-indigo-50 text-indigo-600 hover:bg-indigo-600 hover:text-white">明细</a>
|
||||
@else
|
||||
<span class="text-gray-300 text-xs">—</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="9" class="px-4 py-12 text-center text-gray-400">暂无婚礼记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="9" class="{{ $adminListEmptyClass }}">暂无婚礼记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ($ceremonies->hasPages())
|
||||
<div class="{{ $adminListPaginationClass }}">{{ $ceremonies->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($ceremonies->hasPages())
|
||||
<div class="px-4 py-4 border-t">{{ $ceremonies->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -10,76 +10,85 @@
|
||||
@section('title', '婚礼红包明细')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
<div class="flex items-center justify-between mb-5">
|
||||
<div>
|
||||
<h2 class="text-xl font-bold text-gray-800">🎁 红包领取明细</h2>
|
||||
<p class="text-sm text-gray-500 mt-1">
|
||||
{{ $ceremony->marriage?->user?->username }} × {{ $ceremony->marriage?->partner?->username }}
|
||||
— {{ $ceremony->tier?->icon }} {{ $ceremony->tier?->name ?? '婚礼' }}
|
||||
· 总额 <strong class="text-amber-600">{{ number_format($ceremony->total_amount) }} 金</strong>
|
||||
</p>
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">🎁 红包领取明细</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">
|
||||
{{ $ceremony->marriage?->user?->username }} × {{ $ceremony->marriage?->partner?->username }}
|
||||
— {{ $ceremony->tier?->icon }} {{ $ceremony->tier?->name ?? '婚礼' }}
|
||||
· 总额 <strong class="text-amber-600">{{ number_format($ceremony->total_amount) }} 金</strong>
|
||||
</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.marriages.ceremonies') }}" class="{{ $adminListSecondaryButtonClass }}">返回婚礼列表</a>
|
||||
</div>
|
||||
</div>
|
||||
<a href="{{ route('admin.marriages.ceremonies') }}" class="text-sm text-indigo-600 hover:underline">← 返回婚礼列表</a>
|
||||
</div>
|
||||
|
||||
{{-- 汇总 --}}
|
||||
<div class="grid grid-cols-3 gap-4 mb-5">
|
||||
<div class="bg-white rounded-xl border shadow-sm p-4 text-center">
|
||||
<div class="text-2xl font-bold text-indigo-600">{{ $ceremony->online_count ?? 0 }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">在线人数</div>
|
||||
<div class="grid grid-cols-1 gap-4 md:grid-cols-3">
|
||||
<div class="{{ $adminListCardClass }} p-4 text-center">
|
||||
<div class="text-2xl font-bold text-indigo-600">{{ $ceremony->online_count ?? 0 }}</div>
|
||||
<div class="mt-1 text-xs text-gray-500">在线人数</div>
|
||||
</div>
|
||||
<div class="{{ $adminListCardClass }} p-4 text-center">
|
||||
<div class="text-2xl font-bold text-green-600">{{ $ceremony->claimed_count }}</div>
|
||||
<div class="mt-1 text-xs text-gray-500">已领取人数</div>
|
||||
</div>
|
||||
<div class="{{ $adminListCardClass }} p-4 text-center">
|
||||
<div class="text-2xl font-bold text-amber-600">{{ number_format($ceremony->claimed_amount) }}</div>
|
||||
<div class="mt-1 text-xs text-gray-500">已领取金额</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border shadow-sm p-4 text-center">
|
||||
<div class="text-2xl font-bold text-green-600">{{ $ceremony->claimed_count }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">已领取人数</div>
|
||||
</div>
|
||||
<div class="bg-white rounded-xl border shadow-sm p-4 text-center">
|
||||
<div class="text-2xl font-bold text-amber-600">{{ number_format($ceremony->claimed_amount) }}</div>
|
||||
<div class="text-xs text-gray-500 mt-1">已领取金额</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-xs uppercase text-gray-600">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left">用户</th>
|
||||
<th class="px-4 py-3 text-center">分配金额</th>
|
||||
<th class="px-4 py-3 text-center">状态</th>
|
||||
<th class="px-4 py-3 text-left">领取时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y">
|
||||
@forelse ($claims as $claim)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-4 py-3 font-bold">{{ $claim->user?->username }}</td>
|
||||
<td class="px-4 py-3 text-center font-bold text-amber-600">
|
||||
{{ number_format($claim->amount) }} 金
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($claim->claimed)
|
||||
<span class="px-2 py-0.5 rounded-full text-xs bg-green-100 text-green-700 font-bold">✅
|
||||
已领取</span>
|
||||
@else
|
||||
<span class="px-2 py-0.5 rounded-full text-xs bg-gray-100 text-gray-500">未领取</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500">
|
||||
{{ $claim->claimed_at?->format('H:i:s') ?? '—' }}
|
||||
</td>
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div>
|
||||
<h3 class="{{ $adminListSectionTitleClass }}">领取明细</h3>
|
||||
<p class="{{ $adminListSectionDescClass }}">明细表头、正文、状态徽章与分页统一到后台列表页样式。</p>
|
||||
</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 }}">领取时间</th>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4" class="px-4 py-12 text-center text-gray-400">暂无领取记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($claims as $claim)
|
||||
<tr class="{{ $adminListTableRowClass }}">
|
||||
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">{{ $claim->user?->username }}</td>
|
||||
<td class="px-4 py-3 text-center font-semibold text-amber-600">
|
||||
{{ number_format($claim->amount) }} 金
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($claim->claimed)
|
||||
<span class="{{ $adminListBadgeBaseClass }} border-green-200 bg-green-100 text-green-700">✅ 已领取</span>
|
||||
@else
|
||||
<span class="{{ $adminListBadgeBaseClass }} border-gray-200 bg-gray-100 text-gray-500">未领取</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">
|
||||
{{ $claim->claimed_at?->format('H:i:s') ?? '—' }}
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="4" class="{{ $adminListEmptyClass }}">暂无领取记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ($claims->hasPages())
|
||||
<div class="{{ $adminListPaginationClass }}">{{ $claims->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($claims->hasPages())
|
||||
<div class="px-4 py-4 border-t">{{ $claims->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -10,88 +10,101 @@
|
||||
@section('title', '亲密度日志')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
<div class="flex items-center justify-between mb-5">
|
||||
<h2 class="text-xl font-bold text-gray-800">💞 亲密度变更日志</h2>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="text-sm text-indigo-600 hover:underline">← 返回总览</a>
|
||||
</div>
|
||||
|
||||
{{-- 筛选 --}}
|
||||
<form method="GET" class="bg-white rounded-xl border shadow-sm p-4 mb-5 flex flex-wrap gap-3 items-end">
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">搜索用户名</label>
|
||||
<input type="text" name="search" value="{{ request('search') }}" placeholder="双方任一用户名..."
|
||||
class="border rounded-lg px-3 py-2 text-sm w-44 focus:outline-none">
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">💞 亲密度变更日志</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">按统一后台列表样式审计婚姻亲密度的增减来源与余额变化。</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="{{ $adminListSecondaryButtonClass }}">返回总览</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">来源(Source)</label>
|
||||
<select name="source" class="border rounded-lg px-3 py-2 text-sm focus:outline-none">
|
||||
<option value="">全部</option>
|
||||
@foreach (\App\Enums\IntimacySource::cases() as $src)
|
||||
<option value="{{ $src->value }}" @selected(request('source') === $src->value)>
|
||||
{{ $src->label() }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit"
|
||||
class="bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-indigo-700 transition">
|
||||
筛选
|
||||
</button>
|
||||
<a href="{{ route('admin.marriages.intimacy-logs') }}" class="text-sm text-gray-500 hover:underline py-2">重置</a>
|
||||
</form>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-xs uppercase text-gray-600">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left">ID</th>
|
||||
<th class="px-4 py-3 text-left">婚姻双方</th>
|
||||
<th class="px-4 py-3 text-center">变动量</th>
|
||||
<th class="px-4 py-3 text-center">变后余额</th>
|
||||
<th class="px-4 py-3 text-left">来源</th>
|
||||
<th class="px-4 py-3 text-left">备注</th>
|
||||
<th class="px-4 py-3 text-left">时间</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y">
|
||||
@forelse ($logs as $log)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-4 py-3 text-gray-400 font-mono text-xs">{{ $log->id }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="font-bold">{{ $log->marriage?->user?->username }}</span>
|
||||
<span class="text-gray-400 mx-1">×</span>
|
||||
<span class="font-bold">{{ $log->marriage?->partner?->username }}</span>
|
||||
</td>
|
||||
<td
|
||||
class="px-4 py-3 text-center font-bold {{ $log->amount >= 0 ? 'text-green-600' : 'text-red-500' }}">
|
||||
{{ $log->amount >= 0 ? '+' : '' }}{{ $log->amount }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-indigo-600 font-bold">
|
||||
{{ number_format($log->balance_after) }}
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="text-xs bg-purple-50 text-purple-700 px-2 py-0.5 rounded-full font-mono">
|
||||
{{ \App\Enums\IntimacySource::tryFrom($log->source)?->label() ?? $log->source }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500">{{ $log->remark ?? '—' }}</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-400">
|
||||
{{ $log->created_at?->format('m-d H:i') }}
|
||||
</td>
|
||||
<div class="{{ $adminListFilterCardClass }}">
|
||||
<div class="{{ $adminListFilterInnerClass }}">
|
||||
<form method="GET" class="{{ $adminListFilterFormClass }}">
|
||||
<div>
|
||||
<label class="{{ $adminListFilterLabelClass }}">搜索用户名</label>
|
||||
<input type="text" name="search" value="{{ request('search') }}" placeholder="双方任一用户名..."
|
||||
class="w-44 {{ $adminListFilterInputClass }}">
|
||||
</div>
|
||||
<div>
|
||||
<label class="{{ $adminListFilterLabelClass }}">来源(Source)</label>
|
||||
<select name="source" class="{{ $adminListFilterInputClass }}">
|
||||
<option value="">全部</option>
|
||||
@foreach (\App\Enums\IntimacySource::cases() as $src)
|
||||
<option value="{{ $src->value }}" @selected(request('source') === $src->value)>
|
||||
{{ $src->label() }}
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<button type="submit" class="{{ $adminListPrimaryButtonClass }}">筛选</button>
|
||||
<a href="{{ route('admin.marriages.intimacy-logs') }}" class="{{ $adminListSecondaryButtonClass }}">重置</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div>
|
||||
<h3 class="{{ $adminListSectionTitleClass }}">亲密度日志</h3>
|
||||
<p class="{{ $adminListSectionDescClass }}">保留增减与来源的颜色语义,其他样式对齐统一列表页。</p>
|
||||
</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 }}">来源</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">备注</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">时间</th>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-12 text-center text-gray-400">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($logs as $log)
|
||||
<tr class="{{ $adminListTableRowClass }}">
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }} {{ $adminListNumericTextClass }}">{{ $log->id }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="{{ $adminListPrimaryTextClass }}">{{ $log->marriage?->user?->username }}</span>
|
||||
<span class="mx-1 text-gray-400">×</span>
|
||||
<span class="{{ $adminListPrimaryTextClass }}">{{ $log->marriage?->partner?->username }}</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-semibold {{ $log->amount >= 0 ? 'text-green-600' : 'text-red-500' }}">
|
||||
{{ $log->amount >= 0 ? '+' : '' }}{{ $log->amount }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center font-semibold text-indigo-600">
|
||||
{{ number_format($log->balance_after) }}
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
<span class="{{ $adminListBadgeBaseClass }} border-purple-200 bg-purple-50 text-purple-700">
|
||||
{{ \App\Enums\IntimacySource::tryFrom($log->source)?->label() ?? $log->source }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">{{ $log->remark ?? '—' }}</td>
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">
|
||||
{{ $log->created_at?->format('m-d H:i') }}
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="{{ $adminListEmptyClass }}">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ($logs->hasPages())
|
||||
<div class="{{ $adminListPaginationClass }}">{{ $logs->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($logs->hasPages())
|
||||
<div class="px-4 py-4 border-t">{{ $logs->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -10,99 +10,110 @@
|
||||
@section('title', '婚姻列表')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
<div class="flex items-center justify-between mb-5">
|
||||
<h2 class="text-xl font-bold text-gray-800">📋 婚姻列表</h2>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="text-sm text-indigo-600 hover:underline">← 返回总览</a>
|
||||
</div>
|
||||
|
||||
{{-- 筛选栏 --}}
|
||||
<form method="GET" class="bg-white rounded-xl border shadow-sm p-4 mb-5 flex flex-wrap gap-3 items-end">
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">状态</label>
|
||||
<select name="status" class="border rounded-lg px-3 py-2 text-sm focus:outline-none">
|
||||
<option value="">全部</option>
|
||||
@foreach (['married' => '已婚', 'pending' => '求婚中', 'divorced' => '已离婚', 'rejected' => '被拒', 'expired' => '已过期'] as $val => $label)
|
||||
<option value="{{ $val }}" @selected(request('status') === $val)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">📋 婚姻列表</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">统一查看婚姻状态、亲密度与后台管理操作。</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="{{ $adminListSecondaryButtonClass }}">返回总览</a>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<label class="block text-xs font-bold text-gray-600 mb-1">搜索用户名</label>
|
||||
<input type="text" name="search" value="{{ request('search') }}" placeholder="双方任一用户名..."
|
||||
class="border rounded-lg px-3 py-2 text-sm w-48 focus:outline-none">
|
||||
</div>
|
||||
<button type="submit"
|
||||
class="bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-indigo-700 transition">
|
||||
筛选
|
||||
</button>
|
||||
<a href="{{ route('admin.marriages.list') }}" class="text-sm text-gray-500 hover:underline py-2">重置</a>
|
||||
</form>
|
||||
|
||||
{{-- 婚姻列表 --}}
|
||||
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-gray-600 text-xs uppercase">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left">ID</th>
|
||||
<th class="px-4 py-3 text-left">双方</th>
|
||||
<th class="px-4 py-3 text-left">戒指</th>
|
||||
<th class="px-4 py-3 text-center">状态</th>
|
||||
<th class="px-4 py-3 text-center">亲密度/等级</th>
|
||||
<th class="px-4 py-3 text-center">结婚天数</th>
|
||||
<th class="px-4 py-3 text-left">时间</th>
|
||||
<th class="px-4 py-3 text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y">
|
||||
@forelse ($marriages as $m)
|
||||
<tr class="hover:bg-gray-50 transition">
|
||||
<td class="px-4 py-3 text-gray-400 font-mono text-xs">{{ $m->id }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<div class="font-bold">{{ $m->user?->username }}</div>
|
||||
<div class="text-gray-400 text-xs">× {{ $m->partner?->username }}</div>
|
||||
</td>
|
||||
<td class="px-4 py-3">
|
||||
{{ $m->ringItem?->icon }} {{ $m->ringItem?->name ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold
|
||||
{{ match ($m->status) {
|
||||
'married' => 'bg-green-100 text-green-700',
|
||||
'pending' => 'bg-amber-100 text-amber-700',
|
||||
'divorced' => 'bg-red-100 text-red-700',
|
||||
'rejected' => 'bg-gray-100 text-gray-600',
|
||||
'expired' => 'bg-slate-100 text-slate-500',
|
||||
default => 'bg-gray-100 text-gray-600',
|
||||
} }}">
|
||||
{{ ['married' => '💑 已婚', 'pending' => '💍 求婚中', 'divorced' => '💔 已离婚', 'rejected' => '❌ 被拒', 'expired' => '⏰ 已过期'][$m->status] ?? $m->status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<div class="font-bold text-indigo-600">{{ number_format($m->intimacy) }}</div>
|
||||
<div class="text-xs text-gray-400">
|
||||
{{ \App\Services\MarriageIntimacyService::levelIcon($m->level) }}
|
||||
Lv{{ $m->level }}</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center text-gray-600">
|
||||
{{ $m->married_at ? $m->married_at->diffInDays(now()) . ' 天' : '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500">
|
||||
@if ($m->married_at)
|
||||
结婚:{{ $m->married_at->format('Y-m-d') }}
|
||||
@elseif ($m->proposed_at)
|
||||
求婚:{{ $m->proposed_at->format('Y-m-d') }}
|
||||
@endif
|
||||
@if ($m->divorced_at)
|
||||
<div>离婚:{{ $m->divorced_at->format('Y-m-d') }}</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center" x-data="{ showDissolve: false }">
|
||||
<div class="{{ $adminListFilterCardClass }}">
|
||||
<div class="{{ $adminListFilterInnerClass }}">
|
||||
<form method="GET" class="{{ $adminListFilterFormClass }}">
|
||||
<div>
|
||||
<label class="{{ $adminListFilterLabelClass }}">状态</label>
|
||||
<select name="status" class="{{ $adminListFilterInputClass }}">
|
||||
<option value="">全部</option>
|
||||
@foreach (['married' => '已婚', 'pending' => '求婚中', 'divorced' => '已离婚', 'rejected' => '被拒', 'expired' => '已过期'] as $val => $label)
|
||||
<option value="{{ $val }}" @selected(request('status') === $val)>{{ $label }}</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
<div>
|
||||
<label class="{{ $adminListFilterLabelClass }}">搜索用户名</label>
|
||||
<input type="text" name="search" value="{{ request('search') }}" placeholder="双方任一用户名..."
|
||||
class="w-48 {{ $adminListFilterInputClass }}">
|
||||
</div>
|
||||
<button type="submit" class="{{ $adminListPrimaryButtonClass }}">筛选</button>
|
||||
<a href="{{ route('admin.marriages.list') }}" class="{{ $adminListSecondaryButtonClass }}">重置</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div>
|
||||
<h3 class="{{ $adminListSectionTitleClass }}">婚姻记录</h3>
|
||||
<p class="{{ $adminListSectionDescClass }}">保留婚姻状态语义色,其他列表结构按统一后台样式展示。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ $adminListTableWrapClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead>
|
||||
<tr class="{{ $adminListTableHeadRowClass }}">
|
||||
<th class="{{ $adminListTableHeadCellClass }}">ID</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">双方</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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($marriages as $m)
|
||||
<tr class="{{ $adminListTableRowClass }}">
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }} {{ $adminListNumericTextClass }}">{{ $m->id }}</td>
|
||||
<td class="px-4 py-3">
|
||||
<div class="{{ $adminListPrimaryTextClass }}">{{ $m->user?->username }}</div>
|
||||
<div class="{{ $adminListSecondaryTextClass }}">× {{ $m->partner?->username }}</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListBodyTextClass }}">
|
||||
{{ $m->ringItem?->icon }} {{ $m->ringItem?->name ?? '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="{{ $adminListBadgeBaseClass }} {{ match ($m->status) {
|
||||
'married' => 'border-green-200 bg-green-100 text-green-700',
|
||||
'pending' => 'border-amber-200 bg-amber-100 text-amber-700',
|
||||
'divorced' => 'border-red-200 bg-red-100 text-red-700',
|
||||
'rejected' => 'border-gray-200 bg-gray-100 text-gray-600',
|
||||
'expired' => 'border-slate-200 bg-slate-100 text-slate-500',
|
||||
default => 'border-gray-200 bg-gray-100 text-gray-600',
|
||||
} }}">
|
||||
{{ ['married' => '💑 已婚', 'pending' => '💍 求婚中', 'divorced' => '💔 已离婚', 'rejected' => '❌ 被拒', 'expired' => '⏰ 已过期'][$m->status] ?? $m->status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<div class="text-sm font-semibold text-indigo-600">{{ number_format($m->intimacy) }}</div>
|
||||
<div class="{{ $adminListSecondaryTextClass }}">
|
||||
{{ \App\Services\MarriageIntimacyService::levelIcon($m->level) }}
|
||||
Lv{{ $m->level }}</div>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center {{ $adminListBodyTextClass }}">
|
||||
{{ $m->married_at ? $m->married_at->diffInDays(now()) . ' 天' : '—' }}
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">
|
||||
@if ($m->married_at)
|
||||
结婚:{{ $m->married_at->format('Y-m-d') }}
|
||||
@elseif ($m->proposed_at)
|
||||
求婚:{{ $m->proposed_at->format('Y-m-d') }}
|
||||
@endif
|
||||
@if ($m->divorced_at)
|
||||
<div>离婚:{{ $m->divorced_at->format('Y-m-d') }}</div>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center" x-data="{ showDissolve: false }">
|
||||
@if ($m->status === 'married')
|
||||
<button @click="showDissolve = true"
|
||||
class="text-xs bg-red-50 text-red-600 font-bold px-3 py-1.5 rounded hover:bg-red-600 hover:text-white transition">
|
||||
class="{{ $adminListActionButtonClass }} bg-red-50 text-red-600 hover:bg-red-600 hover:text-white">
|
||||
强制离婚
|
||||
</button>
|
||||
{{-- 强制离婚确认弹窗 --}}
|
||||
@@ -123,9 +134,9 @@
|
||||
class="w-full border rounded px-3 py-2 text-sm mb-3">
|
||||
<div class="flex gap-2 justify-end">
|
||||
<button type="button" @click="showDissolve = false"
|
||||
class="px-3 py-1.5 border rounded text-sm text-gray-600">取消</button>
|
||||
class="{{ $adminListSecondaryButtonClass }}">取消</button>
|
||||
<button type="submit"
|
||||
class="px-3 py-1.5 bg-red-600 text-white rounded text-sm font-bold">确认解除</button>
|
||||
class="{{ $adminListActionButtonClass }} bg-red-600 text-white hover:bg-red-700">确认解除</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@@ -135,28 +146,28 @@
|
||||
data-admin-confirm="确定取消该求婚吗?">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="text-xs bg-amber-50 text-amber-600 font-bold px-3 py-1.5 rounded hover:bg-amber-600 hover:text-white transition">
|
||||
class="{{ $adminListActionButtonClass }} bg-amber-50 text-amber-600 hover:bg-amber-600 hover:text-white">
|
||||
取消求婚
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<span class="text-xs text-gray-300">—</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="px-4 py-12 text-center text-gray-400">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="{{ $adminListEmptyClass }}">暂无记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
{{-- 分页 --}}
|
||||
@if ($marriages->hasPages())
|
||||
<div class="px-4 py-4 border-t">{{ $marriages->links() }}</div>
|
||||
@endif
|
||||
@if ($marriages->hasPages())
|
||||
<div class="{{ $adminListPaginationClass }}">{{ $marriages->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
@@ -10,82 +10,94 @@
|
||||
@section('title', '求婚记录')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
<div class="flex items-center justify-between mb-5">
|
||||
<h2 class="text-xl font-bold text-gray-800">💌 求婚记录</h2>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="text-sm text-indigo-600 hover:underline">← 返回总览</a>
|
||||
</div>
|
||||
<div class="{{ $adminListPageClass }}">
|
||||
<div class="{{ $adminListHeaderCardClass }}">
|
||||
<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between">
|
||||
<div>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">💌 求婚记录</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">统一查看求婚进度,并保留婚姻状态语义色彩。</p>
|
||||
</div>
|
||||
<a href="{{ route('admin.marriages.index') }}" class="{{ $adminListSecondaryButtonClass }}">返回总览</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-xs uppercase text-gray-600">
|
||||
<tr>
|
||||
<th class="px-4 py-3 text-left">ID</th>
|
||||
<th class="px-4 py-3 text-left">发起方</th>
|
||||
<th class="px-4 py-3 text-left">目标</th>
|
||||
<th class="px-4 py-3 text-left">戒指</th>
|
||||
<th class="px-4 py-3 text-center">状态</th>
|
||||
<th class="px-4 py-3 text-left">求婚时间</th>
|
||||
<th class="px-4 py-3 text-left">过期时间</th>
|
||||
<th class="px-4 py-3 text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y">
|
||||
@forelse ($proposals as $p)
|
||||
<tr class="hover:bg-gray-50">
|
||||
<td class="px-4 py-3 text-gray-400 font-mono text-xs">{{ $p->id }}</td>
|
||||
<td class="px-4 py-3 font-bold">{{ $p->user?->username }}</td>
|
||||
<td class="px-4 py-3 font-bold">{{ $p->partner?->username }}</td>
|
||||
<td class="px-4 py-3">{{ $p->ringItem?->icon }} {{ $p->ringItem?->name ?? '—' }}</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="px-2 py-0.5 rounded-full text-xs font-bold
|
||||
{{ match ($p->status) {
|
||||
'pending' => 'bg-amber-100 text-amber-700',
|
||||
'rejected' => 'bg-red-100 text-red-600',
|
||||
'expired' => 'bg-gray-100 text-gray-500',
|
||||
'married' => 'bg-emerald-100 text-emerald-700',
|
||||
'divorced' => 'bg-purple-100 text-purple-700',
|
||||
default => 'bg-gray-100 text-gray-600',
|
||||
} }}">
|
||||
{{ ['pending' => '⏳ 等待中', 'rejected' => '❌ 已拒绝', 'expired' => '⏰ 已过期', 'married' => '✅ 已结婚', 'divorced' => '💔 已离婚'][$p->status] ?? $p->status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 text-xs text-gray-500">{{ $p->proposed_at?->format('Y-m-d H:i') }}</td>
|
||||
<td
|
||||
class="px-4 py-3 text-xs {{ $p->expires_at?->isPast() ? 'text-red-400' : 'text-gray-500' }}">
|
||||
{{ $p->expires_at?->format('Y-m-d H:i') }}
|
||||
@if ($p->status === 'pending' && $p->expires_at?->isPast())
|
||||
<span class="text-red-500">(已超时)</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<div class="{{ $adminListSectionHeadClass }}">
|
||||
<div>
|
||||
<h3 class="{{ $adminListSectionTitleClass }}">求婚列表</h3>
|
||||
<p class="{{ $adminListSectionDescClass }}">列表布局、表头、按钮与分页对齐后台统一风格。</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="{{ $adminListTableWrapClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead>
|
||||
<tr class="{{ $adminListTableHeadRowClass }}">
|
||||
<th class="{{ $adminListTableHeadCellClass }}">ID</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">发起方</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">目标</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">戒指</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">状态</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">求婚时间</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">过期时间</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-center">操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($proposals as $p)
|
||||
<tr class="{{ $adminListTableRowClass }}">
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }} {{ $adminListNumericTextClass }}">{{ $p->id }}</td>
|
||||
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">{{ $p->user?->username }}</td>
|
||||
<td class="px-4 py-3 {{ $adminListPrimaryTextClass }}">{{ $p->partner?->username }}</td>
|
||||
<td class="px-4 py-3 {{ $adminListBodyTextClass }}">{{ $p->ringItem?->icon }} {{ $p->ringItem?->name ?? '—' }}</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
<span
|
||||
class="{{ $adminListBadgeBaseClass }} {{ match ($p->status) {
|
||||
'pending' => 'border-amber-200 bg-amber-100 text-amber-700',
|
||||
'rejected' => 'border-red-200 bg-red-100 text-red-600',
|
||||
'expired' => 'border-gray-200 bg-gray-100 text-gray-500',
|
||||
'married' => 'border-emerald-200 bg-emerald-100 text-emerald-700',
|
||||
'divorced' => 'border-purple-200 bg-purple-100 text-purple-700',
|
||||
default => 'border-gray-200 bg-gray-100 text-gray-600',
|
||||
} }}">
|
||||
{{ ['pending' => '⏳ 等待中', 'rejected' => '❌ 已拒绝', 'expired' => '⏰ 已过期', 'married' => '✅ 已结婚', 'divorced' => '💔 已离婚'][$p->status] ?? $p->status }}
|
||||
</span>
|
||||
</td>
|
||||
<td class="px-4 py-3 {{ $adminListSecondaryTextClass }}">{{ $p->proposed_at?->format('Y-m-d H:i') }}</td>
|
||||
<td class="px-4 py-3 text-xs {{ $p->expires_at?->isPast() ? 'text-red-400' : 'text-gray-500' }}">
|
||||
{{ $p->expires_at?->format('Y-m-d H:i') }}
|
||||
@if ($p->status === 'pending' && $p->expires_at?->isPast())
|
||||
<span class="text-red-500">(已超时)</span>
|
||||
@endif
|
||||
</td>
|
||||
<td class="px-4 py-3 text-center">
|
||||
@if ($p->status === 'pending')
|
||||
<form action="{{ route('admin.marriages.cancel-proposal', $p->id) }}" method="POST"
|
||||
data-admin-confirm="确定取消该求婚吗?">
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="text-xs bg-amber-50 text-amber-600 font-bold px-3 py-1.5 rounded hover:bg-amber-600 hover:text-white transition">
|
||||
class="{{ $adminListActionButtonClass }} bg-amber-50 text-amber-600 hover:bg-amber-600 hover:text-white">
|
||||
取消求婚
|
||||
</button>
|
||||
</form>
|
||||
@else
|
||||
<span class="text-gray-300 text-xs">—</span>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="px-4 py-12 text-center text-gray-400">暂无求婚记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="8" class="{{ $adminListEmptyClass }}">暂无求婚记录</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@if ($proposals->hasPages())
|
||||
<div class="{{ $adminListPaginationClass }}">{{ $proposals->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
@if ($proposals->hasPages())
|
||||
<div class="px-4 py-4 border-t">{{ $proposals->links() }}</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endsection
|
||||
|
||||
Reference in New Issue
Block a user