{{-- 文件功能:后台商店商品管理页面(站长功能) 支持查看、新增、编辑、上下架切换、删除商品。 字段:名称、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
管理聊天室商店内所有可出售商品,支持上下架控制。
| 商品 | 类型 | 价格 | 有效期 | 排序 | 状态 | 操作 |
|---|---|---|---|---|---|---|
|
{{ $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 }} | {{-- 状态 --}}{{-- 操作 --}} |
@if ($isSuperAdmin)
@endif
|
| 暂无商品数据 | ||||||