From 1e64bbc6d3ba831c91246a91f9402c6b2ae98124 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Mon, 16 Mar 2026 03:34:48 +0800 Subject: [PATCH] chore(admin-ui): migrate platform leads index to filters/list card and admin pagination --- .../admin/platform_leads/index.blade.php | 262 +++++++++--------- ...ouldUseFiltersAndListCardStructureTest.php | 45 +++ 2 files changed, 183 insertions(+), 124 deletions(-) create mode 100644 tests/Feature/AdminPlatformLeadsIndexShouldUseFiltersAndListCardStructureTest.php diff --git a/resources/views/admin/platform_leads/index.blade.php b/resources/views/admin/platform_leads/index.blade.php index 123fc15..936a61a 100644 --- a/resources/views/admin/platform_leads/index.blade.php +++ b/resources/views/admin/platform_leads/index.blade.php @@ -73,140 +73,154 @@ }; @endphp -
-

对外平台(/platform)收集的开通意向线索,用于前期 A(站点开通型)人工运营承接。

- - @if($safeBackForLinks !== '') -
- ← 返回上一页(保留上下文) +
+ +
+
+

开通线索

+
对外平台(/platform)收集的开通意向线索,用于前期人工运营承接。
+
+ 点击收起/展开
- @endif -

后续会在此处逐步接入:一键生成站点/订阅/平台订单、跟进记录、转化漏斗与治理提示。

-
-
-

筛选

-
@if($safeBackForLinks !== '') - + @endif - - - + +
后续会在此处逐步接入:一键生成站点/订阅/平台订单、跟进记录、转化漏斗与治理提示。
+ + +
+

筛选

+ + @if($safeBackForLinks !== '') + + @endif + + + +
+ + 重置 +
+ +
+ + +
+
- +

线索列表

+
当前阶段仅提供查询与筛选;已补“从线索创建订单”入口,先把收费闭环跑起来。
- -
+
-
-

线索列表

-
当前阶段仅提供查询与筛选;已补“从线索创建订单”入口,先把收费闭环跑起来。
- - - - - - - - - - - - - - - - - - @forelse($leads as $l) +
+
ID状态姓名手机号邮箱公司套餐ID来源创建时间操作
+ - - - - - - - - - - + + + + + + + + + + - @empty - - - - @endforelse - -
{{ $l->id }} -
- {{ $statusLabels[$l->status] ?? $l->status }} - - @php - // 轻量运营流转:仅展示“下一步可能动作”,减少噪音/误点。 - $nextActions = []; - switch ((string) $l->status) { - case 'new': - $nextActions = ['contacted', 'converted', 'closed']; - break; - case 'contacted': - $nextActions = ['qualified', 'converted', 'closed']; - break; - case 'qualified': - $nextActions = ['converted', 'closed']; - break; - case 'converted': - $nextActions = ['closed']; - break; - default: - $nextActions = []; - } - - $actionLabels = [ - 'contacted' => ['text' => '标记已联系', 'class' => 'btn-secondary btn-sm'], - 'qualified' => ['text' => '标记已确认需求', 'class' => 'btn-secondary btn-sm'], - 'converted' => ['text' => '标记已转化', 'class' => 'btn btn-sm'], - 'closed' => ['text' => '关闭', 'class' => 'btn-danger btn-sm'], - ]; - @endphp - - @foreach($nextActions as $status) -
- @csrf - - -
- @endforeach -
-
{{ $l->name }}{{ $l->mobile }}{{ $l->email }}{{ $l->company }}{{ $l->plan_id ?: '-' }}{{ $l->source }}{{ optional($l->created_at)->format('Y-m-d H:i:s') }} -
- 创建订单 - 创建续费订单 - - @php - $viewOrdersUrl = '/admin/platform-orders?' . \Illuminate\Support\Arr::query([ - 'lead_id' => $l->id, - 'back' => $selfWithoutBack, - ]); - - $viewRenewalMissingSubOrdersUrl = '/admin/platform-orders?' . \Illuminate\Support\Arr::query([ - 'lead_id' => $l->id, - 'renewal_missing_subscription' => '1', - 'back' => $selfWithoutBack, - ]); - @endphp - 查看订单 - 续费缺订阅 -
-
ID状态姓名手机号邮箱公司套餐ID来源创建时间操作
暂无线索
+ + + @forelse($leads as $l) + + {{ $l->id }} + +
+ {{ $statusLabels[$l->status] ?? $l->status }} -
- {{ $leads->links() }} + @php + // 轻量运营流转:仅展示“下一步可能动作”,减少噪音/误点。 + $nextActions = []; + switch ((string) $l->status) { + case 'new': + $nextActions = ['contacted', 'converted', 'closed']; + break; + case 'contacted': + $nextActions = ['qualified', 'converted', 'closed']; + break; + case 'qualified': + $nextActions = ['converted', 'closed']; + break; + case 'converted': + $nextActions = ['closed']; + break; + default: + $nextActions = []; + } + + $actionLabels = [ + 'contacted' => ['text' => '标记已联系', 'class' => 'btn-secondary btn-sm'], + 'qualified' => ['text' => '标记已确认需求', 'class' => 'btn-secondary btn-sm'], + 'converted' => ['text' => '标记已转化', 'class' => 'btn btn-sm'], + 'closed' => ['text' => '关闭', 'class' => 'btn-danger btn-sm'], + ]; + @endphp + + @foreach($nextActions as $status) +
+ @csrf + + +
+ @endforeach +
+ + {{ $l->name }} + {{ $l->mobile }} + {{ $l->email }} + {{ $l->company }} + {{ $l->plan_id ?: '-' }} + {{ $l->source }} + {{ optional($l->created_at)->format('Y-m-d H:i:s') }} + +
+ 创建订单 + 创建续费订单 + + @php + $viewOrdersUrl = '/admin/platform-orders?' . \Illuminate\Support\Arr::query([ + 'lead_id' => $l->id, + 'back' => $selfWithoutBack, + ]); + + $viewRenewalMissingSubOrdersUrl = '/admin/platform-orders?' . \Illuminate\Support\Arr::query([ + 'lead_id' => $l->id, + 'renewal_missing_subscription' => '1', + 'back' => $selfWithoutBack, + ]); + @endphp + 查看订单 + 续费缺订阅 +
+ + + @empty + + 暂无线索 + + @endforelse + + + + {{ $leads->links('pagination.admin') }}
@endsection diff --git a/tests/Feature/AdminPlatformLeadsIndexShouldUseFiltersAndListCardStructureTest.php b/tests/Feature/AdminPlatformLeadsIndexShouldUseFiltersAndListCardStructureTest.php new file mode 100644 index 0000000..b262d32 --- /dev/null +++ b/tests/Feature/AdminPlatformLeadsIndexShouldUseFiltersAndListCardStructureTest.php @@ -0,0 +1,45 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_admin_platform_leads_index_should_use_filters_and_list_card_structure(): void + { + $this->loginAsPlatformAdmin(); + + $response = $this->get('/admin/platform-leads'); + $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/platform_leads/index.blade.php')); + $this->assertIsString($blade); + $this->assertStringContainsString("links('pagination.admin')", $blade); + } +}