refactor: drop order quick shortcuts, keep My Orders tile only
Per feedback the 待支付/售后 shortcut row is not wanted. Remove the nested quick grid, delete the now-orphaned sidebar-orders renderer, and strip its uc-order-grid CSS. 我的订单 remains a single tile in the 我的服务 grid.
This commit is contained in:
@@ -450,61 +450,6 @@ body.aksrt-user-center .uc-content,
|
||||
font-size: 11px;
|
||||
}
|
||||
|
||||
.uc-order-grid {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
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;
|
||||
align-items: center;
|
||||
gap: 7px;
|
||||
min-width: 0;
|
||||
padding: 5px 0 2px;
|
||||
color: var(--color-ink-3);
|
||||
font-size: 11px;
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
.uc-order-grid__item:hover {
|
||||
color: var(--color-primary);
|
||||
}
|
||||
|
||||
.uc-order-grid__icon {
|
||||
position: relative;
|
||||
display: grid;
|
||||
place-items: center;
|
||||
width: 38px;
|
||||
height: 38px;
|
||||
border-radius: 13px;
|
||||
background: color-mix(in srgb, var(--color-primary) 9%, var(--surface-2));
|
||||
color: var(--color-primary);
|
||||
font-size: 16px;
|
||||
transition: transform 0.2s ease, background-color 0.2s ease;
|
||||
}
|
||||
|
||||
.uc-order-grid__item:nth-child(2) .uc-order-grid__icon { color: #a56b10; background: rgba(245, 158, 11, 0.12); }
|
||||
.uc-order-grid__item:nth-child(3) .uc-order-grid__icon { color: #15806c; background: rgba(16, 185, 129, 0.12); }
|
||||
.uc-order-grid__item:nth-child(4) .uc-order-grid__icon { color: #7c4ed8; background: rgba(139, 92, 246, 0.12); }
|
||||
.uc-order-grid__item:nth-child(5) .uc-order-grid__icon { color: #d04b65; background: rgba(244, 63, 94, 0.11); }
|
||||
|
||||
.uc-order-grid__item:hover .uc-order-grid__icon {
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.uc-order-grid__icon small,
|
||||
.uc-service-grid__icon small {
|
||||
position: absolute;
|
||||
top: -5px;
|
||||
@@ -649,7 +594,3 @@ body.aksrt-user-center .uc-content,
|
||||
.uc-service-grid__item.is-active .uc-service-grid__icon {
|
||||
box-shadow: 0 0 0 2px var(--color-primary-soft), 0 5px 14px rgba(15, 23, 42, 0.08);
|
||||
}
|
||||
|
||||
@media (prefers-reduced-motion: reduce) {
|
||||
.uc-order-grid__icon { transition: none; }
|
||||
}
|
||||
|
||||
@@ -79,9 +79,6 @@ $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; ?>
|
||||
|
||||
|
||||
@@ -1,50 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* User center sidebar: task-oriented order shortcuts.
|
||||
*
|
||||
* Rendered inside the 我的服务 (My Services) section — see sidebar-nav.php.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
$orders_base_url = (string) ($orders_url ?? '');
|
||||
if ($orders_base_url === '') {
|
||||
return;
|
||||
}
|
||||
|
||||
$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_items = [
|
||||
[
|
||||
'label' => __('待支付', 'aksrt'),
|
||||
'icon' => 'wallet',
|
||||
'tab' => 'pending',
|
||||
'count' => (int) ($order_stats['pending'] ?? 0),
|
||||
],
|
||||
[
|
||||
'label' => __('售后', 'aksrt'),
|
||||
'icon' => 'undo-alt',
|
||||
'tab' => 'after',
|
||||
'count' => (int) ($order_stats['refunding'] ?? 0),
|
||||
],
|
||||
];
|
||||
?>
|
||||
<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>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
Reference in New Issue
Block a user