refactor: move user-center My Orders into My Services section

The standalone order card is folded into the 我的服务 (My Services) sidebar
section: 我的订单 becomes a service-grid tile (all orders), with the
待支付/售后 quick shortcuts rendered beneath it as a compact row. Gated on
the orders dashboard tab being registered so no dead tile appears when the
payment stack is absent.
This commit is contained in:
kate522 committed 2026-08-03 09:09:02 +08:00
1 parent 2cc198ada9
commit 16fdeceaf7
4 files changed
+37 -25

No files matched your search

@@ -11,6 +11,8 @@ $level_url = isset($dashboard_tabs['level'])
? aksrt_get_user_center_tab_url('level')
: '';
$auth_url = isset($dashboard_tabs['auth']) ? aksrt_get_user_center_tab_url('auth') : '';
$orders_available = isset($dashboard_tabs['orders']);
$orders_url = $orders_available ? (string) ($orders_url ?? '') : '';
$services = array_values(array_filter([
[
@@ -26,6 +28,13 @@ $services = array_values(array_filter([
'url' => $auth_url,
'tab' => 'auth',
],
[
'label' => __('我的订单', 'aksrt'),
'icon' => 'receipt',
'tone' => 'orders',
'url' => $orders_url,
'tab' => 'orders',
],
], static fn(array $item): bool => (string) $item['url'] !== ''));
$settings = array_values(array_filter([
@@ -70,6 +79,9 @@ $render_grid = static function (array $items): void {
<div class="uc-sidebar__section">
<div class="uc-sidebar__heading"><span><?php esc_html_e('我的服务', 'aksrt'); ?></span></div>
<?php $render_grid($services); ?>
<?php if ($orders_url !== '') : ?>
<?php require __DIR__ . '/sidebar-orders.php'; ?>
<?php endif; ?>
</div>
<?php endif; ?>