diff --git a/resources/views/admin/components/mini_bar_row.blade.php b/resources/views/admin/components/mini_bar_row.blade.php new file mode 100644 index 0000000..a17cb2d --- /dev/null +++ b/resources/views/admin/components/mini_bar_row.blade.php @@ -0,0 +1,46 @@ +@php + /** + * Admin UI Component: Mini Bar Row (link) + * + * Required: + * - $href + * - $label + * - $pct + * - $value + * + * Optional: + * - $rowRole + * - $barRole + * - $title + * - $ariaLabel + * - $class + */ + + $href = (string) ($href ?? '#'); + $label = (string) ($label ?? ''); + $pct = (float) ($pct ?? 0); + $value = (string) ($value ?? ''); + + $rowRole = (string) ($rowRole ?? ''); + $barRole = (string) ($barRole ?? ''); + $title = (string) ($title ?? ''); + $ariaLabel = (string) ($ariaLabel ?? ''); + $class = (string) ($class ?? ''); + + $pct = max(0, min(100, $pct)); +@endphp + + +
{{ $label }}
+
+ +
+
{{ $value }}
+
diff --git a/resources/views/admin/dashboard.blade.php b/resources/views/admin/dashboard.blade.php index 2cc3d83..be10076 100644 --- a/resources/views/admin/dashboard.blade.php +++ b/resources/views/admin/dashboard.blade.php @@ -534,21 +534,29 @@
北极星指标(图形化)
- -
付费渗透
-
- -
-
{{ $pctActivePaidMerchants }}%({{ $activePaidMerchants }})
-
+ @include('admin.components.mini_bar_row', [ + 'class' => 'mt-6', + 'rowRole' => 'ops-northstar-active-paid-merchants-row', + 'barRole' => 'ops-northstar-active-paid-merchants-bar', + 'href' => (string) ($opsLinks['active_paid_merchants_subscriptions'] ?? $billingEntryLinks['site_subscriptions']), + 'ariaLabel' => '进入活跃付费站点订阅集合', + 'label' => '付费渗透', + 'pct' => $pctActivePaidMerchants, + 'title' => $activePaidMerchants . ' / ' . $merchantsTotal . '(' . $pctActivePaidMerchants . '%)', + 'value' => $pctActivePaidMerchants . '%(' . $activePaidMerchants . ')', + ]) - -
续费成功率
-
- -
-
{{ $renewalRate30d }}%
-
+ @include('admin.components.mini_bar_row', [ + 'class' => 'mt-6', + 'rowRole' => 'ops-northstar-renewal-rate-row', + 'barRole' => 'ops-northstar-renewal-rate-bar', + 'href' => (string) ($opsLinks['renewal_orders_30d'] ?? $billingEntryLinks['platform_orders']), + 'ariaLabel' => '进入近30天续费订单集合', + 'label' => '续费成功率', + 'pct' => $renewalRate30d, + 'title' => $renewalRate30d . '%(' . $renewalSuccess30d . ' / ' . $renewalCreated30d . ')', + 'value' => $renewalRate30d . '%', + ])
说明:付费渗透 = 活跃付费站点 / 站点总数;续费成功率按近30天续费单计算。