Files
chatroom/resources/views/admin/marriages/index.blade.php
lkddi d2797d5b59 功能:婚姻系统第9步(后台管理页面)
Admin/MarriageManagerController:
- index() 总览统计卡片
- list() 婚姻列表(筛选/强制离婚/取消求婚)
- proposals() 求婚记录
- ceremonies() 婚礼红包记录
- claimDetail() 红包领取明细
- intimacyLogs() 亲密度日志(来源筛选)
- configs/updateConfigs 参数配置(批量保存)
- tiers/updateTier 婚礼档位管理

Views(7个页面):admin/marriages/{index|list|configs|tiers|ceremonies|claim-detail|proposals|intimacy-logs}
侧边栏:superlevel 区块新增「💒 婚姻管理」入口
2026-03-01 15:15:03 +08:00

146 lines
7.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
{{--
文件功能:后台婚姻管理总览页
统计卡片 + 最近结婚记录 + 最近离婚记录
@author ChatRoom Laravel
@version 1.0.0
--}}
@extends('admin.layouts.app')
@section('title', '婚姻管理 - 总览')
@section('content')
{{-- 页面标题 --}}
<div class="flex items-center justify-between mb-6">
<div>
<h2 class="text-xl font-bold text-gray-800">💒 婚姻管理</h2>
<p class="text-sm text-gray-500 mt-1">婚姻系统总览,管理求婚、结婚、婚礼及参数配置</p>
</div>
<div class="flex gap-2">
<a href="{{ route('admin.marriages.configs') }}"
class="bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-indigo-700 transition">
⚙️ 参数配置
</a>
<a href="{{ route('admin.marriages.tiers') }}"
class="bg-pink-600 text-white px-4 py-2 rounded-lg text-sm font-bold hover:bg-pink-700 transition">
🎊 婚礼档位
</a>
</div>
</div>
{{-- 统计卡片 --}}
<div class="grid grid-cols-2 md:grid-cols-3 xl:grid-cols-6 gap-4 mb-8">
<div class="bg-white rounded-xl shadow-sm border p-4 text-center">
<div class="text-2xl mb-1">💑</div>
<div class="text-2xl font-bold text-indigo-600">{{ $stats['total_married'] }}</div>
<div class="text-xs text-gray-500 mt-1">当前已婚</div>
</div>
<div class="bg-white rounded-xl shadow-sm border p-4 text-center">
<div class="text-2xl mb-1">💍</div>
<div class="text-2xl font-bold text-amber-500">{{ $stats['total_pending'] }}</div>
<div class="text-xs text-gray-500 mt-1">求婚中</div>
</div>
<div class="bg-white rounded-xl shadow-sm border p-4 text-center">
<div class="text-2xl mb-1">💔</div>
<div class="text-2xl font-bold text-red-500">{{ $stats['total_divorced'] }}</div>
<div class="text-xs text-gray-500 mt-1">已离婚</div>
</div>
<div class="bg-white rounded-xl shadow-sm border p-4 text-center">
<div class="text-2xl mb-1">🎊</div>
<div class="text-2xl font-bold text-pink-500">{{ $stats['total_weddings'] }}</div>
<div class="text-xs text-gray-500 mt-1">婚礼场次</div>
</div>
<div class="bg-white rounded-xl shadow-sm border p-4 text-center">
<div class="text-2xl mb-1">🎁</div>
<div class="text-2xl font-bold text-green-600">{{ number_format($stats['total_envelopes']) }}</div>
<div class="text-xs text-gray-500 mt-1">红包总额()</div>
</div>
<div class="bg-white rounded-xl shadow-sm border p-4 text-center">
<div class="text-2xl mb-1"></div>
<div class="text-2xl font-bold text-emerald-600">{{ number_format($stats['claimed_amount']) }}</div>
<div class="text-xs text-gray-500 mt-1">已领取()</div>
</div>
</div>
{{-- 快捷入口 --}}
<div class="grid grid-cols-2 md:grid-cols-4 gap-3 mb-8">
@foreach ([['route' => 'admin.marriages.list', 'icon' => '📋', 'label' => '婚姻列表', 'color' => 'blue'], ['route' => 'admin.marriages.proposals', 'icon' => '💌', 'label' => '求婚记录', 'color' => 'amber'], ['route' => 'admin.marriages.ceremonies', 'icon' => '🎊', 'label' => '婚礼红包', 'color' => 'pink'], ['route' => 'admin.marriages.intimacy-logs', 'icon' => '💞', 'label' => '亲密度日志', 'color' => 'purple']] as $item)
<a href="{{ route($item['route']) }}"
class="bg-white rounded-xl border shadow-sm p-5 flex flex-col items-center gap-2 hover:shadow-md hover:border-{{ $item['color'] }}-300 transition group">
<span class="text-3xl">{{ $item['icon'] }}</span>
<span
class="text-sm font-bold text-gray-700 group-hover:text-{{ $item['color'] }}-600">{{ $item['label'] }}</span>
</a>
@endforeach
</div>
{{-- 最近已婚 --}}
<div class="grid grid-cols-1 xl:grid-cols-2 gap-6">
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
<div class="px-5 py-4 flex justify-between items-center border-b bg-gray-50">
<h3 class="font-bold text-gray-700">💑 最近结婚</h3>
<a href="{{ route('admin.marriages.list') }}" class="text-xs text-indigo-600 hover:underline">查看全部</a>
</div>
<div class="divide-y">
@forelse ($recentMarriages as $m)
<div class="px-5 py-3 flex items-center justify-between text-sm">
<div class="flex items-center gap-2">
<span class="text-lg">{{ $m->ringItem?->icon ?? '💍' }}</span>
<div>
<span class="font-bold">{{ $m->user?->username }}</span>
<span class="text-gray-400 mx-1">×</span>
<span class="font-bold">{{ $m->partner?->username }}</span>
</div>
</div>
<div class="text-right">
<div class="text-gray-500">{{ $m->married_at?->format('m/d') }}</div>
<div class="text-xs text-indigo-500">
{{ \App\Services\MarriageIntimacyService::levelName($m->level) }}</div>
</div>
</div>
@empty
<div class="px-5 py-8 text-center text-gray-400">暂无已婚记录</div>
@endforelse
</div>
</div>
{{-- 最近离婚 --}}
<div class="bg-white rounded-xl shadow-sm border overflow-hidden">
<div class="px-5 py-4 flex justify-between items-center border-b bg-gray-50">
<h3 class="font-bold text-gray-700">💔 最近离婚</h3>
<a href="{{ route('admin.marriages.list', ['status' => 'divorced']) }}"
class="text-xs text-red-600 hover:underline">查看全部</a>
</div>
<div class="divide-y">
@forelse ($recentDivorces as $m)
<div class="px-5 py-3 flex items-center justify-between text-sm">
<div>
<span class="font-bold">{{ $m->user?->username }}</span>
<span class="text-gray-400 mx-1">×</span>
<span class="font-bold">{{ $m->partner?->username }}</span>
</div>
<div class="text-right">
<span
class="text-xs px-2 py-0.5 rounded-full font-bold
{{ match ($m->divorce_type) {
'forced' => 'bg-red-100 text-red-600',
'auto' => 'bg-orange-100 text-orange-600',
'admin' => 'bg-purple-100 text-purple-600',
default => 'bg-gray-100 text-gray-600',
} }}">
{{ match ($m->divorce_type) {'forced' => '强制','auto' => '超时','admin' => '管理员',default => '协议'} }}
</span>
<div class="text-xs text-gray-400 mt-0.5">{{ $m->divorced_at?->format('m/d') }}</div>
</div>
</div>
@empty
<div class="px-5 py-8 text-center text-gray-400">暂无离婚记录</div>
@endforelse
</div>
</div>
</div>
@endsection