用户公开主页全局采用DOM无刷新加载

This commit is contained in:
kate522 committed 2026-08-23 14:55:24 +08:00
1 parent c3f66e9a14
commit bb9a410ad6
14 files changed
+569 -231

No files matched your search

@@ -0,0 +1,25 @@
<?php
/**
* Public user home — credits tab panel body (own profile only).
*
* Rendered inside the #panel-credits wrapper on the public user home. Static
* balance card; no pagination, no REST swapping needed.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
$args = is_array($args ?? null) ? $args : [];
extract($args, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
if (empty($credits_enabled) || empty($is_own_profile)) {
return;
}
?>
<div class="user-home-balance-card">
<p class="user-home-balance-card__label"><?php echo esc_html(sprintf(__('当前%s余额', 'aksrt'), $currency_name)); ?></p>
<div class="user-home-balance-card__value"><?php echo esc_html(aksrt_format_credits($credit_balance)); ?></div>
<p class="user-home-balance-card__hint"><?php esc_html_e('完整账单和赚取/消费记录请在用户中心查看。', 'aksrt'); ?></p>
<a href="<?php echo esc_url(aksrt_get_user_center_url('credits')); ?>" class="btn-outline btn-sm"><?php esc_html_e('进入用户中心', 'aksrt'); ?></a>
</div>