ui(site-subscriptions): add return-to-order header in attach order mode
This commit is contained in:
@@ -47,7 +47,17 @@
|
||||
</div>
|
||||
|
||||
<div class="page-header-actions">
|
||||
@if($safeBackForLinks !== '')
|
||||
@if($attachOrderId > 0)
|
||||
@php
|
||||
// attach_back 优先(从订单详情跳来),否则 fallback 到订单详情自身
|
||||
$attachBackUrl = $safeAttachBackForLinks;
|
||||
if ($attachBackUrl === '') {
|
||||
$attachBackUrl = '/admin/platform-orders/' . $attachOrderId;
|
||||
}
|
||||
@endphp
|
||||
<span class="badge">绑定订阅到订单:#{{ $attachOrderId }}</span>
|
||||
<a href="{!! $attachBackUrl !!}" class="btn btn-secondary btn-sm">返回订单详情</a>
|
||||
@elseif($safeBackForLinks !== '')
|
||||
<a href="{!! $safeBackForLinks !!}" class="btn btn-secondary btn-sm">返回上一页(保留上下文)</a>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@@ -62,8 +62,13 @@ class AdminSiteSubscriptionIndexAttachOrderIdShouldRenderBindButtonTest extends
|
||||
|
||||
$html = (string) $res->getContent();
|
||||
|
||||
// 去重降噪:处于 attach_order_id 模式时,不应出现“续费下单(先选订阅)”工具入口
|
||||
// 去重降噪:处于 attach_order_id 模式时,不应出现任何“续费下单”入口(包含工具入口与行内按钮)
|
||||
$this->assertStringNotContainsString('续费下单(先选订阅)', $html);
|
||||
$this->assertStringNotContainsString('>续费下单<', $html);
|
||||
|
||||
// 顶部应有“返回订单详情”入口,避免运营迷路
|
||||
$this->assertStringContainsString('返回订单详情', $html);
|
||||
$this->assertStringContainsString('/admin/platform-orders/1', $html);
|
||||
|
||||
$this->assertStringContainsString('绑定到订单 #' . $orderId, $html);
|
||||
$this->assertStringContainsString('/admin/platform-orders/' . $orderId . '/attach-subscription', $html);
|
||||
|
||||
Reference in New Issue
Block a user