统一后台列表页样式并调整站长菜单
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
@section('title', '🛒 商店商品管理')
|
||||
|
||||
@section('content')
|
||||
@php require resource_path('views/admin/partials/list-theme.php'); @endphp
|
||||
|
||||
@php
|
||||
$typeLabels = [
|
||||
@@ -90,48 +91,49 @@
|
||||
}">
|
||||
|
||||
{{-- 头部操作栏 --}}
|
||||
<div class="flex justify-between items-center mb-6">
|
||||
<div>
|
||||
<h2 class="text-lg font-bold text-gray-800">商店商品列表</h2>
|
||||
<p class="text-sm text-gray-500">管理聊天室商店内所有可出售商品,支持上下架控制。</p>
|
||||
<div class="{{ $adminListHeaderCardClass }} mb-6">
|
||||
<div class="flex justify-between items-center">
|
||||
<div>
|
||||
<h2 class="{{ $adminListHeaderTitleClass }}">商店商品列表</h2>
|
||||
<p class="{{ $adminListHeaderSubtitleClass }}">管理聊天室商店内所有可出售商品,支持上下架控制。</p>
|
||||
</div>
|
||||
@if ($isSuperAdmin)
|
||||
<button @click="openCreate()" class="{{ $adminListPrimaryButtonClass }}">
|
||||
+ 新增商品
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
@if ($isSuperAdmin)
|
||||
<button @click="openCreate()"
|
||||
class="bg-indigo-600 text-white px-5 py-2.5 rounded-lg font-bold hover:bg-indigo-700 transition shadow-sm">
|
||||
+ 新增商品
|
||||
</button>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
{{-- 商品列表表格 --}}
|
||||
<div class="bg-white rounded-xl shadow overflow-hidden">
|
||||
<table class="w-full text-sm">
|
||||
<thead class="bg-gray-50 text-gray-500 uppercase text-xs tracking-wider">
|
||||
<div class="{{ $adminListCardClass }}">
|
||||
<table class="{{ $adminListTableClass }}">
|
||||
<thead class="{{ $adminListTableHeadRowClass }}">
|
||||
<tr>
|
||||
<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-right">价格</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="{{ $adminListTableHeadCellClass }}">商品</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }}">类型</th>
|
||||
<th class="{{ $adminListTableHeadCellClass }} text-right">价格</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>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody class="divide-y divide-gray-100">
|
||||
<tbody class="{{ $adminListTableBodyClass }}">
|
||||
@forelse ($items as $item)
|
||||
@php $tl = $typeLabels[$item->type] ?? ['label' => $item->type, 'color' => 'bg-gray-100 text-gray-600']; @endphp
|
||||
<tr class="hover:bg-gray-50 transition {{ $item->is_active ? '' : 'opacity-50' }}">
|
||||
<tr class="{{ $adminListTableRowClass }} {{ $item->is_active ? '' : 'opacity-50' }}">
|
||||
{{-- 商品信息 --}}
|
||||
<td class="px-4 py-3">
|
||||
<div class="flex items-center gap-3">
|
||||
<span class="text-2xl leading-none">{{ $item->icon }}</span>
|
||||
<div>
|
||||
<p class="font-semibold text-gray-800">{{ $item->name }}</p>
|
||||
<p class="text-xs text-gray-400 font-mono">{{ $item->slug }}</p>
|
||||
@if ($item->description)
|
||||
<p class="text-xs text-gray-500 mt-0.5 max-w-xs truncate">
|
||||
<p class="{{ $adminListPrimaryTextClass }}">{{ $item->name }}</p>
|
||||
<p class="{{ $adminListSecondaryTextClass }} font-mono">{{ $item->slug }}</p>
|
||||
@if ($item->description)
|
||||
<p class="text-xs text-gray-500 mt-0.5 max-w-xs truncate" title="{{ $item->description }}">
|
||||
{{ $item->description }}</p>
|
||||
@endif
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
@@ -189,7 +191,7 @@
|
||||
'sort_order' => $item->sort_order,
|
||||
'is_active' => (bool) $item->is_active,
|
||||
]) }})"
|
||||
class="text-indigo-600 hover:text-indigo-800 text-xs font-semibold px-2 py-1 rounded hover:bg-indigo-50 transition">
|
||||
class="{{ $adminListActionButtonClass }} text-indigo-600 hover:text-indigo-800 hover:bg-indigo-50">
|
||||
编辑
|
||||
</button>
|
||||
@if ($isSuperAdmin)
|
||||
@@ -197,7 +199,7 @@
|
||||
data-admin-confirm="确定要删除「{{ $item->name }}」吗?此操作不可撤销!">
|
||||
@csrf @method('DELETE')
|
||||
<button type="submit"
|
||||
class="text-red-500 hover:text-red-700 text-xs font-semibold px-2 py-1 rounded hover:bg-red-50 transition">
|
||||
class="{{ $adminListActionButtonClass }} text-red-500 hover:text-red-700 hover:bg-red-50">
|
||||
删除
|
||||
</button>
|
||||
</form>
|
||||
@@ -207,7 +209,7 @@
|
||||
</tr>
|
||||
@empty
|
||||
<tr>
|
||||
<td colspan="7" class="px-4 py-12 text-center text-gray-400">暂无商品数据</td>
|
||||
<td colspan="7" class="{{ $adminListEmptyClass }}">暂无商品数据</td>
|
||||
</tr>
|
||||
@endforelse
|
||||
</tbody>
|
||||
|
||||
Reference in New Issue
Block a user