diff --git a/resources/views/admin/product_categories/index.blade.php b/resources/views/admin/product_categories/index.blade.php index cbd9c35..acad597 100644 --- a/resources/views/admin/product_categories/index.blade.php +++ b/resources/views/admin/product_categories/index.blade.php @@ -4,67 +4,87 @@ @section('page_title', '商品分类') @section('content') -
-

这里是总台视角的商品分类巡检与维护入口,可跨站点查看分类结构。

-

当前分类列表已接入缓存:{{ $cacheMeta['store'] }} / TTL {{ $cacheMeta['ttl'] }}。

-

新增分类

-
- @csrf -
- - - - - - +
+ +
+
+

商品分类

+
总台视角的商品分类巡检与维护入口,可跨站点查看分类结构。
+
+ 点击收起/展开
-
- -
+
当前分类列表已接入缓存:{{ $cacheMeta['store'] }} / TTL {{ $cacheMeta['ttl'] }}。
+ -
-

分类列表

- - - - @foreach($categories as $category) - - - - - - - - - - - @endforeach - -
ID商家名称Slug状态排序说明操作
{{ $category->id }}{{ $category->merchant?->name ?? ('商家#'.$category->merchant_id) }} -
- @csrf - -
- - - - -
- @csrf - -
-
-
+
+

新增分类

+
+ @csrf +
+ + + + + + +
+
+
+
+ -
{{ $categories->links() }}
+
+
+
+

分类列表

+
+
+ +
+ + + + @forelse($categories as $category) + + + + + + + + + + + @empty + + @endforelse + +
ID商家名称Slug状态排序说明操作
{{ $category->id }}{{ $category->merchant?->name ?? ('商家#'.$category->merchant_id) }} +
+ @csrf + +
+ + + + +
+ @csrf + +
+
暂无分类
+ + {{ $categories->links('pagination.admin') }} +
+
@endsection diff --git a/tests/Feature/AdminProductCategoriesIndexShouldUseFiltersAndListCardStructureTest.php b/tests/Feature/AdminProductCategoriesIndexShouldUseFiltersAndListCardStructureTest.php new file mode 100644 index 0000000..3365a7a --- /dev/null +++ b/tests/Feature/AdminProductCategoriesIndexShouldUseFiltersAndListCardStructureTest.php @@ -0,0 +1,45 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_admin_product_categories_index_should_use_filters_and_list_card_structure(): void + { + $this->loginAsPlatformAdmin(); + + $response = $this->get('/admin/product-categories'); + $response->assertOk(); + + // 护栏:商品分类页应使用统一 Filters Card + List Card 结构,便于全站后台观感一致。 + $response->assertSee('filters-card', false); + $response->assertSee('filters-summary', false); + $response->assertSee('filters-body', false); + $response->assertSee('filters-grid', false); + + $response->assertSee('list-card', false); + $response->assertSee('list-card-header', false); + $response->assertSee('list-card-body', false); + $response->assertSee('list-card-table', false); + + // 分页统一:此页数据量可能不足导致 hasPages=false,因此用扫描型护栏断言。 + $blade = file_get_contents(resource_path('views/admin/product_categories/index.blade.php')); + $this->assertIsString($blade); + $this->assertStringContainsString("links('pagination.admin')", $blade); + } +}