refactor(platform-orders): extract blocked hint component for tool actions
This commit is contained in:
33
resources/views/admin/components/tool_blocked_hint.blade.php
Normal file
33
resources/views/admin/components/tool_blocked_hint.blade.php
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
@php
|
||||||
|
/**
|
||||||
|
* 通用“工具被阻断提示块”。
|
||||||
|
*
|
||||||
|
* 用法:
|
||||||
|
* @include('admin.components.tool_blocked_hint', [
|
||||||
|
* 'dataRole' => 'xxx-blocked-hint',
|
||||||
|
* 'reason' => '提示原因',
|
||||||
|
* // actions: [['label' => '去xxx', 'url' => $url], ...]
|
||||||
|
* 'actions' => [ ... ],
|
||||||
|
* ])
|
||||||
|
*/
|
||||||
|
$dataRole = (string) ($dataRole ?? '');
|
||||||
|
$reason = (string) ($reason ?? '');
|
||||||
|
$actions = (array) ($actions ?? []);
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
<div class="adm-tool-blocked-hint" @if($dataRole !== '') data-role="{{ $dataRole }}" @endif>
|
||||||
|
<div>提示:{{ $reason }}</div>
|
||||||
|
@if(count($actions) > 0)
|
||||||
|
<div class="mt-6 actions gap-10">
|
||||||
|
@foreach($actions as $a)
|
||||||
|
@php
|
||||||
|
$label = (string) ($a['label'] ?? '');
|
||||||
|
$url = (string) ($a['url'] ?? '');
|
||||||
|
@endphp
|
||||||
|
@if($label !== '' && $url !== '')
|
||||||
|
<a class="btn btn-secondary btn-sm" href="{!! $url !!}">{{ $label }}</a>
|
||||||
|
@endif
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
@@ -875,8 +875,6 @@
|
|||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<button class="btn btn-sm" type="submit" @disabled($batchActivateBlocked) title="{{ $batchActivateBlockedReason }}">批量同步订阅(当前筛选范围)</button>
|
<button class="btn btn-sm" type="submit" @disabled($batchActivateBlocked) title="{{ $batchActivateBlockedReason }}">批量同步订阅(当前筛选范围)</button>
|
||||||
@if($batchActivateBlocked)
|
@if($batchActivateBlocked)
|
||||||
<div class="adm-tool-blocked-hint" data-role="batch-activate-subscriptions-blocked-hint">
|
|
||||||
<div>提示:{{ $batchActivateBlockedReason }}</div>
|
|
||||||
@php
|
@php
|
||||||
// 提效:被阻断时给一键跳转到「可同步订阅集合」(口径:syncable_only=1 + sync_status=unsynced)。
|
// 提效:被阻断时给一键跳转到「可同步订阅集合」(口径:syncable_only=1 + sync_status=unsynced)。
|
||||||
$goSyncableUrl = $buildQuickFilterUrl([
|
$goSyncableUrl = $buildQuickFilterUrl([
|
||||||
@@ -884,10 +882,13 @@
|
|||||||
'sync_status' => 'unsynced',
|
'sync_status' => 'unsynced',
|
||||||
]);
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
<div class="mt-6 actions gap-10">
|
@include('admin.components.tool_blocked_hint', [
|
||||||
<a class="btn btn-secondary btn-sm" href="{!! $goSyncableUrl !!}">切到可同步订阅集合</a>
|
'dataRole' => 'batch-activate-subscriptions-blocked-hint',
|
||||||
</div>
|
'reason' => $batchActivateBlockedReason,
|
||||||
</div>
|
'actions' => [
|
||||||
|
['label' => '切到可同步订阅集合', 'url' => $goSyncableUrl],
|
||||||
|
],
|
||||||
|
])
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -931,8 +932,6 @@
|
|||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<button class="btn btn-sm" type="submit" @disabled($batchBmpaBlocked) title="{{ $batchBmpaBlockedReason }}">批量标记支付并生效(含订阅同步)(当前筛选范围)</button>
|
<button class="btn btn-sm" type="submit" @disabled($batchBmpaBlocked) title="{{ $batchBmpaBlockedReason }}">批量标记支付并生效(含订阅同步)(当前筛选范围)</button>
|
||||||
@if($batchBmpaBlocked)
|
@if($batchBmpaBlocked)
|
||||||
<div class="adm-tool-blocked-hint" data-role="batch-bmpa-blocked-hint">
|
|
||||||
<div>提示:{{ $batchBmpaBlockedReason }}</div>
|
|
||||||
@php
|
@php
|
||||||
// 提效:被阻断时给一键跳转到「可BMPA处理集合」(口径:pending + unpaid)。
|
// 提效:被阻断时给一键跳转到「可BMPA处理集合」(口径:pending + unpaid)。
|
||||||
$goBmpaProcessableUrl = $buildQuickFilterUrl([
|
$goBmpaProcessableUrl = $buildQuickFilterUrl([
|
||||||
@@ -940,10 +939,13 @@
|
|||||||
'payment_status' => 'unpaid',
|
'payment_status' => 'unpaid',
|
||||||
]);
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
<div class="mt-6 actions gap-10">
|
@include('admin.components.tool_blocked_hint', [
|
||||||
<a class="btn btn-secondary btn-sm" href="{!! $goBmpaProcessableUrl !!}">切到可BMPA处理集合</a>
|
'dataRole' => 'batch-bmpa-blocked-hint',
|
||||||
</div>
|
'reason' => $batchBmpaBlockedReason,
|
||||||
</div>
|
'actions' => [
|
||||||
|
['label' => '切到可BMPA处理集合', 'url' => $goBmpaProcessableUrl],
|
||||||
|
],
|
||||||
|
])
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -987,8 +989,6 @@
|
|||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<button class="btn btn-sm" type="submit" @disabled($batchMarkActivatedBlocked) title="{{ $batchMarkActivatedBlockedReason }}">批量仅标记为已生效(当前筛选范围)</button>
|
<button class="btn btn-sm" type="submit" @disabled($batchMarkActivatedBlocked) title="{{ $batchMarkActivatedBlockedReason }}">批量仅标记为已生效(当前筛选范围)</button>
|
||||||
@if($batchMarkActivatedBlocked)
|
@if($batchMarkActivatedBlocked)
|
||||||
<div class="adm-tool-blocked-hint" data-role="batch-mark-activated-blocked-hint">
|
|
||||||
<div>提示:{{ $batchMarkActivatedBlockedReason }}</div>
|
|
||||||
@php
|
@php
|
||||||
// 提效:当被阻断时给一键跳转到“待生效集合”的入口(口径:paid + pending + sync_status=unsynced)。
|
// 提效:当被阻断时给一键跳转到“待生效集合”的入口(口径:paid + pending + sync_status=unsynced)。
|
||||||
// 说明:使用快捷筛选构造器,保留上下文(站点/套餐/订阅/keyword/lead/时间范围/back),并自动清空 page 与工具型开关。
|
// 说明:使用快捷筛选构造器,保留上下文(站点/套餐/订阅/keyword/lead/时间范围/back),并自动清空 page 与工具型开关。
|
||||||
@@ -998,10 +998,13 @@
|
|||||||
'sync_status' => 'unsynced',
|
'sync_status' => 'unsynced',
|
||||||
]);
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
<div class="mt-6 actions gap-10">
|
@include('admin.components.tool_blocked_hint', [
|
||||||
<a class="btn btn-secondary btn-sm" href="{!! $goPaidPendingUnsyncedUrl !!}">切到待生效集合</a>
|
'dataRole' => 'batch-mark-activated-blocked-hint',
|
||||||
</div>
|
'reason' => $batchMarkActivatedBlockedReason,
|
||||||
</div>
|
'actions' => [
|
||||||
|
['label' => '切到待生效集合', 'url' => $goPaidPendingUnsyncedUrl],
|
||||||
|
],
|
||||||
|
])
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -1037,18 +1040,19 @@
|
|||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<button class="btn btn-danger btn-sm" type="submit" @disabled($clearSyncBlocked) title="{{ $clearSyncBlockedReason }}">清除同步失败标记(当前筛选范围)</button>
|
<button class="btn btn-danger btn-sm" type="submit" @disabled($clearSyncBlocked) title="{{ $clearSyncBlockedReason }}">清除同步失败标记(当前筛选范围)</button>
|
||||||
@if($clearSyncBlocked)
|
@if($clearSyncBlocked)
|
||||||
<div class="adm-tool-blocked-hint" data-role="clear-sync-errors-blocked-hint">
|
|
||||||
<div>提示:{{ $clearSyncBlockedReason }}</div>
|
|
||||||
@php
|
@php
|
||||||
// 提效:清理同步失败标记前必须先锁定失败集合;被阻断时给一键跳转入口。
|
// 提效:清理同步失败标记前必须先锁定失败集合;被阻断时给一键跳转入口。
|
||||||
$goSyncFailedUrl = $buildQuickFilterUrl([
|
$goSyncFailedUrl = $buildQuickFilterUrl([
|
||||||
'sync_status' => 'failed',
|
'sync_status' => 'failed',
|
||||||
]);
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
<div class="mt-6 actions gap-10">
|
@include('admin.components.tool_blocked_hint', [
|
||||||
<a class="btn btn-secondary btn-sm" href="{!! $goSyncFailedUrl !!}">切到同步失败集合</a>
|
'dataRole' => 'clear-sync-errors-blocked-hint',
|
||||||
</div>
|
'reason' => $clearSyncBlockedReason,
|
||||||
</div>
|
'actions' => [
|
||||||
|
['label' => '切到同步失败集合', 'url' => $goSyncFailedUrl],
|
||||||
|
],
|
||||||
|
])
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
@@ -1083,18 +1087,19 @@
|
|||||||
<div class="mt-6">
|
<div class="mt-6">
|
||||||
<button class="btn btn-danger btn-sm" type="submit" @disabled($clearBmpaBlocked) title="{{ $clearBmpaBlockedReason }}">清除批量标记支付失败标记(当前筛选范围)</button>
|
<button class="btn btn-danger btn-sm" type="submit" @disabled($clearBmpaBlocked) title="{{ $clearBmpaBlockedReason }}">清除批量标记支付失败标记(当前筛选范围)</button>
|
||||||
@if($clearBmpaBlocked)
|
@if($clearBmpaBlocked)
|
||||||
<div class="adm-tool-blocked-hint" data-role="clear-bmpa-errors-blocked-hint">
|
|
||||||
<div>提示:{{ $clearBmpaBlockedReason }}</div>
|
|
||||||
@php
|
@php
|
||||||
// 提效:清理 BMPA 失败标记前必须先锁定 BMPA 失败集合;被阻断时给一键跳转入口。
|
// 提效:清理 BMPA 失败标记前必须先锁定 BMPA 失败集合;被阻断时给一键跳转入口。
|
||||||
$goBmpaFailedUrl = $buildQuickFilterUrl([
|
$goBmpaFailedUrl = $buildQuickFilterUrl([
|
||||||
'bmpa_failed_only' => '1',
|
'bmpa_failed_only' => '1',
|
||||||
]);
|
]);
|
||||||
@endphp
|
@endphp
|
||||||
<div class="mt-6 actions gap-10">
|
@include('admin.components.tool_blocked_hint', [
|
||||||
<a class="btn btn-secondary btn-sm" href="{!! $goBmpaFailedUrl !!}">切到 BMPA 失败集合</a>
|
'dataRole' => 'clear-bmpa-errors-blocked-hint',
|
||||||
</div>
|
'reason' => $clearBmpaBlockedReason,
|
||||||
</div>
|
'actions' => [
|
||||||
|
['label' => '切到 BMPA 失败集合', 'url' => $goBmpaFailedUrl],
|
||||||
|
],
|
||||||
|
])
|
||||||
@endif
|
@endif
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
Reference in New Issue
Block a user