chore(admin-ui): subscription show related orders use list card and admin pagination

This commit is contained in:
萝卜
2026-03-16 04:09:40 +08:00
parent b2b457907e
commit 1b21865820
2 changed files with 48 additions and 6 deletions

View File

@@ -407,10 +407,12 @@
</div>
</div>
<div class="card">
<h3>关联平台订单({{ $platformOrders->total() }}</h3>
<div class="card list-card">
<div class="list-card-header">
<div>
<h3 class="list-card-title">关联平台订单({{ $platformOrders->total() }}</h3>
<div class="mb-10">
<div class="mt-10">
<span class="muted">同步状态筛选:</span>
@php
$cur = $summaryStats['current_order_sync_status'] ?? '';
@@ -444,9 +446,12 @@
@if($cur)
<span class="muted">(当前:{{ $cur }}</span>
@endif
</div>
</div>
</div>
<table>
<div class="list-card-body">
<table class="list-card-table">
<thead>
<tr>
<th>ID</th>
@@ -503,12 +508,13 @@
</tr>
@empty
<tr>
<td colspan="11" class="muted">暂无关联平台订单。</td>
<td colspan="11" class="muted table-empty">暂无关联平台订单。</td>
</tr>
@endforelse
</tbody>
</table>
<div class="pagination-wrap">{{ $platformOrders->links() }}</div>
{{ $platformOrders->links('pagination.admin') }}
</div>
</div>
@endsection

View File

@@ -0,0 +1,36 @@
<?php
namespace Tests\Feature;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminSiteSubscriptionShowRelatedPlatformOrdersShouldUseListCardAndAdminPaginationTest extends TestCase
{
use RefreshDatabase;
protected function loginAsPlatformAdmin(): void
{
$this->seed();
$this->post('/admin/login', [
'email' => 'platform.admin@demo.local',
'password' => 'Platform@123456',
])->assertRedirect('/admin');
}
public function test_admin_site_subscription_show_related_platform_orders_should_use_list_card_and_admin_pagination(): void
{
$this->loginAsPlatformAdmin();
// 护栏:订阅详情页“关联平台订单”区域必须使用统一 List Card + admin pagination。
// 说明:此处使用扫描型断言,避免依赖具体 seed 数据量/分页是否渲染。
$blade = file_get_contents(resource_path('views/admin/site_subscriptions/show.blade.php'));
$this->assertIsString($blade);
$this->assertStringContainsString('list-card', $blade);
$this->assertStringContainsString('list-card-table', $blade);
$this->assertStringContainsString("links('pagination.admin')", $blade);
$this->assertStringContainsString('table-empty', $blade);
}
}