feat(users): separate revenue center cards
This commit is contained in:
@@ -1,4 +1,10 @@
|
||||
/* User-center revenue and invitation additions. */
|
||||
.uc-content .uc-revenue-card { margin: 0 0 24px; padding: 20px; border: 1px solid var(--color-line-soft, rgba(0,0,0,.06)); border-radius: 14px; background: var(--surface-1); }
|
||||
.uc-content .uc-revenue-card__header { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
|
||||
.uc-content .uc-revenue-card__icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #fff; background: #ce6b35; }
|
||||
.uc-content .uc-revenue-card__header p { margin: 0 0 2px; color: var(--color-ink-4); font-size: 12px; }
|
||||
.uc-content .uc-revenue-card__header h3 { margin: 0; color: var(--color-ink); font-size: 18px; }
|
||||
.uc-content .uc-revenue-card .aksrt-revenue-page__stats { margin-bottom: 18px; }
|
||||
.uc-content .uc-promotion-card { margin-top: 0; }
|
||||
.uc-content .uc-revenue-panel { padding: 4px 0; }
|
||||
.uc-content .uc-revenue-panel__header { margin-bottom: 20px; }
|
||||
.uc-content .uc-revenue-panel__header p { margin: 0 0 4px; color: var(--color-primary); font-size: 12px; font-weight: 700; }
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
?>
|
||||
<section class="uc-promotion-panel" aria-labelledby="uc-promotion-title" data-aksrt-invite>
|
||||
<section class="uc-promotion-panel uc-promotion-card" aria-labelledby="uc-promotion-title" data-aksrt-invite>
|
||||
<header class="uc-promotion-panel__header">
|
||||
<span class="uc-promotion-panel__icon"><i class="fas fa-user-plus" aria-hidden="true"></i></span>
|
||||
<div>
|
||||
|
||||
@@ -44,6 +44,14 @@ $revenue_url = static function (int $target_page): string {
|
||||
</header>
|
||||
|
||||
<?php if ($show_revenue_section) : ?>
|
||||
<section class="uc-revenue-card" aria-labelledby="uc-account-revenue-title">
|
||||
<header class="uc-revenue-card__header">
|
||||
<span class="uc-revenue-card__icon"><i class="fas fa-chart-line" aria-hidden="true"></i></span>
|
||||
<div>
|
||||
<p><?php esc_html_e('账户收益', 'aksrt'); ?></p>
|
||||
<h3 id="uc-account-revenue-title"><?php esc_html_e('收益与提现', 'aksrt'); ?></h3>
|
||||
</div>
|
||||
</header>
|
||||
<div class="aksrt-revenue-page__stats" aria-label="<?php esc_attr_e('收益概览', 'aksrt'); ?>">
|
||||
<div class="aksrt-revenue-page__stat-card"><div class="aksrt-revenue-page__stat-icon"><i class="fas fa-wallet" aria-hidden="true"></i></div><div class="aksrt-revenue-page__stat-info"><strong class="aksrt-revenue-page__stat-value" data-aksrt-revenue-balance>¥<?php echo esc_html(number_format_i18n((float) ($revenue_view['balance'] ?? 0), 2)); ?></strong><span class="aksrt-revenue-page__stat-label"><?php esc_html_e('可提现余额', 'aksrt'); ?></span></div></div>
|
||||
<div class="aksrt-revenue-page__stat-card"><div class="aksrt-revenue-page__stat-icon"><i class="fas fa-chart-line" aria-hidden="true"></i></div><div class="aksrt-revenue-page__stat-info"><strong class="aksrt-revenue-page__stat-value">¥<?php echo esc_html(number_format_i18n((float) ($revenue_view['total_earned'] ?? 0), 2)); ?></strong><span class="aksrt-revenue-page__stat-label"><?php esc_html_e('累计收益', 'aksrt'); ?></span></div></div>
|
||||
@@ -54,6 +62,7 @@ $revenue_url = static function (int $target_page): string {
|
||||
<section class="aksrt-revenue-page__panel"><h3><?php esc_html_e('提现记录', 'aksrt'); ?></h3><div class="aksrt-revenue-page__list" data-aksrt-withdraw-list><?php if ($withdrawals) : foreach ($withdrawals as $withdrawal) : ?><div class="aksrt-revenue-page__item"><div><strong>¥<?php echo esc_html(number_format_i18n((float) ($withdrawal['amount'] ?? 0), 2)); ?></strong><span><?php echo esc_html((string) ($withdrawal['method'] ?? '')); ?></span></div><div><span><?php echo esc_html((string) ($withdrawal['status'] ?? '')); ?></span><time><?php echo esc_html((string) ($withdrawal['created_at'] ?? '')); ?></time></div></div><?php endforeach; else : ?><p class="aksrt-revenue-page__empty"><?php esc_html_e('暂无提现记录', 'aksrt'); ?></p><?php endif; ?></div></section>
|
||||
</div>
|
||||
<section class="aksrt-revenue-page__section"><h3><?php esc_html_e('收益明细', 'aksrt'); ?></h3><?php if ($paged_records) : ?><div class="aksrt-revenue-page__list"><?php foreach ($paged_records as $record) : ?><div class="aksrt-revenue-page__item"><div><strong><?php echo esc_html((string) ($record['title'] ?? '')); ?></strong><time><?php echo esc_html((string) ($record['created_at'] ?? '')); ?></time></div><span class="<?php echo ($record['type'] ?? '') === 'withdrawal' ? 'is-out' : 'is-in'; ?>"><?php echo ($record['type'] ?? '') === 'withdrawal' ? '-' : '+'; ?>¥<?php echo esc_html(number_format_i18n((float) ($record['amount'] ?? 0), 2)); ?></span></div><?php endforeach; ?></div><?php if ($total_pages > 1) : ?><nav class="aksrt-revenue-page__pagination" aria-label="<?php esc_attr_e('收益分页', 'aksrt'); ?>"><?php for ($index = 1; $index <= $total_pages; $index++) : ?><a class="aksrt-revenue-page__page-chip<?php echo $index === $page ? ' is-active' : ''; ?>" href="<?php echo esc_url($revenue_url($index)); ?>"><?php echo esc_html((string) $index); ?></a><?php endfor; ?></nav><?php endif; ?><?php else : ?><p class="aksrt-revenue-page__empty"><?php esc_html_e('暂无收益明细', 'aksrt'); ?></p><?php endif; ?></section>
|
||||
</section>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($show_invite_section) : require __DIR__ . '/profile-invite.php'; endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user