Files
wordpress-theme-aksrt/inc/helpers/user-center-renderers/profile-invite.php
T
kate522 52ad9fbbd3 feat(user-center): redesign 推广中心 panel + extract promotion.css
Give the standalone promotion tab its own stylesheet and a task-priority
layout (成果概览 → 分享操作 → 奖励说明 → 邀请记录).

- assets/css/routes/user-center/promotion.css: new module owning all
  uc-promotion-* rules; flattens #panel-promotion chrome, adds focus-visible
  on the copy button + link input, and a ≤640px single-column layout with a
  full-width copy button (no horizontal overflow)
- user-center.css: import the new promotion.css
- user-center/revenue.css: drop the now-migrated uc-promotion-* rules (keep
  only the revenue-layout mobile rule)
- profile-invite.php: refresh doc header to describe the section priority
  order; copy button stays a focusable <button>, credits.js keeps text-based
  success/failure feedback via [data-invite-copy-feedback]
2026-08-05 17:26:56 +08:00

28 lines
4.2 KiB
PHP

<?php
/**
* User center promotion (invite) card.
*
* Rendered inside the standalone 推广中心 tab (profile-promotion.php).
* Section order follows the task priority: 成果概览 → 分享操作 → 奖励说明 → 邀请记录.
*
* @package AKSRT
*/
defined('ABSPATH') || exit;
?>
<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>
<p class="uc-promotion-panel__eyebrow"><?php esc_html_e('邀请与奖励', 'aksrt'); ?></p>
<h3 id="uc-promotion-title"><?php esc_html_e('推广奖励', 'aksrt'); ?></h3>
</div>
</header>
<p class="uc-promotion-panel__intro"><?php esc_html_e('分享专属链接,邀请好友完成注册与验证后即可获得奖励。', 'aksrt'); ?></p>
<p class="uc-promotion-panel__status" data-invite-status role="status" aria-live="polite"><?php esc_html_e('正在加载推广数据…', 'aksrt'); ?></p>
<section class="uc-promotion-section uc-promotion-section--stats" aria-labelledby="uc-promotion-stats-title"><div class="uc-promotion-section__header"><h4 id="uc-promotion-stats-title"><?php esc_html_e('推广成果', 'aksrt'); ?></h4><p><?php esc_html_e('实时汇总你的邀请进度', 'aksrt'); ?></p></div><div class="uc-promotion-stats" data-invite-stats aria-live="polite"><div class="uc-promotion-stat"><span><?php esc_html_e('已注册', 'aksrt'); ?></span><strong data-stat="registered">—</strong><small><?php esc_html_e('通过链接完成注册', 'aksrt'); ?></small></div><div class="uc-promotion-stat"><span><?php esc_html_e('已验证', 'aksrt'); ?></span><strong data-stat="verified">—</strong><small><?php esc_html_e('已完成邮箱验证', 'aksrt'); ?></small></div><div class="uc-promotion-stat"><span><?php esc_html_e('已奖励', 'aksrt'); ?></span><strong data-stat="rewarded">—</strong><small><?php esc_html_e('奖励已发放', 'aksrt'); ?></small></div></div></section>
<section class="uc-promotion-section uc-promotion-section--share" aria-labelledby="uc-promotion-share-title"><div class="uc-promotion-section__header"><h4 id="uc-promotion-share-title"><?php esc_html_e('分享专属链接', 'aksrt'); ?></h4><p><?php esc_html_e('好友通过此链接注册,邀请关系会自动记录。', 'aksrt'); ?></p></div><div class="uc-promotion-share"><div class="uc-promotion-code"><span><?php esc_html_e('我的邀请码', 'aksrt'); ?></span><strong data-invite-code>—</strong></div><label class="screen-reader-text" for="aksrt-invite-link"><?php esc_html_e('推广链接', 'aksrt'); ?></label><div class="uc-promotion-link-row"><input id="aksrt-invite-link" type="text" class="uc-promotion-link" data-invite-link readonly value=""><button type="button" class="btn-primary btn-sm uc-promotion-copy" data-invite-copy disabled><i class="fas fa-copy" aria-hidden="true"></i><span><?php esc_html_e('复制链接', 'aksrt'); ?></span></button></div><p class="uc-promotion-copy-feedback" data-invite-copy-feedback role="status" aria-live="polite"></p></div></section>
<section class="uc-promotion-section uc-promotion-section--reward" aria-labelledby="uc-promotion-reward-title"><div class="uc-promotion-section__header"><h4 id="uc-promotion-reward-title"><?php esc_html_e('奖励说明', 'aksrt'); ?></h4></div><p><?php echo esc_html(sprintf(__('邀请好友完成注册与邮箱验证后,双方将按站点规则获得%s奖励。', 'aksrt'), (string) ($currency_name ?? __('积分', 'aksrt')))); ?></p></section>
<section class="uc-promotion-section uc-promotion-section--records" aria-labelledby="uc-promotion-records-title"><div class="uc-promotion-section__header uc-promotion-records__header"><div><h4 id="uc-promotion-records-title"><?php esc_html_e('邀请记录', 'aksrt'); ?></h4><p><?php esc_html_e('查看最近邀请好友的状态', 'aksrt'); ?></p></div><span data-invite-total><?php esc_html_e('加载中…', 'aksrt'); ?></span></div><div class="uc-promotion-record-list is-loading" data-invite-list aria-live="polite"><div class="uc-promotion-record-empty"><?php esc_html_e('正在加载邀请记录…', 'aksrt'); ?></div></div></section>
</section>