feat(admin): unify native admin pages on a shared modern UI
Add NativeUi helper + native-ui.css (tokens mirror the SPA Naive UI theme) and move the pay center, orders, products, coupons, charge cards, income, withdrawals, tickets, invite codes, VIP, verify, messages and report/ban pages onto shared header, stat cards, cards, filters, badges and empty states. Remove inline styles and dead helpers; split PayChargeCards into sibling traits to stay under the file size limit. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
aa692f3c9f
commit
18951b01d6
29 files changed
+2503
-1593
No files matched your search
@@ -14,6 +14,17 @@ defined('ABSPATH') || exit;
|
||||
|
||||
trait UsersMenusInviteCode {
|
||||
|
||||
/** 页面专属样式(排序箭头 / 按钮组 / 字段行 / 复制提示),只在本页入队。 */
|
||||
public function enqueue_invite_assets(string $hook): void {
|
||||
if ($hook !== 'users_page_aksrt_invite_codes') {
|
||||
return;
|
||||
}
|
||||
$css = '/assets/css/admin/invite-codes.css';
|
||||
if (is_file(AKSRT_DIR . $css)) {
|
||||
wp_enqueue_style('aksrt-admin-invite-codes', AKSRT_URI . $css, [], (string) filemtime(AKSRT_DIR . $css));
|
||||
}
|
||||
}
|
||||
|
||||
public function render_invite_codes_page(): void {
|
||||
if (!current_user_can('edit_users')) {
|
||||
wp_die(esc_html__('您没有权限访问此页面。', 'aksrt'));
|
||||
@@ -27,11 +38,13 @@ trait UsersMenusInviteCode {
|
||||
}
|
||||
$nonce = wp_create_nonce('aksrt_invite_admin');
|
||||
|
||||
NativeUi::page_open('aksrt-inv-page');
|
||||
|
||||
// 功能未启用提示(置顶橙色提醒)。
|
||||
$settings = $service->registration_settings();
|
||||
if (empty($settings['enabled'])) {
|
||||
$settings_url = admin_url('admin.php?page=aksrt-settings');
|
||||
echo '<div class="notice notice-warning"><p style="color:#fb590a;">'
|
||||
echo '<div class="notice notice-warning"><p>'
|
||||
. esc_html__('注意:邀请码功能暂未启用。您可以在', 'aksrt')
|
||||
. ' <a href="' . esc_url($settings_url) . '">' . esc_html__('登录注册设置', 'aksrt') . '</a> '
|
||||
. esc_html__('中启用此功能', 'aksrt')
|
||||
@@ -46,43 +59,17 @@ trait UsersMenusInviteCode {
|
||||
echo '<div class="notice notice-' . esc_attr($inv_type) . ' is-dismissible"><h3>' . esc_html($inv_title) . '</h3>'
|
||||
. ($inv_msg !== '' ? '<p>' . esc_html($inv_msg) . '</p>' : '') . '</div>';
|
||||
}
|
||||
|
||||
if ($tab === '') {
|
||||
$this->render_invite_codes_list($service, $this_url, $nonce);
|
||||
} elseif ($tab === 'add') {
|
||||
$this->render_invite_codes_add($this_url, $nonce);
|
||||
} else {
|
||||
$this->render_invite_codes_export($this_url, $nonce);
|
||||
}
|
||||
|
||||
NativeUi::page_close();
|
||||
?>
|
||||
<div class="wrap aksrt-inv-page">
|
||||
<style>
|
||||
/* 排序箭头:默认弱化,悬停加强。 */
|
||||
.aksrt-inv-page .orderby-but { position: relative; display: inline-block; }
|
||||
.aksrt-inv-page .orderby-but > a { opacity: .4; position: absolute; transform: translateY(-3px); transition: .3s; }
|
||||
.aksrt-inv-page .orderby-but > a + a { transform: translateY(6px); }
|
||||
.aksrt-inv-page .orderby-but:hover a { opacity: .6; }
|
||||
.aksrt-inv-page .orderby-but > a:hover { opacity: 1; }
|
||||
/* 选项字段布局:左标题右控件,行间分隔线。 */
|
||||
.aksrt-inv-field { display: flex; align-items: flex-start; padding: 14px 0; border-bottom: 1px solid #f0f0f1; }
|
||||
.aksrt-inv-field > label { flex: 0 0 170px; font-weight: 600; padding-top: 4px; }
|
||||
.aksrt-inv-field > .aksrt-inv-control { flex: 1; }
|
||||
.aksrt-inv-field .description { display: block; margin-top: 4px; color: #646970; }
|
||||
.aksrt-inv-submessage { background: #fff8e5; border-left: 4px solid #ffb900; box-shadow: 0 1px 1px rgba(0,0,0,.08); padding: 10px 14px; margin: 12px 0; }
|
||||
.aksrt-inv-submessage li { list-style: disc; margin-left: 18px; }
|
||||
.aksrt-inv-btnset label { display: inline-block; margin-right: -1px; border: 1px solid #2271b1; background: #fff; padding: 4px 14px; cursor: pointer; }
|
||||
.aksrt-inv-btnset label:first-child { border-radius: 4px 0 0 4px; }
|
||||
.aksrt-inv-btnset label:last-child { border-radius: 0 4px 4px 0; }
|
||||
.aksrt-inv-btnset input { display: none; }
|
||||
.aksrt-inv-btnset label.on { background: #2271b1; color: #fff; }
|
||||
.aksrt-inv-switch { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
|
||||
.aksrt-inv-switch input { margin: 0; }
|
||||
.aksrt-inv-mini { width: 80px; }
|
||||
.aksrt-inv-submit { background: linear-gradient(135deg, #2f9bff, #2271b1) !important; border-color: #2271b1 !important; color: #fff !important; padding: 4px 24px !important; border-radius: 4px !important; }
|
||||
.aksrt-inv-code { cursor: pointer; }
|
||||
.aksrt-inv-toast { position: fixed; top: 42px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,.75); color: #fff; padding: 8px 22px; border-radius: 4px; font-size: 13px; display: none; z-index: 100100; }
|
||||
.aksrt-inv-unit { color: #646970; margin-left: 4px; }
|
||||
</style>
|
||||
<?php if ($tab === '') : ?>
|
||||
<?php $this->render_invite_codes_list($service, $this_url, $nonce); ?>
|
||||
<?php elseif ($tab === 'add') : ?>
|
||||
<?php $this->render_invite_codes_add($this_url, $nonce); ?>
|
||||
<?php else : ?>
|
||||
<?php $this->render_invite_codes_export($this_url, $nonce); ?>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="aksrt-inv-toast" id="aksrt-inv-toast"><?php esc_html_e('复制成功', 'aksrt'); ?></div>
|
||||
<script>
|
||||
(() => {
|
||||
@@ -142,35 +129,41 @@ trait UsersMenusInviteCode {
|
||||
'desc' => isset($_GET['desc']) ? sanitize_key((string) wp_unslash($_GET['desc'])) : '', // phpcs:ignore WordPress.Security.NonceVerification.Recommended
|
||||
]);
|
||||
|
||||
echo '<h1 class="wp-heading-inline">' . esc_html__('邀请码管理', 'aksrt') . '</h1>';
|
||||
echo '<a href="' . esc_url(add_query_arg('tab', 'add', $this_url)) . '" class="page-title-action">' . esc_html__('添加邀请码', 'aksrt') . '</a>';
|
||||
echo '<a href="' . esc_url(add_query_arg('tab', 'export', $this_url)) . '" class="page-title-action" style="margin-left:6px;">' . esc_html__('导出邀请码', 'aksrt') . '</a>';
|
||||
echo '<hr class="wp-header-end">';
|
||||
// 页头 + 三视图切换(WP 原生 page-title-action:列表 / 添加 / 导出)。
|
||||
NativeUi::header(
|
||||
__('邀请码管理', 'aksrt'),
|
||||
'',
|
||||
'dashicons-tickets-alt'
|
||||
);
|
||||
printf(
|
||||
'<div class="aksrt-inv-switch-views"><a href="%s" class="page-title-action">%s</a> <a href="%s" class="page-title-action">%s</a></div>',
|
||||
esc_url(add_query_arg('tab', 'add', $this_url)),
|
||||
esc_html__('添加邀请码', 'aksrt'),
|
||||
esc_url(add_query_arg('tab', 'export', $this_url)),
|
||||
esc_html__('导出邀请码', 'aksrt')
|
||||
);
|
||||
|
||||
// 顶部筛选行:左侧状态链接(搜索时改为提示语),右侧搜索表单。
|
||||
$search_html = '<div style="float:right;">
|
||||
<form method="get"><input type="hidden" name="page" value="aksrt_invite_codes">
|
||||
<input type="text" name="s" value="' . esc_attr($s) . '" placeholder="' . esc_attr__('搜索邀请码', 'aksrt') . '">
|
||||
<button type="submit" class="button">' . esc_html__('提交', 'aksrt') . '</button></form></div>';
|
||||
echo '<div style="margin:12px 0;min-height:32px;">';
|
||||
echo '<ul class="subsubsub" style="float:left;margin:0 0 8px;">';
|
||||
NativeUi::card_open('', '', false, 'aksrt-native-toolbar');
|
||||
if ($s !== '') {
|
||||
echo '<li style="display:inline-block;background:#fff8e5;border:1px solid #ffb900;padding:2px 10px;">'
|
||||
. esc_html(sprintf(__('搜索 “%s” 的内容', 'aksrt'), $s)) . '</li>';
|
||||
echo '<ul class="subsubsub"><li>' . esc_html(sprintf(__('搜索 “%s” 的内容', 'aksrt'), $s)) . '</li></ul>';
|
||||
} else {
|
||||
$links = [
|
||||
'all' => __('全部', 'aksrt'),
|
||||
'unused' => __('未使用', 'aksrt'),
|
||||
'used' => __('已使用', 'aksrt'),
|
||||
];
|
||||
$parts = [];
|
||||
echo '<ul class="subsubsub">';
|
||||
foreach ($links as $key => $label) {
|
||||
$url = $key === 'all' ? $this_url : add_query_arg('status', $key, $this_url);
|
||||
$parts[] = '<li><a href="' . esc_url($url) . '"' . ($key === $status ? ' style="font-weight:600;"' : '') . '>' . esc_html($label) . '</a></li>';
|
||||
echo '<li><a href="' . esc_url($url) . '"' . ($key === $status ? ' class="current"' : '') . '>' . esc_html($label) . '</a></li>';
|
||||
}
|
||||
echo implode(' | ', $parts); // phpcs:ignore WordPress.Security.EscapeOutput -- 各项均已转义。
|
||||
echo '</ul>';
|
||||
}
|
||||
echo '</ul>' . $search_html . '</div><div class="clear"></div>'; // phpcs:ignore WordPress.Security.EscapeOutput -- 静态结构。
|
||||
echo '<form method="get" class="aksrt-native-filters"><input type="hidden" name="page" value="aksrt_invite_codes">';
|
||||
echo '<input type="search" name="s" value="' . esc_attr($s) . '" placeholder="' . esc_attr__('搜索邀请码', 'aksrt') . '">';
|
||||
echo '<button type="submit" class="button">' . esc_html__('提交', 'aksrt') . '</button></form>';
|
||||
NativeUi::card_close();
|
||||
|
||||
// 可排序列:code / created_at / updated_at / used_count / remark。
|
||||
$columns = [
|
||||
@@ -185,16 +178,18 @@ trait UsersMenusInviteCode {
|
||||
echo '<form method="post" action="' . esc_url(admin_url('admin-post.php')) . '">';
|
||||
echo '<input type="hidden" name="action" value="aksrt_invite_delete">';
|
||||
echo '<input type="hidden" name="aksrt_nonce" value="' . esc_attr($nonce) . '">';
|
||||
echo '<div class="bulkactions" style="margin:10px 0;">
|
||||
|
||||
$bulk = '<div class="bulkactions aksrt-native-inline">
|
||||
<select name="bulk_action" id="bulk-action-selector-top">
|
||||
<option value="-1">' . esc_html__('批量操作', 'aksrt') . '</option>
|
||||
<option value="delete">' . esc_html__('删除', 'aksrt') . '</option>
|
||||
</select>
|
||||
<button type="submit" class="button action" onclick="return this.form.bulk_action.value===\'delete\'||confirm(' . wp_json_encode(__('请先选择“删除”操作', 'aksrt')) . ');">' . esc_html__('应用', 'aksrt') . '</button>
|
||||
<button type="submit" class="button action" onclick="return this.form.bulk_action.value===\'delete\'||confirm(' . esc_attr(wp_json_encode(__('请先选择“删除”操作', 'aksrt'))) . ');">' . esc_html__('应用', 'aksrt') . '</button>
|
||||
</div>';
|
||||
echo '<div style="overflow-y:auto;width:100%;">';
|
||||
echo '<table class="widefat fixed striped posts table table-bordered" style="min-width:1000px;"><thead><tr>';
|
||||
echo '<td id="cb" class="manage-column column-cb check-column" style="width:2%;"><input id="cb-select-all-1" type="checkbox" onclick="document.querySelectorAll(\'tbody [name="action_id[]"]\').forEach(c=>c.checked=this.checked)"></td>';
|
||||
|
||||
NativeUi::table_card_open(__('邀请码列表', 'aksrt'), $bulk); // phpcs:ignore WordPress.Security.EscapeOutput -- actions pre-escaped.
|
||||
echo '<table class="widefat fixed striped"><thead><tr>';
|
||||
echo '<td id="cb" class="manage-column column-cb check-column"><input id="cb-select-all-1" type="checkbox" onclick="document.querySelectorAll(\'tbody [name="action_id[]"]\').forEach(c=>c.checked=this.checked)"></td>';
|
||||
foreach ($columns as $column) {
|
||||
$arrows = '';
|
||||
if ($column['key'] !== '') {
|
||||
@@ -203,30 +198,30 @@ trait UsersMenusInviteCode {
|
||||
$arrows = '<span class="orderby-but"><a title="' . esc_attr__('降序', 'aksrt') . '" href="' . esc_url($down) . '"><span class="dashicons dashicons-arrow-up"></span></a>'
|
||||
. '<a title="' . esc_attr__('升序', 'aksrt') . '" href="' . esc_url($up) . '"><span class="dashicons dashicons-arrow-down"></span></a></span>';
|
||||
}
|
||||
echo '<th style="width:' . esc_attr($column['width']) . ';">' . esc_html($column['name']) . $arrows . '</th>'; // phpcs:ignore WordPress.Security.EscapeOutput -- 箭头为静态结构。
|
||||
echo '<th>' . esc_html($column['name']) . $arrows . '</th>'; // phpcs:ignore WordPress.Security.EscapeOutput -- 箭头为静态结构。
|
||||
}
|
||||
echo '</tr></thead><tbody>';
|
||||
|
||||
if ($data['items'] === []) {
|
||||
echo '<tr><td colspan="7" style="color:#ff4a4a;text-align:center;">' . esc_html__('未找到对应内容,或暂无内容', 'aksrt') . '</td></tr>';
|
||||
echo NativeUi::empty_row(7, __('未找到对应内容,或暂无内容', 'aksrt')); // phpcs:ignore WordPress.Security.EscapeOutput -- builder escapes.
|
||||
} else {
|
||||
foreach ($data['items'] as $item) {
|
||||
$used = (int) $item['used_count'];
|
||||
$max_uses = (int) $item['max_uses'];
|
||||
echo '<tr>';
|
||||
echo '<th scope="row" class="check-column"><input type="checkbox" name="action_id[]" value="' . esc_attr((string) $item['id']) . '"></th>';
|
||||
echo '<td><span class="aksrt-inv-code" data-clipboard-text="' . esc_attr($item['code']) . '" title="' . esc_attr__('点击复制', 'aksrt') . '">' . esc_html($item['code']) . '</span></td>';
|
||||
echo '<td><div style="font-size:12px;">' . wp_kses((string) $item['reward_text'], ['br' => []]) . '</div></td>';
|
||||
echo '<td><span class="aksrt-inv-code aksrt-native-mono" data-clipboard-text="' . esc_attr($item['code']) . '" title="' . esc_attr__('点击复制', 'aksrt') . '">' . esc_html($item['code']) . '</span></td>';
|
||||
echo '<td>' . wp_kses((string) $item['reward_text'], ['br' => []]) . '</td>';
|
||||
echo '<td>' . esc_html($item['created_at']) . '</td>';
|
||||
echo '<td>' . esc_html($item['updated_at']) . '</td>';
|
||||
if ($used === 0) {
|
||||
echo '<td><span style="color:#3d7ffd;">' . esc_html__('未使用', 'aksrt') . '</span></td>';
|
||||
echo '<td>' . NativeUi::badge(__('未使用', 'aksrt'), 'info') . '</td>'; // phpcs:ignore WordPress.Security.EscapeOutput -- builder escapes.
|
||||
} else {
|
||||
$label = $max_uses > 0 && $used < $max_uses ? sprintf(__('已使用 %1$d/%2$d', 'aksrt'), $used, $max_uses) : __('已使用', 'aksrt');
|
||||
echo '<td><span style="color:#f93b3b;">' . esc_html($label) . '</span>';
|
||||
echo '<td>' . NativeUi::badge($label, 'danger'); // phpcs:ignore WordPress.Security.EscapeOutput -- builder escapes.
|
||||
foreach ((array) $item['recent_users'] as $user) {
|
||||
$user_link = get_edit_user_link((int) $user['user_id']);
|
||||
echo '<br><a target="_blank" href="' . esc_url($user_link) . '">' . esc_html($user['name']) . '</a>';
|
||||
echo '<div class="aksrt-native-muted"><a target="_blank" href="' . esc_url($user_link) . '">' . esc_html($user['name']) . '</a></div>';
|
||||
}
|
||||
echo '</td>';
|
||||
}
|
||||
@@ -237,12 +232,13 @@ trait UsersMenusInviteCode {
|
||||
echo '</td></tr>';
|
||||
}
|
||||
}
|
||||
echo '</tbody></table></div></form><div class="clear"></div>';
|
||||
echo '</tbody></table>';
|
||||
NativeUi::table_wrap_close();
|
||||
|
||||
// 分页条:总数 + 页码链接。
|
||||
$total = (int) $data['total'];
|
||||
$max_pages = (int) $data['max_pages'];
|
||||
echo '<div class="tablenav bottom"><div class="tablenav-pages" style="display:flex;align-items:center;gap:6px;">';
|
||||
echo '<div class="tablenav bottom"><div class="tablenav-pages">';
|
||||
echo '<span class="displaying-num">' . esc_html(sprintf(__('共 %s 项', 'aksrt'), number_format_i18n($total))) . '</span>';
|
||||
if ($max_pages > 1) {
|
||||
echo paginate_links([
|
||||
@@ -256,19 +252,29 @@ trait UsersMenusInviteCode {
|
||||
]); // phpcs:ignore WordPress.Security.EscapeOutput -- paginate_links 自行转义。
|
||||
}
|
||||
echo '</div></div>';
|
||||
NativeUi::card_close();
|
||||
echo '</form>';
|
||||
}
|
||||
|
||||
/** 添加视图:系统自动生成 / 文本导入 二选一。 */
|
||||
private function render_invite_codes_add(string $this_url, string $nonce): void {
|
||||
echo '<h1 class="wp-heading-inline">' . esc_html__('添加邀请码', 'aksrt') . '</h1>';
|
||||
echo '<a href="' . esc_url($this_url) . '" class="page-title-action">' . esc_html__('返回列表', 'aksrt') . '</a>';
|
||||
echo '<hr class="wp-header-end">';
|
||||
NativeUi::header(
|
||||
__('添加邀请码', 'aksrt'),
|
||||
'',
|
||||
'dashicons-tickets-alt'
|
||||
);
|
||||
printf(
|
||||
'<div class="aksrt-inv-switch-views"><a href="%s" class="page-title-action"><span class="dashicons dashicons-arrow-left-alt" aria-hidden="true"></span>%s</a></div>',
|
||||
esc_url($this_url),
|
||||
esc_html__('返回列表', 'aksrt')
|
||||
);
|
||||
|
||||
echo '<form method="post" action="' . esc_url(admin_url('admin-post.php')) . '" style="max-width:860px;">';
|
||||
NativeUi::card_open(__('添加邀请码', 'aksrt'));
|
||||
echo '<form method="post" action="' . esc_url(admin_url('admin-post.php')) . '">';
|
||||
echo '<input type="hidden" name="action" value="aksrt_invite_add">';
|
||||
echo '<input type="hidden" name="aksrt_nonce" value="' . esc_attr($nonce) . '">';
|
||||
|
||||
echo '<div class="aksrt-inv-submessage"><p><b>' . esc_html__('在此添加邀请码', 'aksrt') . '</b></p><ul>'
|
||||
echo '<div class="aksrt-native-callout"><p><b>' . esc_html__('在此添加邀请码', 'aksrt') . '</b></p><ul>'
|
||||
. '<li>' . esc_html__('如果您已经准备好了邀请码资料,请选择导入的方式添加', 'aksrt') . '</li>'
|
||||
. '<li>' . esc_html__('您也可以采用系统生成的方式,自动批量添加邀请码', 'aksrt') . '</li></ul></div>';
|
||||
|
||||
@@ -297,7 +303,7 @@ trait UsersMenusInviteCode {
|
||||
|
||||
// 导入区。
|
||||
echo '<div data-aksrt-inv-dep="add_type=import" style="display:none;">';
|
||||
echo '<div class="aksrt-inv-submessage"><p><b>' . esc_html__('导入邀请码', 'aksrt') . '</b></p><ul>'
|
||||
echo '<div class="aksrt-native-callout"><p><b>' . esc_html__('导入邀请码', 'aksrt') . '</b></p><ul>'
|
||||
. '<li>' . esc_html__('一行一个邀请码,单行格式为:', 'aksrt') . '<code>' . esc_html__('邀请码 奖励 标识', 'aksrt') . '</code></li>'
|
||||
. '<li>' . esc_html__('邀请码、奖励、标识默认使用空格分割,您可以在下方自定义分割符号,与您的数据对应即可', 'aksrt') . '</li>'
|
||||
. '<li>' . esc_html__('奖励格式为:', 'aksrt') . '<code>level_integral=10&points=20&balance=30&vip=1&vip_time=5</code>,' . esc_html__('无需奖励填', 'aksrt') . ' <code>' . esc_html__('无', 'aksrt') . '</code></li>'
|
||||
@@ -308,31 +314,31 @@ trait UsersMenusInviteCode {
|
||||
. '<code>P86NPWKI points=10</code> ' . esc_html__('奖励10积分', 'aksrt') . '<br>'
|
||||
. '<code>auF9D2B4 balance=30&vip=1&vip_time=5</code> ' . esc_html__('奖励余额30和5天1级会员', 'aksrt') . '</p></div>';
|
||||
echo '<div class="aksrt-inv-field"><label for="aksrt-import-data">' . esc_html__('邀请码数据', 'aksrt') . '</label><div class="aksrt-inv-control">'
|
||||
. '<textarea id="aksrt-import-data" name="import_data" rows="10" class="large-text code" style="resize:both;"></textarea></div></div>';
|
||||
. '<textarea id="aksrt-import-data" name="import_data" rows="10" class="large-text code aksrt-inv-textarea"></textarea></div></div>';
|
||||
echo '<div class="aksrt-inv-field"><label for="aksrt-import-division">' . esc_html__('自定义分隔符号', 'aksrt') . '</label><div class="aksrt-inv-control">'
|
||||
. '<input type="text" id="aksrt-import-division" name="import_division" value=" " maxlength="4" class="aksrt-inv-mini">'
|
||||
. '<span class="description">' . esc_html__('邀请码和奖励之间分割符号(默认为空格分割)', 'aksrt') . '</span></div></div>';
|
||||
echo '</div>';
|
||||
|
||||
echo '<div class="aksrt-inv-field"><label></label><div class="aksrt-inv-control">'
|
||||
. '<button type="submit" class="button button-primary aksrt-inv-submit">' . esc_html__('确认提交', 'aksrt') . '</button></div></div>';
|
||||
. '<button type="submit" class="button button-primary">' . esc_html__('确认提交', 'aksrt') . '</button></div></div>';
|
||||
echo '</form>';
|
||||
NativeUi::card_close();
|
||||
}
|
||||
|
||||
/** 使用奖励字段集:经验值 / 积分 / 余额 / VIP 会员与赠送时长。 */
|
||||
private function render_invite_reward_fields(): void {
|
||||
echo '<div class="aksrt-inv-field"><label>' . esc_html__('使用奖励', 'aksrt') . '</label><div class="aksrt-inv-control">';
|
||||
echo '<div style="display:flex;flex-wrap:wrap;gap:12px;">'
|
||||
echo '<div class="aksrt-inv-rewards">'
|
||||
. '<span><label>' . esc_html__('经验值', 'aksrt') . ' <input type="number" name="level_integral" value="0" min="0" class="small-text"></label></span>'
|
||||
. '<span><label>' . esc_html__('积分', 'aksrt') . ' <input type="number" name="points" value="0" min="0" class="small-text"></label></span>'
|
||||
. '<span><label>' . esc_html__('余额', 'aksrt') . ' <input type="number" name="balance" value="0" min="0" step="0.01" class="small-text"> ' . esc_html__('元', 'aksrt') . '</label></span>'
|
||||
. '</div>';
|
||||
echo '<div style="margin-top:8px;"><label>' . esc_html__('VIP会员', 'aksrt') . ' '
|
||||
. '<label style="font-weight:400;margin:0 8px;"><input type="radio" name="vip" value="" checked>' . esc_html__('无', 'aksrt') . '</label>'
|
||||
. '<label style="font-weight:400;margin:0 8px;"><input type="radio" name="vip" value="1">' . esc_html__('一级', 'aksrt') . '</label>'
|
||||
. '<label style="font-weight:400;margin:0 8px;"><input type="radio" name="vip" value="2">' . esc_html__('二级', 'aksrt') . '</label>'
|
||||
echo '<div class="aksrt-inv-vip"><label>' . esc_html__('VIP会员', 'aksrt') . ' '
|
||||
. '<label class="aksrt-inv-radio"><input type="radio" name="vip" value="" checked>' . esc_html__('无', 'aksrt') . '</label>'
|
||||
. '<label class="aksrt-inv-radio"><input type="radio" name="vip" value="1">' . esc_html__('一级', 'aksrt') . '</label>'
|
||||
. '<label class="aksrt-inv-radio"><input type="radio" name="vip" value="2">' . esc_html__('二级', 'aksrt') . '</label>'
|
||||
. '</label></div>';
|
||||
echo '<div data-aksrt-inv-dep="vip=1" style="margin-top:8px;display:none;"><label>' . esc_html__('会员赠送时长', 'aksrt')
|
||||
echo '<div class="aksrt-inv-vip" data-aksrt-inv-dep="vip=1" style="display:none;"><label>' . esc_html__('会员赠送时长', 'aksrt')
|
||||
. ' <input type="number" name="vip_time" value="0" min="0" class="small-text"> <span class="aksrt-inv-unit">' . esc_html__('天', 'aksrt') . '</span></label>'
|
||||
. '<span class="description">' . esc_html__('仅在上方选择 VIP 会员等级后生效', 'aksrt') . '</span></div>';
|
||||
echo '</div></div>';
|
||||
@@ -340,22 +346,30 @@ trait UsersMenusInviteCode {
|
||||
|
||||
/** 导出视图:状态 / 格式 选择后提交下载。 */
|
||||
private function render_invite_codes_export(string $this_url, string $nonce): void {
|
||||
echo '<h1 class="wp-heading-inline">' . esc_html__('导出邀请码', 'aksrt') . '</h1>';
|
||||
echo '<a href="' . esc_url($this_url) . '" class="page-title-action">' . esc_html__('返回列表', 'aksrt') . '</a>';
|
||||
echo '<hr class="wp-header-end">';
|
||||
NativeUi::header(
|
||||
__('导出邀请码', 'aksrt'),
|
||||
'',
|
||||
'dashicons-download'
|
||||
);
|
||||
printf(
|
||||
'<div class="aksrt-inv-switch-views"><a href="%s" class="page-title-action"><span class="dashicons dashicons-arrow-left-alt" aria-hidden="true"></span>%s</a></div>',
|
||||
esc_url($this_url),
|
||||
esc_html__('返回列表', 'aksrt')
|
||||
);
|
||||
|
||||
echo '<form method="get" action="' . esc_url(admin_url('admin-post.php')) . '" style="max-width:860px;">';
|
||||
NativeUi::card_open();
|
||||
echo '<form method="get" action="' . esc_url(admin_url('admin-post.php')) . '">';
|
||||
echo '<input type="hidden" name="action" value="aksrt_invite_export">';
|
||||
echo '<input type="hidden" name="aksrt_nonce" value="' . esc_attr($nonce) . '">';
|
||||
|
||||
echo '<div class="aksrt-inv-field"><label>' . esc_html__('选择状态', 'aksrt') . '</label><div class="aksrt-inv-control">'
|
||||
. '<label style="font-weight:400;margin-right:16px;"><input type="radio" name="status" value="all" checked>' . esc_html__('全部', 'aksrt') . '</label>'
|
||||
. '<label style="font-weight:400;margin-right:16px;"><input type="radio" name="status" value="unused">' . esc_html__('未使用', 'aksrt') . '</label>'
|
||||
. '<label style="font-weight:400;margin-right:16px;"><input type="radio" name="status" value="used">' . esc_html__('已使用', 'aksrt') . '</label>'
|
||||
. '<label class="aksrt-inv-radio"><input type="radio" name="status" value="all" checked>' . esc_html__('全部', 'aksrt') . '</label>'
|
||||
. '<label class="aksrt-inv-radio"><input type="radio" name="status" value="unused">' . esc_html__('未使用', 'aksrt') . '</label>'
|
||||
. '<label class="aksrt-inv-radio"><input type="radio" name="status" value="used">' . esc_html__('已使用', 'aksrt') . '</label>'
|
||||
. '</div></div>';
|
||||
echo '<div class="aksrt-inv-field"><label>' . esc_html__('导出格式', 'aksrt') . '</label><div class="aksrt-inv-control">'
|
||||
. '<label style="font-weight:400;margin-right:16px;"><input type="radio" name="export_format" value="text">' . esc_html__('文本文档', 'aksrt') . '</label>'
|
||||
. '<label style="font-weight:400;margin-right:16px;"><input type="radio" name="export_format" value="xls" checked>' . esc_html__('Excel表格', 'aksrt') . '</label>'
|
||||
. '<label class="aksrt-inv-radio"><input type="radio" name="export_format" value="text">' . esc_html__('文本文档', 'aksrt') . '</label>'
|
||||
. '<label class="aksrt-inv-radio"><input type="radio" name="export_format" value="xls" checked>' . esc_html__('Excel表格', 'aksrt') . '</label>'
|
||||
. '</div></div>';
|
||||
echo '<div data-aksrt-inv-dep="export_format=text" style="display:none;">';
|
||||
echo '<div class="aksrt-inv-field"><label>' . esc_html__('分隔符号', 'aksrt') . '</label><div class="aksrt-inv-control">'
|
||||
@@ -363,7 +377,8 @@ trait UsersMenusInviteCode {
|
||||
. '<span class="description">' . esc_html__('邀请码和奖励之间分割符号(默认为空格分割)', 'aksrt') . '</span></div></div>';
|
||||
echo '</div>';
|
||||
echo '<div class="aksrt-inv-field"><label></label><div class="aksrt-inv-control">'
|
||||
. '<button type="submit" class="button button-primary aksrt-inv-submit">' . esc_html__('确认提交', 'aksrt') . '</button></div></div>';
|
||||
. '<button type="submit" class="button button-primary">' . esc_html__('确认提交', 'aksrt') . '</button></div></div>';
|
||||
echo '</form>';
|
||||
NativeUi::card_close();
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user