fix(frontend): keep asset and homepage filters in DOM

This commit is contained in:
kate522 committed 2026-09-03 19:21:24 +08:00
1 parent a0adddce59
commit 7308f055c7
23 files changed
+362 -305

No files matched your search

@@ -234,65 +234,5 @@ endif; ?>
<?php endif; ?>
<?php if (empty($skip_wallet_ledger)) : ?>
<div class="uc-transactions uc-transactions--wallet">
<div class="uc-transactions__header">
<h3 class="uc-transactions__title">
<i class="fa fas fa-list-ul" aria-hidden="true"></i>
<?php esc_html_e('余额记录', 'aksrt'); ?>
</h3>
</div>
<?php
$wallet_page = max(1, isset($_GET['wallet_page']) ? (int) $_GET['wallet_page'] : 1);
$wlog = \AKSRT\Ledger\LedgerQuery::get_instance()->history(['user_id' => (int) $user_id, 'asset' => 'balance', 'page' => $wallet_page, 'per_page' => 10]);
if (!empty($wlog['items'])) :
?>
<div class="uc-transactions__list">
<?php foreach ($wlog['items'] as $row) :
$delta = (int) $row['delta_minor'];
$delta_class = $delta >= 0 ? 'is-positive' : 'is-negative';
$delta_txt = ($delta > 0 ? '+' : '-') . \AKSRT\Ledger\AssetAmount::from_minor(\AKSRT\Ledger\AssetType::BALANCE, abs($delta))->formatted();
$record_note = in_array((string) $row['reason'], ['withdraw_hold', 'withdraw_refund'], true)
? (string) ($row['withdrawal_number'] ?? '')
: (string) ($row['remark'] ?? '');
?>
<div class="uc-transactions__item">
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
<i class="fa fas fa-<?php echo $delta >= 0 ? 'arrow-up' : 'arrow-down'; ?>" aria-hidden="true"></i>
</div>
<div class="uc-transactions__info">
<div class="uc-transactions__reason">
<?php echo esc_html(aksrt_asset_reason_label((string) $row['reason'])); ?>
<?php if ($record_note !== '') : ?>
<span class="uc-transactions__remark">(<?php echo esc_html($record_note); ?>)</span>
<?php endif; ?>
</div>
<div class="uc-transactions__time"><?php echo esc_html(get_date_from_gmt((string) $row['created_at'], 'Y-m-d H:i')); ?></div>
</div>
<div class="uc-transactions__amount">
<span class="uc-transactions__delta <?php echo esc_attr($delta_class); ?>"><?php echo esc_html($delta_txt); ?></span>
<span class="uc-transactions__balance">
<?php
printf(
esc_html__('余额 %s', 'aksrt'),
esc_html(\AKSRT\Ledger\AssetAmount::from_minor(\AKSRT\Ledger\AssetType::BALANCE, (int) $row['balance_after_minor'])->formatted())
);
?>
</span>
</div>
</div>
<?php endforeach; ?>
</div>
<?php
$total_pages = (int) ceil((int) ($wlog['total'] ?? 0) / 10);
if ($total_pages > 1 && function_exists('aksrt_render_profile_pagination')) {
aksrt_render_profile_pagination($total_pages, $wallet_page, 'wallet_page');
}
?>
<?php else : ?>
<div class="uc-transactions__empty">
<div class="uc-transactions__empty-icon"><i class="fa fas fa-money-bill" aria-hidden="true"></i></div>
<p><?php esc_html_e('还没有任何余额流水', 'aksrt'); ?></p>
</div>
<?php endif; ?>
</div>
<?php endif; // skip_wallet_ledger ?>
<?php require __DIR__ . '/credits-wallet-ledger.php'; ?>
<?php endif; ?>