chore(ui): 线索列表创建订单入口改用统一按钮样式

This commit is contained in:
萝卜
2026-03-14 03:47:06 +00:00
parent e632d2c504
commit e8b3c55efd
2 changed files with 57 additions and 1 deletions

View File

@@ -116,7 +116,7 @@
<td>{{ $l->source }}</td>
<td>{{ optional($l->created_at)->format('Y-m-d H:i:s') }}</td>
<td>
<a class="muted" href="{!! $buildCreatePlatformOrderUrl($l) !!}">创建订单</a>
<a class="btn btn-sm" href="{!! $buildCreatePlatformOrderUrl($l) !!}">创建订单</a>
</td>
</tr>
@empty

View File

@@ -0,0 +1,56 @@
<?php
namespace Tests\Feature;
use App\Models\Plan;
use App\Models\PlatformLead;
use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class AdminPlatformLeadIndexCreateOrderLinkUsesButtonStyleTest 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_index_should_render_create_order_link_as_btn_component(): void
{
$this->loginAsPlatformAdmin();
$plan = Plan::query()->create([
'code' => 'lead_btn_plan',
'name' => '线索按钮样式测试套餐',
'billing_cycle' => 'monthly',
'price' => 10,
'list_price' => 10,
'status' => 'active',
'sort' => 10,
'published_at' => now(),
]);
PlatformLead::query()->create([
'name' => '按钮样式线索',
'mobile' => '13800000002',
'email' => 'btn@example.com',
'company' => '样式公司',
'source' => 'test',
'status' => 'new',
'plan_id' => $plan->id,
'meta' => ['from' => 'test'],
]);
$res = $this->get('/admin/platform-leads');
$res->assertOk();
$res->assertSee('class="btn btn-sm"', false);
$res->assertSee('>创建订单<', false);
}
}