From f40aba69eac4801ed2f279dbd624b67bdc4482ff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=9D=E5=8D=9C?= Date: Mon, 16 Mar 2026 07:42:05 +0800 Subject: [PATCH] chore(admin-ui): align platform orders tools grid and spacing --- public/css/admin-components.css | 5 +- .../admin/platform_orders/index.blade.php | 1 + ...atformOrderShowActionsShouldRenderTest.php | 75 +++++++++++++++++++ 3 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 tests/Feature/AdminPlatformOrderShowActionsShouldRenderTest.php diff --git a/public/css/admin-components.css b/public/css/admin-components.css index bcc6216..ac1d56a 100644 --- a/public/css/admin-components.css +++ b/public/css/admin-components.css @@ -367,7 +367,7 @@ display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; - align-items:start; + align-items:stretch; } /* 防止 focus-box(border) + 内部 form 宽度造成列间“压线/重叠” */ @@ -383,6 +383,9 @@ .tool-group{ width:100%; + height:100%; + display:flex; + flex-direction:column; } .tool-group-title{ diff --git a/resources/views/admin/platform_orders/index.blade.php b/resources/views/admin/platform_orders/index.blade.php index 3e6b9a0..54fd71b 100644 --- a/resources/views/admin/platform_orders/index.blade.php +++ b/resources/views/admin/platform_orders/index.blade.php @@ -1067,6 +1067,7 @@ +
diff --git a/tests/Feature/AdminPlatformOrderShowActionsShouldRenderTest.php b/tests/Feature/AdminPlatformOrderShowActionsShouldRenderTest.php new file mode 100644 index 0000000..a667252 --- /dev/null +++ b/tests/Feature/AdminPlatformOrderShowActionsShouldRenderTest.php @@ -0,0 +1,75 @@ +seed(); + + $this->post('/admin/login', [ + 'email' => 'platform.admin@demo.local', + 'password' => 'Platform@123456', + ])->assertRedirect('/admin'); + } + + public function test_platform_order_show_page_renders_core_governance_action_forms(): void + { + $this->loginAsPlatformAdmin(); + + $merchant = Merchant::query()->firstOrFail(); + $plan = Plan::query()->create([ + 'code' => 'po_show_actions_plan_01', + 'name' => '平台订单详情动作测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + $order = PlatformOrder::query()->create([ + 'merchant_id' => $merchant->id, + 'plan_id' => $plan->id, + 'order_no' => 'PO_SHOW_ACTIONS_0001', + 'order_type' => 'new_purchase', + 'status' => 'pending', + 'payment_status' => 'unpaid', + 'plan_name' => $plan->name, + 'billing_cycle' => $plan->billing_cycle, + 'period_months' => 1, + 'quantity' => 1, + 'payable_amount' => 10, + 'paid_amount' => 0, + 'placed_at' => now(), + ]); + + $res = $this->get('/admin/platform-orders/' . $order->id); + + $res->assertOk(); + + // Guardrails: 收费闭环/治理能力的核心动作必须可见(避免 UI 美化时误删/隐藏)。 + $res->assertSee('标记支付并生效'); + $res->assertSee('同步订阅'); + + // 操作表单(不 escape),确保 action URL 存在。 + $res->assertSee('action="/admin/platform-orders/' . $order->id . '/mark-paid-and-activate"', false); + $res->assertSee('action="/admin/platform-orders/' . $order->id . '/activate-subscription"', false); + + // 回执追加入口(锚点 + 表单 action)。 + $res->assertSee('id="add-payment-receipt"', false); + $res->assertSee('action="/admin/platform-orders/' . $order->id . '/add-payment-receipt"', false); + + $res->assertSee('action="/admin/platform-orders/' . $order->id . '/add-refund-receipt"', false); + } +}