diff --git a/assets/css/routes/user-center/shell.css b/assets/css/routes/user-center/shell.css index 208af3ff..ecd2aa0d 100644 --- a/assets/css/routes/user-center/shell.css +++ b/assets/css/routes/user-center/shell.css @@ -456,6 +456,15 @@ body.aksrt-user-center .uc-content, gap: 4px; } +/* Order quick shortcuts nested inside the 我的服务 section. */ +.uc-order-grid--quick { + grid-template-columns: repeat(2, minmax(0, 1fr)); + gap: 8px; + margin-top: 14px; + padding-top: 14px; + border-top: 1px solid var(--color-line-soft, rgba(0, 0, 0, 0.06)); +} + .uc-order-grid__item { display: flex; flex-direction: column; @@ -627,6 +636,7 @@ body.aksrt-user-center .uc-content, .uc-service-grid__item--cart .uc-service-grid__icon { color: #dd6941; background: rgba(238, 109, 61, 0.12); } .uc-service-grid__item--level .uc-service-grid__icon { color: #9b6b0a; background: rgba(234, 179, 8, 0.13); } .uc-service-grid__item--auth .uc-service-grid__icon { color: #287bc4; background: rgba(14, 165, 233, 0.12); } +.uc-service-grid__item--orders .uc-service-grid__icon { color: #c05621; background: rgba(234, 88, 12, 0.12); } .uc-service-grid__item--notice .uc-service-grid__icon { color: #d04b65; background: rgba(244, 63, 94, 0.11); } .uc-service-grid__item--profile .uc-service-grid__icon { color: #6550c7; background: rgba(124, 92, 220, 0.12); } .uc-service-grid__item--security .uc-service-grid__icon { color: #16816c; background: rgba(16, 185, 129, 0.12); } diff --git a/inc/helpers/user-center-renderers/profile-sidebar.php b/inc/helpers/user-center-renderers/profile-sidebar.php index 1a1d7370..4943137b 100644 --- a/inc/helpers/user-center-renderers/profile-sidebar.php +++ b/inc/helpers/user-center-renderers/profile-sidebar.php @@ -11,7 +11,6 @@ $context = is_array($args['context'] ?? null) ? $args['context'] : []; extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract require __DIR__ . '/sidebar-stats.php'; -require __DIR__ . '/sidebar-orders.php'; require __DIR__ . '/sidebar-commerce.php'; require __DIR__ . '/sidebar-creator.php'; require __DIR__ . '/sidebar-nav.php'; diff --git a/inc/helpers/user-center-renderers/sidebar-nav.php b/inc/helpers/user-center-renderers/sidebar-nav.php index 9671b9e4..63c7a357 100644 --- a/inc/helpers/user-center-renderers/sidebar-nav.php +++ b/inc/helpers/user-center-renderers/sidebar-nav.php @@ -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 {
+ + +
diff --git a/inc/helpers/user-center-renderers/sidebar-orders.php b/inc/helpers/user-center-renderers/sidebar-orders.php index e0710a57..1565ee5e 100644 --- a/inc/helpers/user-center-renderers/sidebar-orders.php +++ b/inc/helpers/user-center-renderers/sidebar-orders.php @@ -2,6 +2,8 @@ /** * User center sidebar: task-oriented order shortcuts. * + * Rendered inside the 我的服务 (My Services) section — see sidebar-nav.php. + * * @package AKSRT */ @@ -16,9 +18,6 @@ $order_user_id = (int) ($user_id ?? 0); $order_stats = class_exists('\AKSRT\Payment\Order') ? \AKSRT\Payment\Order::get_instance()->get_stats($order_user_id) : []; -$order_repo = class_exists('\AKSRT\Payment\OrderRepository') - ? \AKSRT\Payment\OrderRepository::get_instance() - : null; $order_items = [ [ 'label' => __('待支付', 'aksrt'), @@ -34,26 +33,18 @@ $order_items = [ ], ]; ?> -
-
- - - + - +