{{-- 文件功能:后台商店商品管理页面(站长功能) 支持查看、新增、编辑、上下架切换、删除商品。 字段:名称、Slug、图标、描述、价格、类型、有效期、排序、状态 @author ChatRoom Laravel @version 1.0.0 --}} @extends('admin.layouts.app') @section('title', '🛒 商店商品管理') @section('content') @php $typeLabels = [ 'instant' => ['label' => '即时特效', 'color' => 'bg-blue-100 text-blue-700'], 'duration' => ['label' => '周卡/时效', 'color' => 'bg-purple-100 text-purple-700'], 'one_time' => ['label' => '一次性道具', 'color' => 'bg-yellow-100 text-yellow-700'], 'ring' => ['label' => '求婚戒指', 'color' => 'bg-rose-100 text-rose-700'], 'auto_fishing' => ['label' => '自动钓鱼卡', 'color' => 'bg-emerald-100 text-emerald-700'], ]; $isSuperAdmin = Auth::id() === 1; @endphp
{{-- 头部操作栏 --}}

商店商品列表

管理聊天室商店内所有可出售商品,支持上下架控制。

@if ($isSuperAdmin) @endif
{{-- 商品列表表格 --}}
@forelse ($items as $item) @php $tl = $typeLabels[$item->type] ?? ['label' => $item->type, 'color' => 'bg-gray-100 text-gray-600']; @endphp {{-- 商品信息 --}} {{-- 类型 --}} {{-- 价格 --}} {{-- 有效期 --}} {{-- 排序 --}} {{-- 状态 --}} {{-- 操作 --}} @empty @endforelse
商品 类型 价格 有效期 排序 状态 操作
{{ $item->icon }}

{{ $item->name }}

{{ $item->slug }}

@if ($item->description)

{{ $item->description }}

@endif
{{ $tl['label'] }} {{ number_format($item->price) }} 金 @if ($item->duration_minutes > 0) {{ $item->duration_minutes >= 60 ? floor($item->duration_minutes / 60) . '小时' : $item->duration_minutes . '分钟' }} @elseif ($item->duration_days > 0) {{ $item->duration_days }} 天 @else — @endif {{ $item->sort_order }}
@csrf @method('PATCH')
@if ($isSuperAdmin)
@csrf @method('DELETE')
@endif
暂无商品数据
{{-- 新增/编辑 抽屉弹窗 --}}
{{-- 弹窗头部 --}}

{{-- 表单 --}}
@csrf {{-- 基本信息 --}}
{{-- 弹窗底部按钮 --}}
@endsection