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

@@ -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 = [
],
];
?>
<div class="uc-sidebar__section uc-order-card">
<div class="uc-sidebar__heading">
<span><?php esc_html_e('我的订单', 'aksrt'); ?></span>
<a href="<?php echo esc_url($orders_base_url); ?>">
<?php esc_html_e('全部', 'aksrt'); ?><i class="fas fa-angle-right" aria-hidden="true"></i>
<div class="uc-order-grid uc-order-grid--quick">
<?php foreach ($order_items as $item) :
$item_url = add_query_arg('order_tab', $item['tab'], $orders_base_url);
?>
<a class="uc-order-grid__item" href="<?php echo esc_url($item_url); ?>">
<span class="uc-order-grid__icon">
<i class="fas fa-<?php echo esc_attr((string) $item['icon']); ?>" aria-hidden="true"></i>
<?php if ($item['count'] > 0) : ?>
<small><?php echo esc_html($item['count'] > 99 ? '99+' : (string) $item['count']); ?></small>
<?php endif; ?>
</span>
<span><?php echo esc_html((string) $item['label']); ?></span>
</a>
</div>
<div class="uc-order-grid">
<?php foreach ($order_items as $item) :
$item_url = add_query_arg('order_tab', $item['tab'], $orders_base_url);
?>
<a class="uc-order-grid__item" href="<?php echo esc_url($item_url); ?>">
<span class="uc-order-grid__icon">
<i class="fas fa-<?php echo esc_attr((string) $item['icon']); ?>" aria-hidden="true"></i>
<?php if ($item['count'] > 0) : ?>
<small><?php echo esc_html($item['count'] > 99 ? '99+' : (string) $item['count']); ?></small>
<?php endif; ?>
</span>
<span><?php echo esc_html((string) $item['label']); ?></span>
</a>
<?php endforeach; ?>
</div>
<?php endforeach; ?>
</div>