diff --git a/public/css/platform.css b/public/css/platform.css index 2130e75..e98cd51 100644 --- a/public/css/platform.css +++ b/public/css/platform.css @@ -97,6 +97,14 @@ body{ color:#fff; } +.input{ + padding:8px 10px; + border:1px solid var(--border); + border-radius:8px; + width:100%; + box-sizing:border-box; +} + .badge{ display:inline-block; font-size:12px; @@ -106,6 +114,26 @@ body{ color:#374151; } +.flash{ + margin-top:16px; + padding:10px 12px; + border-radius:10px; + border:1px solid #bbf7d0; + background:#f0fdf4; + color:#14532d; + font-size:14px; +} + +.error-box{ + margin-top:16px; + padding:10px 12px; + border-radius:10px; + border:1px solid #fecaca; + background:#fef2f2; + color:#7f1d1d; + font-size:14px; +} + .price{ margin-top:10px; font-size:22px; diff --git a/resources/views/platform/plans.blade.php b/resources/views/platform/plans.blade.php index 50a461e..6da7e2a 100644 --- a/resources/views/platform/plans.blade.php +++ b/resources/views/platform/plans.blade.php @@ -19,6 +19,21 @@ + @if(session('success')) +
{{ session('success') }}
+ @endif + + @if($errors->any()) +
+ 提交失败: + +
+ @endif +
@forelse($plans as $p)
@@ -39,13 +54,13 @@
开通意向(A:站点开通型,前期先由运营人工开通)
- +
- +
- +
diff --git a/tests/Feature/FrontPlatformLeadStoreTest.php b/tests/Feature/FrontPlatformLeadStoreTest.php new file mode 100644 index 0000000..3334080 --- /dev/null +++ b/tests/Feature/FrontPlatformLeadStoreTest.php @@ -0,0 +1,54 @@ +create([ + 'code' => 'front_lead_plan_01', + 'name' => '线索测试套餐', + 'billing_cycle' => 'monthly', + 'price' => 10, + 'list_price' => 10, + 'status' => 'active', + 'sort' => 10, + 'published_at' => now(), + ]); + + $res = $this->post('/platform/leads', [ + 'name' => '张三', + 'mobile' => '13800000000', + 'plan_id' => $plan->id, + 'source' => 'platform_plans', + 'note' => '想先试用一下', + ]); + + $res->assertRedirect('/platform/plans'); + + $this->assertDatabaseHas('platform_leads', [ + 'name' => '张三', + 'mobile' => '13800000000', + 'plan_id' => $plan->id, + 'source' => 'platform_plans', + 'status' => 'new', + ]); + } + + public function test_submit_platform_lead_should_validate_required_name(): void + { + $res = $this->post('/platform/leads', [ + 'name' => '', + ]); + + $res->assertStatus(302); + $res->assertSessionHasErrors(['name']); + } +}