refactor: rename the theme brand and every identifier from AKSRT to Jio

Full-project rename. `git grep -i aksrt` is now empty apart from the
DBMigrator 3.3.0 changelog note that documents the rename itself.

Code identifiers
- PHP namespace AKSRT\ -> Jio\ (composer PSR-4 + 378 declarations)
- global constants AKSRT_* -> JIO_* (VERSION/DIR/URI, PAY_TYPE_*, CAPTCHA_*)
- procedural functions, hooks, options, meta keys, table names,
  cookies, query vars, ajax actions and nonces: aksrt_ -> jio_
- text domain aksrt -> jio; Theme Name -> Jio
- JS globals: aksrtData/aksrtAdminData/... -> jioData/jioAdminData/...,
  window.AKSRTCaptcha & friends -> window.JioCaptcha, Aksrt* -> Jio*
- Vue components Aks*.vue -> Jio*.vue (15 files renamed + imports)
- CSS classes/data-attrs/custom properties: aksrt- -> jio-
- REST namespace aksrt/v1 -> jio/v1 (incl. payment gateway callbacks)

Storage layer
- DB tables {prefix}aksrt_* -> {prefix}jio_*; SCHEMA_VERSION 3.2.0 -> 3.3.0
  so dbDelta creates the new names on install
- widget id_base aksrt_widget_* -> jio_widget_*
- uninstall.php drop list rebuilt from the actual migrator tables
  (dropped 3 stale entries, added the 17 missing ones)

Removed
- hardcoded https://api.aksrt.com/version.json default update endpoint;
  get_endpoint() now reads the 「更新端点」 setting and do_check() no-ops
  when it is empty

Files renamed: inc/helpers/aksrt-*.php -> jio-*.php (54),
assets/admin/src/components/form/Aks*.vue -> Jio*.vue (15).
Build artifacts regenerated: assets/css/build, assets/js/runtime,
assets/admin/build.

Verified: audit-psr4-paths errors=0, audit-admin-contracts errors=0
(warnings=56, unchanged baseline), 813/813 widget-system tests,
44/44 phpunit, php -l clean across all PHP.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
kate522andClaude Opus 5 committed 2026-11-01 20:05:04 +08:00
1 parent 5b16bc6e15
commit 35bb96e82f
997 files changed
+28216 -28188

No files matched your search

@@ -9,28 +9,28 @@
* in on hover. The 推广海报 button lives in the revenue detail link row; the QR code
* is no longer rendered on its own — it exists only inside the generated poster.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!empty($GLOBALS['aksrt_affiliate_poster_modal_rendered'])) {
if (!empty($GLOBALS['jio_affiliate_poster_modal_rendered'])) {
return;
}
$GLOBALS['aksrt_affiliate_poster_modal_rendered'] = true;
$GLOBALS['jio_affiliate_poster_modal_rendered'] = true;
?>
<div class="modal fade flex jc" id="aksrt-affiliate-poster-modal" data-aksrt-affiliate-poster-modal tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal fade flex jc" id="jio-affiliate-poster-modal" data-jio-affiliate-poster-modal tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog poster-share hover-show" role="document">
<div class="modal-content" style="height:220px;overflow:hidden">
<div class="poster-imgbox hover-show" data-affiliate-poster-stage></div>
<div class="flex jc loading-mask absolute main-bg radius8" data-affiliate-poster-loading>
<div class="loading zts fa-2x"></div>
<div class="muted-2-color box-body"><?php esc_html_e('正在生成图片,请稍候...', 'aksrt'); ?></div>
<div class="muted-2-color box-body"><?php esc_html_e('正在生成图片,请稍候...', 'jio'); ?></div>
</div>
</div>
<div class="padding-6 abs-center hover-show-con text-center" style="top:auto">
<a href="javascript:;" class="but cir jb-blue poster-download hide" data-affiliate-poster-download aria-label="<?php esc_attr_e('保存海报', 'aksrt'); ?>"><i class="fas fa-download" aria-hidden="true"></i></a>
<button type="button" data-dismiss="modal" class="but cir jb-yellow ml10" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><svg aria-hidden="true" class="icon em12"><use xlink:href="#icon-close"></use></svg></button>
<a href="javascript:;" class="but cir jb-blue poster-download hide" data-affiliate-poster-download aria-label="<?php esc_attr_e('保存海报', 'jio'); ?>"><i class="fas fa-download" aria-hidden="true"></i></a>
<button type="button" data-dismiss="modal" class="but cir jb-yellow ml10" aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><svg aria-hidden="true" class="icon em12"><use xlink:href="#icon-close"></use></svg></button>
</div>
</div>
</div>
@@ -2,7 +2,7 @@
/**
* User center credits: points asset card + sign-in + credits card-pass.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -13,21 +13,21 @@ if (!$credits_enabled) {
return;
}
$all_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
$all_settings = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_all() : [];
$points_uid = (int) ($user_id ?? get_current_user_id());
$points_transfer_on = !empty($all_settings['points_transfer_s']);
if ($points_transfer_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('points_transfer', $points_uid)) {
if ($points_transfer_on && class_exists('\Jio\Settings\Capabilities') && !\Jio\Settings\Capabilities::user_can('points_transfer', $points_uid)) {
$points_transfer_on = false;
}
$points_transfer_min = max(1, (int) ($all_settings['points_transfer_min'] ?? 1));
$points_exchange = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_payment_recharge_settings()['points_exchange'] ?? [] : [];
$recharge = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_payment_recharge_settings() : [];
$points_exchange = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_payment_recharge_settings()['points_exchange'] ?? [] : [];
$recharge = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_payment_recharge_settings() : [];
$points_exchange_on = !empty($points_exchange['enabled']) && !empty($recharge['enabled']);
$currency = (string) ($currency_name ?? __('积分', 'aksrt'));
$currency = (string) ($currency_name ?? __('积分', 'jio'));
// 文案里的货币名统一走自定义名称(后台「积分配置 → 自定义货币名称」)。
$points_buy_label = sprintf(__('购买%s', 'aksrt'), $currency);
$points_earn_label = sprintf(__('做任务赚%s', 'aksrt'), $currency);
$points_signin_label = sprintf(__('签到领%s', 'aksrt'), $currency);
$points_buy_label = sprintf(__('购买%s', 'jio'), $currency);
$points_earn_label = sprintf(__('做任务赚%s', 'jio'), $currency);
$points_signin_label = sprintf(__('签到领%s', 'jio'), $currency);
?>
<div class="uc-asset-card uc-asset-card--points">
<div class="uc-asset-card__head flex jsb ac">
@@ -35,11 +35,11 @@ $points_signin_label = sprintf(__('签到领%s', 'aksrt'), $currency);
<i class="fa fas fa-money-bill em12 mr6" aria-hidden="true"></i><?php echo esc_html($currency); ?>
</div>
<?php if (!empty($signin_enabled)) : ?>
<span class="uc-asset-card__head-action muted-color px12" data-aksrt-signin>
<span class="uc-asset-card__head-action muted-color px12" data-jio-signin>
<?php if (!empty($signin_signed_today)) : ?>
<?php echo aksrt_get_user_checkin_details_link('uc-asset-card__signin muted-color px12', '<span>' . esc_html__('已签到', 'aksrt') . '</span><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php echo jio_get_user_checkin_details_link('uc-asset-card__signin muted-color px12', '<span>' . esc_html__('已签到', 'jio') . '</span><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<button type="button" class="uc-asset-card__signin muted-color px12" data-signin-btn data-signin-done-label="<?php esc_attr_e('已签到', 'aksrt'); ?>">
<button type="button" class="uc-asset-card__signin muted-color px12" data-signin-btn data-signin-done-label="<?php esc_attr_e('已签到', 'jio'); ?>">
<span data-signin-label><?php echo esc_html($points_signin_label); ?></span><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>
</button>
<?php endif; ?>
@@ -49,18 +49,18 @@ $points_signin_label = sprintf(__('签到领%s', 'aksrt'), $currency);
</div>
<div class="uc-asset-card__body flex jsb ac">
<div class="uc-asset-card__amount c-green">
<span class="uc-asset-card__value font-bold" data-aksrt-points-value data-credits-value title="<?php echo esc_attr(aksrt_format_points($balance)); ?>"><?php echo esc_html(aksrt_format_points($balance)); ?></span>
<span class="uc-asset-card__value font-bold" data-jio-points-value data-credits-value title="<?php echo esc_attr(jio_format_points($balance)); ?>"><?php echo esc_html(jio_format_points($balance)); ?></span>
</div>
<div class="uc-asset-card__actions flex0">
<?php if ($points_transfer_on) : ?>
<button type="button" class="but c-green mr6 hollow" data-aksrt-transfer-open="points" data-aksrt-transfer-min="<?php echo esc_attr((string) $points_transfer_min); ?>"><?php esc_html_e('转账', 'aksrt'); ?></button>
<button type="button" class="but c-green mr6 hollow" data-jio-transfer-open="points" data-jio-transfer-min="<?php echo esc_attr((string) $points_transfer_min); ?>"><?php esc_html_e('转账', 'jio'); ?></button>
<?php endif; ?>
<?php if ($points_exchange_on) : ?>
<button type="button" class="but c-green hollow" data-aksrt-points-pay-open><?php echo esc_html($points_buy_label); ?></button>
<button type="button" class="but c-green hollow" data-jio-points-pay-open><?php echo esc_html($points_buy_label); ?></button>
<?php endif; ?>
</div>
</div>
<button type="button" class="uc-asset-card__link muted-2-color em09" data-aksrt-asset-tab="points_free"><?php echo esc_html($points_earn_label); ?><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i></button>
<button type="button" class="uc-asset-card__link muted-2-color em09" data-jio-asset-tab="points_free"><?php echo esc_html($points_earn_label); ?><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i></button>
</div>
<?php if ($points_exchange_on) :
@@ -71,53 +71,53 @@ $points_signin_label = sprintf(__('签到领%s', 'aksrt'), $currency);
// 依赖 $pb_min_points / $pb_daily_max_points,必须排在它们赋值之后。
$points_limit_html = sprintf(
/* translators: 1: currency name, 2: minimum purchase, 3: currency name, 4: maximum purchase */
__('最低购买%2$s%1$s,最高购买%4$s%3$s', 'aksrt'),
__('最低购买%2$s%1$s,最高购买%4$s%3$s', 'jio'),
$currency,
$pb_min_points,
$currency,
$pb_daily_max_points
);
$points_packages = class_exists('\AKSRT\Credits\BalanceService')
? \AKSRT\Credits\BalanceService::get_instance()->parse_points_packages((string) ($points_exchange['products_raw'] ?? ''))
$points_packages = class_exists('\Jio\Credits\BalanceService')
? \Jio\Credits\BalanceService::get_instance()->parse_points_packages((string) ($points_exchange['products_raw'] ?? ''))
: [];
// 卡密兑换积分渠道(后台 启用卡密兑换积分功能)。
$points_card_pass = ['enabled' => false, 'desc' => '', 'only_password' => false];
if (class_exists('\AKSRT\Payment\ChargeCard')) {
$points_card_opts = \AKSRT\Payment\ChargeCard::get_instance()->get_public_options();
if (class_exists('\Jio\Payment\ChargeCard')) {
$points_card_opts = \Jio\Payment\ChargeCard::get_instance()->get_public_options();
$points_card_pass = is_array($points_card_opts['credits'] ?? null) ? $points_card_opts['credits'] : $points_card_pass;
}
$points_methods = [['id' => 'balance', 'name' => __('余额', 'aksrt')]];
$points_methods = [['id' => 'balance', 'name' => __('余额', 'jio')]];
if (!empty($points_card_pass['enabled'])) {
$points_methods[] = ['id' => 'card_pass', 'name' => __('卡密', 'aksrt')];
$points_methods[] = ['id' => 'card_pass', 'name' => __('卡密', 'jio')];
}
// 「收款接口显示顺序」:购买积分弹窗只含余额与卡密两个槽位。
if (function_exists('aksrt_sort_payment_methods')) {
$points_methods = aksrt_sort_payment_methods($points_methods);
if (function_exists('jio_sort_payment_methods')) {
$points_methods = jio_sort_payment_methods($points_methods);
}
$points_custom_limit_html = $points_limit_html;
$points_gateway = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_payment_gateway_settings() : [];
$points_gateway = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_payment_gateway_settings() : [];
$points_mark = (string) ($points_gateway['currency']['mark'] ?? '¥');
$points_default_product = $points_packages ? (string) $points_packages[0]['key'] : 'custom';
?>
<div class="modal flex jc fade" id="aksrt-points-pay-modal" tabindex="-1" role="dialog" data-aksrt-points-pay-modal>
<div class="modal flex jc fade" id="jio-points-pay-modal" tabindex="-1" role="dialog" data-jio-points-pay-modal>
<div class="modal-dialog modal-mini full-sm" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="mb10 touch"><button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button><b class="modal-title flex ac"><span class="mr6 em14"><i class="fa fas fa-coins" aria-hidden="true"></i></span><?php echo esc_html($points_buy_label); ?></b></div>
<form class="balance-charge-form mini-scrollbar scroll-y max-vh7" data-aksrt-points-pay-form>
<div class="mb10 touch"><button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button><b class="modal-title flex ac"><span class="mr6 em14"><i class="fa fas fa-coins" aria-hidden="true"></i></span><?php echo esc_html($points_buy_label); ?></b></div>
<form class="balance-charge-form mini-scrollbar scroll-y max-vh7" data-jio-points-pay-form>
<div class="charge-box mb20">
<?php if ($points_packages) : ?>
<div class="muted-color mb6"><?php printf(esc_html__('请选择需购买的%s', 'aksrt'), esc_html($currency)); ?></div>
<div class="muted-color mb6"><?php printf(esc_html__('请选择需购买的%s', 'jio'), esc_html($currency)); ?></div>
<?php foreach ($points_packages as $pidx => $ppkg) : ?>
<div class="zib-widget vip-product relative product-box<?php echo $pidx === 0 ? ' active' : ''; ?>" data-for="points_product" data-value="<?php echo esc_attr((string) $ppkg['key']); ?>">
<?php if (!empty($ppkg['tag'])) : ?>
<div class="abs-right vip-tag badg jb-yellow"><?php echo esc_html((string) $ppkg['tag']); ?></div>
<?php endif; ?>
<div class="em14"><span class="px12"><i class="fa fas fa-coins" aria-hidden="true"></i></span><?php echo esc_html(aksrt_format_points((int) $ppkg['points'])); ?></div>
<div class="em14"><span class="px12"><i class="fa fas fa-coins" aria-hidden="true"></i></span><?php echo esc_html(jio_format_points((int) $ppkg['points'])); ?></div>
<div class="c-red"><span class="px12"><?php echo esc_html($points_mark); ?></span><span class="em12"><?php echo esc_html((string) $ppkg['pay_price']); ?></span></div>
</div>
<?php endforeach; ?>
<div class="muted-color mt20 mb6"><?php printf(esc_html__('自定义%1$s数量(1%2$s=%3$s%1$s)', 'aksrt'), esc_html($currency), esc_html($points_mark), esc_html((string) $pb_rate)); ?></div>
<div class="muted-color mt20 mb6"><?php printf(esc_html__('自定义%1$s数量(1%2$s=%3$s%1$s)', 'jio'), esc_html($currency), esc_html($points_mark), esc_html((string) $pb_rate)); ?></div>
<div data-for="points_product" data-value="custom">
<div class="relative flex ab">
<span class="ml6 mr10 muted-color shrink0"><i class="fa fas fa-coins" aria-hidden="true"></i></span>
@@ -127,7 +127,7 @@ $points_signin_label = sprintf(__('签到领%s', 'aksrt'), $currency);
<div class="muted-2-color em09 mt6"><?php echo esc_html($points_custom_limit_html); ?></div>
</div>
<?php else : ?>
<div class="muted-color mb6"><?php printf(esc_html__('请输入需购买的%s数额', 'aksrt'), esc_html($currency)); ?></div>
<div class="muted-color mb6"><?php printf(esc_html__('请输入需购买的%s数额', 'jio'), esc_html($currency)); ?></div>
<div data-for="points_product" data-value="custom">
<div class="relative flex ab">
<span class="ml6 mr10 muted-color shrink0"><i class="fa fas fa-coins" aria-hidden="true"></i></span>
@@ -143,7 +143,7 @@ $points_signin_label = sprintf(__('签到领%s', 'aksrt'), $currency);
<?php endif; ?>
<div class="dependency-box">
<?php if (count($points_methods) > 1) : ?>
<div class="muted-2-color em09 mb6"><?php esc_html_e('请选择支付方式', 'aksrt'); ?></div>
<div class="muted-2-color em09 mb6"><?php esc_html_e('请选择支付方式', 'jio'); ?></div>
<div class="flex mb10">
<?php foreach ($points_methods as $pmi => $pm) :
$pm_id = (string) ($pm['id'] ?? '');
@@ -161,18 +161,18 @@ $points_signin_label = sprintf(__('签到领%s', 'aksrt'), $currency);
<?php if (!empty($points_card_pass['desc'])) : ?>
<div class="muted-box muted-2-color padding-10 mb10 em09"><?php echo esc_html((string) $points_card_pass['desc']); ?></div>
<?php endif; ?>
<div class="muted-2-color em09 mb6"><?php echo !empty($points_card_pass['only_password']) ? esc_html__('请输入卡密', 'aksrt') : esc_html__('请输入卡号和密码', 'aksrt'); ?></div>
<div class="muted-2-color em09 mb6"><?php echo !empty($points_card_pass['only_password']) ? esc_html__('请输入卡密', 'jio') : esc_html__('请输入卡号和密码', 'jio'); ?></div>
<?php if (empty($points_card_pass['only_password'])) : ?>
<div class="mb6"><input type="input" class="form-control" name="card_pass[card]" placeholder="<?php esc_attr_e('卡号', 'aksrt'); ?>" value=""></div>
<div class="mb6"><input type="input" class="form-control" name="card_pass[card]" placeholder="<?php esc_attr_e('卡号', 'jio'); ?>" value=""></div>
<?php endif; ?>
<div class="">
<input type="input" class="form-control" name="card_pass[password]" placeholder="<?php esc_attr_e('卡密', 'aksrt'); ?>" value="">
<input type="input" class="form-control" name="card_pass[password]" placeholder="<?php esc_attr_e('卡密', 'jio'); ?>" value="">
</div>
</div>
<?php endif; ?>
<input type="hidden" name="points_product" value="<?php echo esc_attr($points_default_product); ?>">
<input type="hidden" name="payment_method" value="<?php echo esc_attr((string) ($points_methods[0]['id'] ?? '')); ?>">
<button type="submit" class="mt6 but jb-red initiate-pay btn-block radius"><?php esc_html_e('立即支付', 'aksrt'); ?></button>
<button type="submit" class="mt6 but jb-red initiate-pay btn-block radius"><?php esc_html_e('立即支付', 'jio'); ?></button>
</div>
</form>
</div>
@@ -2,12 +2,12 @@
/**
* Free points tasks list + daily free detail (legacy points free tab).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
if (!class_exists('\AKSRT\Credits\PointsFree') || !\AKSRT\Credits\PointsFree::enabled()) {
if (!class_exists('\Jio\Credits\PointsFree') || !\Jio\Credits\PointsFree::enabled()) {
return;
}
@@ -16,23 +16,23 @@ if (!class_exists('\AKSRT\Credits\PointsFree') || !\AKSRT\Credits\PointsFree::en
*
* @return array{type:string,label:string,href?:string}
*/
$aksrt_points_task_action = static function (string $key): array {
$jio_points_task_action = static function (string $key): array {
$home = home_url('/');
$submit = '';
if (function_exists('aksrt_get_page_url_by_template')) {
$submit = (string) aksrt_get_page_url_by_template('templates/pages/page-submit.php');
if (function_exists('jio_get_page_url_by_template')) {
$submit = (string) jio_get_page_url_by_template('templates/pages/page-submit.php');
}
switch ($key) {
case 'sign_in':
return [
'type' => 'signin',
'label' => __('去签到', 'aksrt'),
'label' => __('去签到', 'jio'),
];
case 'post_new':
return [
'type' => 'link',
'label' => __('去完成', 'aksrt'),
'label' => __('去完成', 'jio'),
'href' => $submit !== '' ? $submit : $home,
];
case 'comment_new':
@@ -46,13 +46,13 @@ $aksrt_points_task_action = static function (string $key): array {
}
return [
'type' => 'link',
'label' => __('去完成', 'aksrt'),
'label' => __('去完成', 'jio'),
'href' => $href,
];
case 'login':
return [
'type' => 'none',
'label' => __('登录即可领取', 'aksrt'),
'label' => __('登录即可领取', 'jio'),
];
case 'post_like':
case 'post_favorite':
@@ -67,14 +67,14 @@ $aksrt_points_task_action = static function (string $key): array {
}
return [
'type' => 'link',
'label' => __('去看看', 'aksrt'),
'label' => __('去看看', 'jio'),
'href' => $href,
];
case 'followed':
$center = function_exists('aksrt_get_user_center_url') ? (string) aksrt_get_user_center_url() : $home;
$center = function_exists('jio_get_user_center_url') ? (string) jio_get_user_center_url() : $home;
return [
'type' => 'link',
'label' => __('去主页', 'aksrt'),
'label' => __('去主页', 'jio'),
'href' => $center !== '' ? $center : $home,
];
default:
@@ -83,21 +83,21 @@ $aksrt_points_task_action = static function (string $key): array {
};
$user_id = (int) ($user_id ?? get_current_user_id());
$today = \AKSRT\Credits\PointsFree::today_total($user_id);
$day_max = (int) \AKSRT\Credits\PointsFree::settings()['day_max'];
$tasks = \AKSRT\Credits\PointsFree::task_list_for_user($user_id);
$detail = \AKSRT\Credits\PointsFree::date_detail($user_id);
$today = \Jio\Credits\PointsFree::today_total($user_id);
$day_max = (int) \Jio\Credits\PointsFree::settings()['day_max'];
$tasks = \Jio\Credits\PointsFree::task_list_for_user($user_id);
$detail = \Jio\Credits\PointsFree::date_detail($user_id);
$pane = isset($points_tasks_pane) ? sanitize_key((string) $points_tasks_pane) : 'tasks';
// 文案里的货币名统一走自定义名称(后台「积分配置 → 自定义货币名称」)。
$currency = (string) ($currency_name ?? __('积分', 'aksrt'));
$currency = (string) ($currency_name ?? __('积分', 'jio'));
?>
<?php if ($pane === 'date') : ?>
<div class="uc-points-date">
<div class="flex jsb ac mb10">
<div class="font-bold"><?php printf(esc_html__('每日免费%s明细', 'aksrt'), esc_html($currency)); ?></div>
<button type="button" class="muted-2-color" data-aksrt-asset-tab="points_free">
<?php esc_html_e('返回任务', 'aksrt'); ?><i class="fa fas fa-angle-right ml6 em12" aria-hidden="true"></i>
<div class="font-bold"><?php printf(esc_html__('每日免费%s明细', 'jio'), esc_html($currency)); ?></div>
<button type="button" class="muted-2-color" data-jio-asset-tab="points_free">
<?php esc_html_e('返回任务', 'jio'); ?><i class="fa fas fa-angle-right ml6 em12" aria-hidden="true"></i>
</button>
</div>
<?php if ($detail) : ?>
@@ -108,7 +108,7 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
</div>
<?php endforeach; ?>
<?php else : ?>
<div class="uc-transactions__empty"><p><?php printf(esc_html__('暂无免费%s获取明细', 'aksrt'), esc_html($currency)); ?></p></div>
<div class="uc-transactions__empty"><p><?php printf(esc_html__('暂无免费%s获取明细', 'jio'), esc_html($currency)); ?></p></div>
<?php endif; ?>
</div>
<?php else : ?>
@@ -121,7 +121,7 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
<?php
printf(
/* translators: %s: points */
esc_html__('今日累计 %s', 'aksrt'),
esc_html__('今日累计 %s', 'jio'),
'<span class="focus-color">+' . esc_html((string) $today) . '</span>'
);
?>
@@ -130,18 +130,18 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
<?php
if ($day_max > 0) {
if ($today >= $day_max) {
printf(esc_html__('今日获取的免费%s已达到 %s,将不再获取', 'aksrt'), esc_html($currency), esc_html((string) $day_max));
printf(esc_html__('今日获取的免费%s已达到 %s,将不再获取', 'jio'), esc_html($currency), esc_html((string) $day_max));
} else {
printf(esc_html__('每日可免费获取 %1$s %2$s,超过后将不再获取', 'aksrt'), esc_html((string) $day_max), esc_html($currency));
printf(esc_html__('每日可免费获取 %1$s %2$s,超过后将不再获取', 'jio'), esc_html((string) $day_max), esc_html($currency));
}
} else {
printf(esc_html__('免费%s无每日上限', 'aksrt'), esc_html($currency));
printf(esc_html__('免费%s无每日上限', 'jio'), esc_html($currency));
}
?>
</div>
</div>
<button type="button" class="muted-2-color shrink0" data-aksrt-asset-tab="points_date">
<?php esc_html_e('每日详情', 'aksrt'); ?><i class="fa fas fa-angle-right ml6 em12" aria-hidden="true"></i>
<button type="button" class="muted-2-color shrink0" data-jio-asset-tab="points_date">
<?php esc_html_e('每日详情', 'jio'); ?><i class="fa fas fa-angle-right ml6 em12" aria-hidden="true"></i>
</button>
</div>
</div>
@@ -151,7 +151,7 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
<?php foreach ($tasks as $task) : ?>
<?php
$task_key = sanitize_key((string) ($task['key'] ?? ''));
$action = $aksrt_points_task_action($task_key);
$action = $jio_points_task_action($task_key);
$status = sanitize_key((string) ($task['status'] ?? 'todo'));
$done = in_array($status, ['done_today', 'done'], true);
?>
@@ -179,9 +179,9 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
<i class="fa fas fa-money-bill mr6 em09" aria-hidden="true"></i>+ <?php echo esc_html((string) (int) $task['points']); ?>
</div>
<?php if ($done) : ?>
<span class="uc-points-tasks__action muted-color em09 mt6"><?php esc_html_e('今日已完成', 'aksrt'); ?></span>
<span class="uc-points-tasks__action muted-color em09 mt6"><?php esc_html_e('今日已完成', 'jio'); ?></span>
<?php elseif (($action['type'] ?? 'none') === 'signin') : ?>
<button type="button" class="uc-points-tasks__action muted-color em09 mt6" data-aksrt-signin-goto>
<button type="button" class="uc-points-tasks__action muted-color em09 mt6" data-jio-signin-goto>
<?php echo esc_html((string) $action['label']); ?><i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>
</button>
<?php elseif (($action['type'] ?? 'none') === 'link' && !empty($action['href'])) : ?>
@@ -195,7 +195,7 @@ $currency = (string) ($currency_name ?? __('积分', 'aksrt'));
</div>
<?php endforeach; ?>
<?php else : ?>
<div class="uc-transactions__empty"><p><?php printf(esc_html__('暂无可用%s任务', 'aksrt'), esc_html($currency)); ?></p></div>
<div class="uc-transactions__empty"><p><?php printf(esc_html__('暂无可用%s任务', 'jio'), esc_html($currency)); ?></p></div>
<?php endif; ?>
</div>
<?php endif; ?>
@@ -4,7 +4,7 @@
*
* Expects extracted $context vars.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -13,7 +13,7 @@ defined('ABSPATH') || exit;
<div class="uc-transactions__header">
<h3 class="uc-transactions__title">
<i class="fa fas fa-list-ul" aria-hidden="true"></i>
<?php echo esc_html(sprintf(__('%s明细', 'aksrt'), $currency_name)); ?>
<?php echo esc_html(sprintf(__('%s明细', 'jio'), $currency_name)); ?>
</h3>
</div>
<?php
@@ -37,12 +37,12 @@ defined('ABSPATH') || exit;
</div>
<div class="uc-transactions__info">
<div class="uc-transactions__reason">
<?php echo esc_html((string) ($row['desc'] ?? '') !== '' ? (string) $row['desc'] : aksrt_asset_reason_label((string) ($row['type'] ?? ''))); ?>
<?php echo esc_html((string) ($row['desc'] ?? '') !== '' ? (string) $row['desc'] : jio_asset_reason_label((string) ($row['type'] ?? ''))); ?>
</div>
<div class="uc-transactions__time">
<?php echo esc_html((string) ($row['time'] ?? '')); ?>
</div>
<?php if (!empty($row['order_num'])) : ?><div class="muted-2-color em09"><?php echo esc_html__('订单号:', 'aksrt') . esc_html((string) $row['order_num']); ?></div><?php endif; ?>
<?php if (!empty($row['order_num'])) : ?><div class="muted-2-color em09"><?php echo esc_html__('订单号:', 'jio') . esc_html((string) $row['order_num']); ?></div><?php endif; ?>
</div>
<div class="uc-transactions__amount">
<span class="uc-transactions__delta <?php echo esc_attr($delta_class); ?>">
@@ -54,8 +54,8 @@ defined('ABSPATH') || exit;
</div>
<?php
$total_pages = (int) ceil(count($history) / 10);
if ($total_pages > 1 && function_exists('aksrt_render_asset_pagination')) {
aksrt_render_asset_pagination($total_pages, $credits_page, 'points');
if ($total_pages > 1 && function_exists('jio_render_asset_pagination')) {
jio_render_asset_pagination($total_pages, $credits_page, 'points');
}
?>
<?php else : ?>
@@ -63,7 +63,7 @@ defined('ABSPATH') || exit;
<div class="uc-transactions__empty-icon">
<i class="fa fas fa-file-alt" aria-hidden="true"></i>
</div>
<p><?php echo esc_html(sprintf(__('还没有任何%s记录', 'aksrt'), $currency_name)); ?></p>
<p><?php echo esc_html(sprintf(__('还没有任何%s记录', 'jio'), $currency_name)); ?></p>
</div>
<?php endif; ?>
</div>
@@ -4,7 +4,7 @@
*
* Expects extracted $context vars.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -21,17 +21,17 @@ $items = array_slice($history, ($wallet_page - 1) * 10, 10);
<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'); ?>
<?php esc_html_e('余额记录', 'jio'); ?>
</h3>
</div>
<?php if ($items) : ?>
<div class="uc-transactions__list">
<?php foreach ($items as $row) :
$raw_delta = (string) ($row['value'] ?? '0');
try { $delta_minor = \AKSRT\Ledger\AssetAmount::balance($raw_delta)->minor(); } catch (\InvalidArgumentException $e) { $delta_minor = 0; }
try { $delta_minor = \Jio\Ledger\AssetAmount::balance($raw_delta)->minor(); } catch (\InvalidArgumentException $e) { $delta_minor = 0; }
$delta = $delta_minor;
$delta_class = $delta >= 0 ? 'is-positive' : 'is-negative';
$delta_txt = ($delta > 0 ? '+' : ($delta < 0 ? '-' : '')) . \AKSRT\Ledger\AssetAmount::from_minor(\AKSRT\Ledger\AssetType::BALANCE, abs($delta))->formatted();
$delta_txt = ($delta > 0 ? '+' : ($delta < 0 ? '-' : '')) . \Jio\Ledger\AssetAmount::from_minor(\Jio\Ledger\AssetType::BALANCE, abs($delta))->formatted();
?>
<div class="uc-transactions__item">
<div class="uc-transactions__icon <?php echo esc_attr($delta_class); ?>">
@@ -39,10 +39,10 @@ $items = array_slice($history, ($wallet_page - 1) * 10, 10);
</div>
<div class="uc-transactions__info">
<div class="uc-transactions__reason">
<?php echo esc_html((string) ($row['desc'] ?? '') !== '' ? (string) $row['desc'] : aksrt_asset_reason_label((string) ($row['type'] ?? ''))); ?>
<?php echo esc_html((string) ($row['desc'] ?? '') !== '' ? (string) $row['desc'] : jio_asset_reason_label((string) ($row['type'] ?? ''))); ?>
</div>
<div class="uc-transactions__time"><?php echo esc_html((string) ($row['time'] ?? '')); ?></div>
<?php if (!empty($row['order_num'])) : ?><div class="muted-2-color em09"><?php echo esc_html__('订单号:', 'aksrt') . esc_html((string) $row['order_num']); ?></div><?php endif; ?>
<?php if (!empty($row['order_num'])) : ?><div class="muted-2-color em09"><?php echo esc_html__('订单号:', 'jio') . esc_html((string) $row['order_num']); ?></div><?php endif; ?>
</div>
<div class="uc-transactions__amount">
<span class="uc-transactions__delta <?php echo esc_attr($delta_class); ?>"><?php echo esc_html($delta_txt); ?></span>
@@ -52,13 +52,13 @@ $items = array_slice($history, ($wallet_page - 1) * 10, 10);
</div>
<?php
$total_pages = (int) ceil(count($history) / 10);
if ($total_pages > 1 && function_exists('aksrt_render_asset_pagination')) {
aksrt_render_asset_pagination($total_pages, $wallet_page, 'balance');
if ($total_pages > 1 && function_exists('jio_render_asset_pagination')) {
jio_render_asset_pagination($total_pages, $wallet_page, 'balance');
}
?>
<?php else : ?>
<div class="uc-transactions__empty">
<p><?php esc_html_e('还没有任何余额流水', 'aksrt'); ?></p>
<p><?php esc_html_e('还没有任何余额流水', 'jio'); ?></p>
</div>
<?php endif; ?>
</div>
@@ -4,7 +4,7 @@
*
* Expects extracted $context vars.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -13,49 +13,49 @@ if (empty($balance_enabled)) {
return;
}
$normalize_balance = static function ($value): \AKSRT\Ledger\AssetAmount {
$normalize_balance = static function ($value): \Jio\Ledger\AssetAmount {
try {
return \AKSRT\Ledger\AssetAmount::balance(is_string($value) ? $value : '');
return \Jio\Ledger\AssetAmount::balance(is_string($value) ? $value : '');
} catch (\InvalidArgumentException $e) {
return \AKSRT\Ledger\AssetAmount::balance('0');
return \Jio\Ledger\AssetAmount::balance('0');
}
};
$wallet = $normalize_balance($wallet_balance ?? '0');
$wallet_fmt = $wallet->formatted();
$recharge = class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_payment_recharge_settings')
? \AKSRT\Settings\Settings::get_payment_recharge_settings()
$recharge = class_exists('\Jio\Settings\Settings') && method_exists('\Jio\Settings\Settings', 'get_payment_recharge_settings')
? \Jio\Settings\Settings::get_payment_recharge_settings()
: [];
$uid = (int) ($user_id ?? get_current_user_id());
$transfer_on = !empty($recharge['transfer']['enabled']);
if ($transfer_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('balance_transfer', $uid)) {
if ($transfer_on && class_exists('\Jio\Settings\Capabilities') && !\Jio\Settings\Capabilities::user_can('balance_transfer', $uid)) {
$transfer_on = false;
}
$all_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
$all_settings = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_all() : [];
$withdraw_on = !empty($all_settings['pay_balance_withdraw_s']);
if ($withdraw_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('balance_withdraw', $uid)) {
if ($withdraw_on && class_exists('\Jio\Settings\Capabilities') && !\Jio\Settings\Capabilities::user_can('balance_withdraw', $uid)) {
$withdraw_on = false;
}
$withdraw_settings = class_exists('\\AKSRT\\Settings\\Settings') ? \AKSRT\Settings\Settings::get_withdrawal_settings() : [];
$withdraw_settings = class_exists('\\Jio\\Settings\\Settings') ? \Jio\Settings\Settings::get_withdrawal_settings() : [];
$withdraw_min = $normalize_balance($withdraw_settings['min_amount'] ?? '50')->decimal();
$withdraw_usage = ['remaining_count' => 0, 'remaining_amount' => '0.00'];
$withdraw_pending_hold = '0.00';
if ($withdraw_on && class_exists('\AKSRT\Payment\Withdrawal')) {
$wd_svc = \AKSRT\Payment\Withdrawal::get_instance();
if ($withdraw_on && class_exists('\Jio\Payment\Withdrawal')) {
$wd_svc = \Jio\Payment\Withdrawal::get_instance();
$withdraw_pending_hold = $wd_svc->sum_pending_hold((int) ($user_id ?? 0));
$withdraw_usage = $wd_svc->daily_usage((int) ($user_id ?? 0), $withdraw_settings);
}
// 卡密支付渠道(后台 余额充值 → 卡密兑换 → 启用卡密兑换余额功能):
// 兑换入口收敛到充值弹窗的支付方式,不再有独立入口。
$card_pass_redeem = ['enabled' => false, 'desc' => '', 'only_password' => false];
if (class_exists('\AKSRT\Payment\ChargeCard')) {
$card_opts = \AKSRT\Payment\ChargeCard::get_instance()->get_public_options();
if (class_exists('\Jio\Payment\ChargeCard')) {
$card_opts = \Jio\Payment\ChargeCard::get_instance()->get_public_options();
$card_pass_redeem = is_array($card_opts['balance'] ?? null) ? $card_opts['balance'] : $card_pass_redeem;
}
$charge_view = [];
if (class_exists('\AKSRT\Credits\BalanceService')) {
$charge_view = \AKSRT\Credits\BalanceService::get_instance()->get_charge_view((int) $user_id);
if (class_exists('\Jio\Credits\BalanceService')) {
$charge_view = \Jio\Credits\BalanceService::get_instance()->get_charge_view((int) $user_id);
}
$packages = is_array($charge_view['packages'] ?? null) ? $charge_view['packages'] : [];
$methods = is_array($charge_view['payment_methods'] ?? null) ? $charge_view['payment_methods'] : [];
@@ -66,11 +66,11 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
<div class="uc-asset-card uc-asset-card--wallet">
<div class="uc-asset-card__head flex jsb ac">
<div class="uc-asset-card__title">
<i class="fa fas fa-money-bill em12 mr6" aria-hidden="true"></i><?php esc_html_e('余额', 'aksrt'); ?>
<i class="fa fas fa-money-bill em12 mr6" aria-hidden="true"></i><?php esc_html_e('余额', 'jio'); ?>
</div>
<?php if ($withdraw_on) : ?>
<button type="button" class="uc-asset-card__head-action muted-color px12" data-aksrt-withdraw-history-open>
<?php esc_html_e('提现记录', 'aksrt'); ?>
<button type="button" class="uc-asset-card__head-action muted-color px12" data-jio-withdraw-history-open>
<?php esc_html_e('提现记录', 'jio'); ?>
<i class="fa fas fa-angle-right em12 ml3" aria-hidden="true"></i>
</button>
<?php endif; ?>
@@ -80,21 +80,21 @@ $mark = (string) ($charge_view['currency_mark'] ?? '元');
<?php if (!in_array($mark, ['', '元', '¥'], true)) : ?>
<span class="uc-asset-card__mark px12"><?php echo esc_html($mark); ?></span>
<?php endif; ?>
<span class="uc-asset-card__value font-bold" data-aksrt-wallet-value title="<?php echo esc_attr($wallet_fmt); ?>"><?php echo esc_html($wallet_fmt); ?></span>
<span class="uc-asset-card__value font-bold" data-jio-wallet-value title="<?php echo esc_attr($wallet_fmt); ?>"><?php echo esc_html($wallet_fmt); ?></span>
</div>
<div class="uc-asset-card__actions flex0">
<?php if ($transfer_on) : ?>
<button type="button" class="but c-blue-2 mr6 hollow" data-aksrt-transfer-open="balance"><?php esc_html_e('转账', 'aksrt'); ?></button>
<button type="button" class="but c-blue-2 mr6 hollow" data-jio-transfer-open="balance"><?php esc_html_e('转账', 'jio'); ?></button>
<?php endif; ?>
<?php if ($withdraw_on) : ?>
<button type="button" class="but c-blue-2 mr6 hollow" data-aksrt-withdraw-open><?php esc_html_e('提现', 'aksrt'); ?></button>
<button type="button" class="but c-blue-2 mr6 hollow" data-jio-withdraw-open><?php esc_html_e('提现', 'jio'); ?></button>
<?php endif; ?>
<button type="button" class="but b-blue-2" data-aksrt-charge-open><?php esc_html_e('充值', 'aksrt'); ?></button>
<button type="button" class="but b-blue-2" data-jio-charge-open><?php esc_html_e('充值', 'jio'); ?></button>
</div>
</div>
<?php if ($withdraw_on) : ?>
<div class="uc-asset-card__foot muted-2-color em09 mt6 flex jsb ac">
<span><?php printf(esc_html__('冻结中 %s', 'aksrt'), esc_html($normalize_balance($withdraw_pending_hold)->formatted())); ?></span>
<span><?php printf(esc_html__('冻结中 %s', 'jio'), esc_html($normalize_balance($withdraw_pending_hold)->formatted())); ?></span>
<span></span>
</div>
<?php endif; ?>
@@ -126,8 +126,8 @@ $charge_mark_html = $charge_mark_symbol
$charge_unit = $charge_mark_symbol ? '' : (string) $mark;
// 与 Zibll 格式对齐(mark 前缀:最低充值¥1);mark 配置为单位(元)时用后缀:最低充值1元。
$charge_limit_html = $charge_mark_symbol
? sprintf(__('最低充值%1$s1,最高充值%1$s%2$s', 'aksrt'), $mark, $custom_limit)
: sprintf(__('最低充值1%1$s,最高充值%2$s%1$s', 'aksrt'), $charge_unit, $custom_limit);
? sprintf(__('最低充值%1$s1,最高充值%1$s%2$s', 'jio'), $mark, $custom_limit)
: sprintf(__('最低充值1%1$s,最高充值%2$s%1$s', 'jio'), $charge_unit, $custom_limit);
$charge_custom_block = static function () use ($mark, $charge_mark_html, $charge_unit, $charge_limit_html, $custom_limit) {
?>
<div data-for="balance_product" data-value="custom">
@@ -141,16 +141,16 @@ $charge_custom_block = static function () use ($mark, $charge_mark_html, $charge
<?php
};
?>
<div class="modal flex jc fade" id="aksrt-balance-charge-modal" tabindex="-1" role="dialog" data-aksrt-charge-modal>
<div class="modal flex jc fade" id="jio-balance-charge-modal" tabindex="-1" role="dialog" data-jio-charge-modal>
<div class="modal-dialog modal-mini full-sm" role="document">
<div class="modal-content">
<div class="modal-body">
<div class="mb10 touch"><button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button><b class="modal-title flex ac"><span class="mr6 em14"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-money-color-2"></use></svg></span><?php esc_html_e('余额充值', 'aksrt'); ?></b></div>
<form class="balance-charge-form mini-scrollbar scroll-y max-vh7" data-aksrt-charge-form>
<div class="mb10 touch"><button type="button" class="close" data-dismiss="modal" aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><svg class="ic-close" aria-hidden="true"><use xlink:href="#icon-close"></use></svg></button><b class="modal-title flex ac"><span class="mr6 em14"><svg class="icon" aria-hidden="true"><use xlink:href="#icon-money-color-2"></use></svg></span><?php esc_html_e('余额充值', 'jio'); ?></b></div>
<form class="balance-charge-form mini-scrollbar scroll-y max-vh7" data-jio-charge-form>
<?php if (!$charge_card_only) : ?>
<?php if ($packages) : ?>
<div class="charge-box mb20">
<div class="muted-color mb6"><?php esc_html_e('请选择充值金额', 'aksrt'); ?></div>
<div class="muted-color mb6"><?php esc_html_e('请选择充值金额', 'jio'); ?></div>
<?php foreach ($packages as $idx => $pkg) :
$package_credit = $normalize_balance($pkg['price'] ?? '');
$package_pay = $normalize_balance($pkg['pay_price'] ?? '');
@@ -161,17 +161,17 @@ $charge_custom_block = static function () use ($mark, $charge_mark_html, $charge
<div class="abs-right vip-tag badg jb-yellow"><?php echo esc_html((string) $pkg['tag']); ?></div>
<?php endif; ?>
<div class="em14"><?php echo $charge_mark_html; // phpcs:ignore WordPress.Security.EscapeOutput -- escaped span + esc_html mark above ?><?php echo esc_html((string) $pkg['price']); ?></div>
<div class="c-red"><?php echo $charge_mark_html; // phpcs:ignore WordPress.Security.EscapeOutput ?><span><?php echo esc_html((string) $pkg['pay_price']); ?></span><?php if ($package_saving_minor > 0) : ?><span class="ml6 c-yellow smail"><?php printf(esc_html__('省%s', 'aksrt'), esc_html(\AKSRT\Ledger\AssetAmount::decimal_from_minor($package_saving_minor) . $charge_unit)); ?></span><?php endif; ?></div>
<div class="c-red"><?php echo $charge_mark_html; // phpcs:ignore WordPress.Security.EscapeOutput ?><span><?php echo esc_html((string) $pkg['pay_price']); ?></span><?php if ($package_saving_minor > 0) : ?><span class="ml6 c-yellow smail"><?php printf(esc_html__('省%s', 'jio'), esc_html(\Jio\Ledger\AssetAmount::decimal_from_minor($package_saving_minor) . $charge_unit)); ?></span><?php endif; ?></div>
</div>
<?php endforeach; ?>
<?php if ($custom_s) : ?>
<div class="muted-color mt20 mb6"><?php esc_html_e('自定义充值金额', 'aksrt'); ?></div>
<div class="muted-color mt20 mb6"><?php esc_html_e('自定义充值金额', 'jio'); ?></div>
<?php $charge_custom_block(); ?>
<?php endif; ?>
</div>
<?php elseif ($custom_s) : ?>
<div class="charge-box mb20">
<div class="muted-color mb6"><?php esc_html_e('请输入充值金额', 'aksrt'); ?></div>
<div class="muted-color mb6"><?php esc_html_e('请输入充值金额', 'jio'); ?></div>
<?php $charge_custom_block(); ?>
</div>
<?php endif; ?>
@@ -181,7 +181,7 @@ $charge_custom_block = static function () use ($mark, $charge_mark_html, $charge
<?php endif; ?>
<div class="dependency-box">
<?php if (count($methods) > 1) : ?>
<div class="muted-2-color em09 mb6"><?php esc_html_e('请选择支付方式', 'aksrt'); ?></div>
<div class="muted-2-color em09 mb6"><?php esc_html_e('请选择支付方式', 'jio'); ?></div>
<div class="flex mb10">
<?php foreach ($methods as $mi => $m) :
$method_id = (string) ($m['id'] ?? '');
@@ -201,21 +201,21 @@ $charge_custom_block = static function () use ($mark, $charge_mark_html, $charge
<?php if (!empty($card_pass_redeem['desc'])) : ?>
<div class="muted-box muted-2-color padding-10 mb10 em09"><?php echo esc_html((string) $card_pass_redeem['desc']); ?></div>
<?php endif; ?>
<div class="muted-2-color em09 mb6"><?php echo !empty($card_pass_redeem['only_password']) ? esc_html__('请输入卡密', 'aksrt') : esc_html__('请输入卡号和密码', 'aksrt'); ?></div>
<div class="muted-2-color em09 mb6"><?php echo !empty($card_pass_redeem['only_password']) ? esc_html__('请输入卡密', 'jio') : esc_html__('请输入卡号和密码', 'jio'); ?></div>
<?php if (empty($card_pass_redeem['only_password'])) : ?>
<div class="mb6"><input type="input" class="form-control" name="card_pass[card]" placeholder="<?php esc_attr_e('卡号', 'aksrt'); ?>" value=""></div>
<div class="mb6"><input type="input" class="form-control" name="card_pass[card]" placeholder="<?php esc_attr_e('卡号', 'jio'); ?>" value=""></div>
<?php endif; ?>
<div class="">
<input type="input" class="form-control" name="card_pass[password]" placeholder="<?php esc_attr_e('卡密', 'aksrt'); ?>" value="">
<input type="input" class="form-control" name="card_pass[password]" placeholder="<?php esc_attr_e('卡密', 'jio'); ?>" value="">
</div>
</div>
<?php endif; ?>
<input type="hidden" name="balance_product" value="<?php echo esc_attr($charge_default_product); ?>">
<input type="hidden" name="payment_method" value="<?php echo esc_attr((string) ($methods[0]['id'] ?? '')); ?>">
<?php if ($methods) : ?>
<button type="submit" class="mt6 but jb-red initiate-pay btn-block radius"><?php esc_html_e('立即支付', 'aksrt'); ?></button>
<button type="submit" class="mt6 but jb-red initiate-pay btn-block radius"><?php esc_html_e('立即支付', 'jio'); ?></button>
<?php else : ?>
<span class="badg px12 c-yellow-2"><?php esc_html_e('暂时无法支付,请与客服联系', 'aksrt'); ?></span>
<span class="badg px12 c-yellow-2"><?php esc_html_e('暂时无法支付,请与客服联系', 'jio'); ?></span>
<?php endif; ?>
</div>
</form>
@@ -225,7 +225,7 @@ $charge_custom_block = static function () use ($mark, $charge_mark_html, $charge
</div>
<?php if ($withdraw_on) :
$withdraw_modal_rendered = !empty($GLOBALS['aksrt_withdraw_modal_rendered']);
$withdraw_modal_rendered = !empty($GLOBALS['jio_withdraw_modal_rendered']);
if (!$withdraw_modal_rendered) {
require __DIR__ . '/withdraw-modal.php';
}
@@ -233,13 +233,13 @@ endif; ?>
<?php if ($withdraw_on) : ?>
<div class="uc-modal" id="aksrt-withdraw-history-modal" hidden data-aksrt-withdraw-history-modal>
<div class="uc-modal__overlay" data-aksrt-withdraw-history-close></div>
<div class="uc-modal__dialog uc-withdraw-history-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="aksrt-withdraw-history-title">
<button type="button" class="uc-modal__close" data-aksrt-withdraw-history-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
<h3 id="aksrt-withdraw-history-title" class="uc-modal__title"><i class="fa fas fa-file-alt mr6" aria-hidden="true"></i><?php esc_html_e('提现记录', 'aksrt'); ?></h3>
<div class="uc-withdraw-history" data-aksrt-withdraw-history-list aria-live="polite"></div>
<nav class="uc-withdraw-history__pagination" data-aksrt-withdraw-history-pagination aria-label="<?php esc_attr_e('提现记录分页', 'aksrt'); ?>"></nav>
<div class="uc-modal" id="jio-withdraw-history-modal" hidden data-jio-withdraw-history-modal>
<div class="uc-modal__overlay" data-jio-withdraw-history-close></div>
<div class="uc-modal__dialog uc-withdraw-history-modal__dialog" role="dialog" aria-modal="true" aria-labelledby="jio-withdraw-history-title">
<button type="button" class="uc-modal__close" data-jio-withdraw-history-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
<h3 id="jio-withdraw-history-title" class="uc-modal__title"><i class="fa fas fa-file-alt mr6" aria-hidden="true"></i><?php esc_html_e('提现记录', 'jio'); ?></h3>
<div class="uc-withdraw-history" data-jio-withdraw-history-list aria-live="polite"></div>
<nav class="uc-withdraw-history__pagination" data-jio-withdraw-history-pagination aria-label="<?php esc_attr_e('提现记录分页', 'jio'); ?>"></nav>
</div>
</div>
<?php endif; ?>
@@ -4,7 +4,7 @@
*
* Expects extracted $context vars.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -21,7 +21,7 @@ $ps_args = [
'update_post_term_cache' => true,
];
$q = new WP_Query($ps_args);
$front_submit = class_exists('\\AKSRT\\Core\\FrontSubmit') ? \AKSRT\Core\FrontSubmit::get_instance() : null;
$front_submit = class_exists('\\Jio\\Core\\FrontSubmit') ? \Jio\Core\FrontSubmit::get_instance() : null;
if ($q->have_posts()) :
?>
<div class="profile-list creator-center-post-list">
@@ -30,46 +30,46 @@ if ($q->have_posts()) :
$q->the_post();
$st = get_post_status();
$status_map = [
'publish' => __('已发布', 'aksrt'),
'draft' => __('草稿', 'aksrt'),
'pending' => __('待审', 'aksrt'),
'private' => __('私密', 'aksrt'),
'future' => __('定时', 'aksrt'),
'publish' => __('已发布', 'jio'),
'draft' => __('草稿', 'jio'),
'pending' => __('待审', 'jio'),
'private' => __('私密', 'jio'),
'future' => __('定时', 'jio'),
];
$status_label = $status_map[$st] ?? $st;
$can_delete = $front_submit && $front_submit->can_delete_post(get_the_ID(), (int) $user_id);
$edit_link = $front_submit && $front_submit->can_edit_post(get_the_ID(), (int) $user_id)
? aksrt_get_new_post_url(get_the_ID())
? jio_get_new_post_url(get_the_ID())
: '';
$view_link = get_permalink();
$action = $edit_link
? ['type' => 'edit', 'url' => $edit_link, 'label' => __('编辑', 'aksrt')]
: ('publish' === $st && $view_link ? ['type' => 'view', 'url' => $view_link, 'label' => __('预览', 'aksrt')] : []);
? ['type' => 'edit', 'url' => $edit_link, 'label' => __('编辑', 'jio')]
: ('publish' === $st && $view_link ? ['type' => 'view', 'url' => $view_link, 'label' => __('预览', 'jio')] : []);
get_template_part('templates/parts/content', 'profile-list-item', [
'action' => $action,
'status' => $status_label,
'delete_action' => [
'enabled' => $can_delete,
'nonce' => wp_create_nonce('aksrt_submit'),
'nonce' => wp_create_nonce('jio_submit'),
],
]);
endwhile;
?>
</div>
<?php
aksrt_render_profile_pagination(
jio_render_profile_pagination(
(int) $q->max_num_pages,
$posts_page,
'posts_page',
add_query_arg('post_status', $post_status_filter, aksrt_get_user_center_tab_url('posts'))
add_query_arg('post_status', $post_status_filter, jio_get_user_center_tab_url('posts'))
);
wp_reset_postdata();
else :
aksrt_render_profile_empty(
jio_render_profile_empty(
$svg_empty_post,
__('还没有文章', 'aksrt'),
__('试试发布你的第一篇文章吧。', 'aksrt'),
__('还没有文章', 'jio'),
__('试试发布你的第一篇文章吧。', 'jio'),
!empty($new_post_url) ? $new_post_url : '',
__('写文章', 'aksrt')
__('写文章', 'jio')
);
endif;
@@ -4,20 +4,20 @@
*
* Expects extracted $context vars.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$status_chip_defs = [
'publish' => __('已发布', 'aksrt'),
'draft' => __('草稿', 'aksrt'),
'pending' => __('待审', 'aksrt'),
'private' => __('私密', 'aksrt'),
'all' => __('全部', 'aksrt'),
'publish' => __('已发布', 'jio'),
'draft' => __('草稿', 'jio'),
'pending' => __('待审', 'jio'),
'private' => __('私密', 'jio'),
'all' => __('全部', 'jio'),
];
?>
<div class="profile-status-filter" role="tablist" aria-label="<?php esc_attr_e('文章状态筛选', 'aksrt'); ?>">
<div class="profile-status-filter" role="tablist" aria-label="<?php esc_attr_e('文章状态筛选', 'jio'); ?>">
<?php foreach ($status_chip_defs as $status_key => $status_text) :
$count_for_chip = ('all' === $status_key)
? $post_count
@@ -28,7 +28,7 @@ $status_chip_defs = [
$chip_url = add_query_arg([
'post_status' => $status_key,
'posts_page' => 1,
], aksrt_get_user_center_tab_url('posts'));
], jio_get_user_center_tab_url('posts'));
$chip_active = ($post_status_filter === $status_key);
?>
<a href="<?php echo esc_url($chip_url); ?>" class="profile-status-chip<?php echo $chip_active ? ' is-active' : ''; ?>" role="tab" aria-selected="<?php echo $chip_active ? 'true' : 'false'; ?>">
@@ -1,10 +1,10 @@
<?php
/** User center identity certification panel. @package AKSRT */
/** User center identity certification panel. @package Jio */
defined('ABSPATH') || exit;
use AKSRT\User\AuthApply;
use AKSRT\Identity\EvidenceService;
use Jio\User\AuthApply;
use Jio\Identity\EvidenceService;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
@@ -14,10 +14,10 @@ $info = is_array($snapshot['info'] ?? null) ? $snapshot['info'] : [];
$application = is_array($snapshot['application'] ?? null) ? $snapshot['application'] : [];
$status = (string) ($snapshot['status'] ?? '');
$can_apply = !empty($snapshot['can_apply']);
$auth_icon = function_exists('aksrt_icon_markup') ? aksrt_icon_markup('zibsvg-user-auth') : '<i class="fa fas fa-id-badge" aria-hidden="true"></i>';
$close_icon = function_exists('aksrt_icon_markup') ? aksrt_icon_markup('zibsvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$auth_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-user-auth') : '<i class="fa fas fa-id-badge" aria-hidden="true"></i>';
$close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$config = [
'restBase' => untrailingslashit(rest_url('aksrt/v1/identity/applications')),
'restBase' => untrailingslashit(rest_url('jio/v1/identity/applications')),
'nonce' => wp_create_nonce('wp_rest'),
];
?>
@@ -25,28 +25,28 @@ $config = [
<div class="colorful-make"></div>
<div class="text-center">
<div class="em4x"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<div class="mt10 em14 padding-w10 font-bold mb40"><?php echo esc_html(!empty($snapshot['verified']) ? __('我的认证信息', 'aksrt') : __('申请身份认证', 'aksrt')); ?></div>
<div class="mt10 em14 padding-w10 font-bold mb40"><?php echo esc_html(!empty($snapshot['verified']) ? __('我的认证信息', 'jio') : __('申请身份认证', 'jio')); ?></div>
<div class="text-left" data-auth-summary>
<?php if (!empty($snapshot['verified'])) : ?>
<div class="em12"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><b class="ml6"><?php echo esc_html((string) ($info['name'] ?? __('官方认证', 'aksrt'))); ?></b></div>
<div class="em12"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><b class="ml6"><?php echo esc_html((string) ($info['name'] ?? __('官方认证', 'jio'))); ?></b></div>
<?php if (!empty($info['desc'])) : ?><div class="muted-2-color mt10"><?php echo esc_html((string) $info['desc']); ?></div><?php endif; ?>
<?php if (!empty($info['time'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('认证时间:%s', 'aksrt'), esc_html((string) $info['time'])); ?></div><?php endif; ?>
<?php if (!empty($info['time'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('认证时间:%s', 'jio'), esc_html((string) $info['time'])); ?></div><?php endif; ?>
<?php elseif ($status === 'pending') : ?>
<div class="c-red mb10"><?php esc_html_e('您的申请正在审核中,请耐心等待', 'aksrt'); ?></div>
<div class="c-red mb10"><?php esc_html_e('您的申请正在审核中,请耐心等待', 'jio'); ?></div>
<div><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><b class="ml3"><?php echo esc_html((string) ($application['public_name'] ?? '')); ?></b></div>
<?php if (!empty($application['description'])) : ?><div class="muted-2-color mt10"><?php echo esc_html((string) $application['description']); ?></div><?php endif; ?>
<?php if (!empty($application['manual_reason'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('申请说明:%s', 'aksrt'), esc_html((string) $application['manual_reason'])); ?></div><?php endif; ?>
<?php if (!empty($application['created_at'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('申请时间:%s', 'aksrt'), esc_html((string) $application['created_at'])); ?></div><?php endif; ?>
<?php if (!empty($application['manual_reason'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('申请说明:%s', 'jio'), esc_html((string) $application['manual_reason'])); ?></div><?php endif; ?>
<?php if (!empty($application['created_at'])) : ?><div class="muted-2-color mt10"><?php printf(esc_html__('申请时间:%s', 'jio'), esc_html((string) $application['created_at'])); ?></div><?php endif; ?>
<?php $evidence_items = (new EvidenceService())->items($application); ?>
<?php if ($evidence_items) : ?><div class="mt20 flex" style="gap:8px;flex-wrap:wrap;"><?php foreach ($evidence_items as $item) : ?><a href="<?php echo esc_url($item['url']); ?>" target="_blank" rel="noopener noreferrer"><img src="<?php echo esc_url($item['thumbnail_url']); ?>" alt="<?php esc_attr_e('身份认证证明材料', 'aksrt'); ?>" style="width:64px;height:64px;object-fit:cover;border-radius:4px;"></a><?php endforeach; ?></div><?php endif; ?>
<?php if ($evidence_items) : ?><div class="mt20 flex" style="gap:8px;flex-wrap:wrap;"><?php foreach ($evidence_items as $item) : ?><a href="<?php echo esc_url($item['url']); ?>" target="_blank" rel="noopener noreferrer"><img src="<?php echo esc_url($item['thumbnail_url']); ?>" alt="<?php esc_attr_e('身份认证证明材料', 'jio'); ?>" style="width:64px;height:64px;object-fit:cover;border-radius:4px;"></a><?php endforeach; ?></div><?php endif; ?>
<?php else : ?>
<div class="em12 mb10"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><b class="ml6"><?php esc_html_e('申请认证', 'aksrt'); ?></b></div>
<div class="em12 mb10"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?><b class="ml6"><?php esc_html_e('申请认证', 'jio'); ?></b></div>
<?php if ($can_apply && !empty($settings['desc'])) : ?><div class="muted-color mb20 uc-auth-intro"><?php echo wp_kses_post((string) $settings['desc']); ?></div><?php endif; ?>
<?php if ($can_apply) : ?>
<button type="button" class="but jb-blue padding-lg btn-block mt20" data-auth-modal-open><?php esc_html_e('申请认证', 'aksrt'); ?></button>
<button type="button" class="but jb-blue padding-lg btn-block mt20" data-auth-modal-open><?php esc_html_e('申请认证', 'jio'); ?></button>
<?php else : ?>
<div class="c-red"><i class="fa mr6 fa-info-circle" aria-hidden="true"></i><?php esc_html_e('抱歉!暂时不能申请身份认证', 'aksrt'); ?></div>
<?php if (empty($settings['allow_apply']) && !empty($settings['disable_desc'])) : ?><div class="muted-color mt20"><?php echo nl2br(esc_html((string) $settings['disable_desc'])); ?></div><?php elseif (empty($snapshot['level_ok']) && !empty($snapshot['minimum_level'])) : ?><div class="muted-color mt20"><?php printf(esc_html__('由于您的等级较低,暂时无法申请身份认证,请升级到 %s 之后再来申请。', 'aksrt'), esc_html(\AKSRT\User\Level::get_level_name((int) $snapshot['minimum_level']))); ?></div><?php endif; ?>
<div class="c-red"><i class="fa mr6 fa-info-circle" aria-hidden="true"></i><?php esc_html_e('抱歉!暂时不能申请身份认证', 'jio'); ?></div>
<?php if (empty($settings['allow_apply']) && !empty($settings['disable_desc'])) : ?><div class="muted-color mt20"><?php echo nl2br(esc_html((string) $settings['disable_desc'])); ?></div><?php elseif (empty($snapshot['level_ok']) && !empty($snapshot['minimum_level'])) : ?><div class="muted-color mt20"><?php printf(esc_html__('由于您的等级较低,暂时无法申请身份认证,请升级到 %s 之后再来申请。', 'jio'), esc_html(\Jio\User\Level::get_level_name((int) $snapshot['minimum_level']))); ?></div><?php endif; ?>
<?php endif; ?>
<?php endif; ?>
</div>
@@ -56,32 +56,32 @@ $config = [
<template data-auth-modal-template>
<div class="uc-auth-modal">
<div class="modal-colorful-header colorful-bg c-blue uc-auth-modal__header">
<button type="button" class="close uc-auth-modal__close" data-aksrt-modal-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><?php echo $close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button>
<button type="button" class="close uc-auth-modal__close" data-jio-modal-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><?php echo $close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button>
<div class="colorful-make"></div>
<div class="text-center">
<div class="em2x"><?php echo $auth_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<div class="mt10 em12 padding-w10" id="uc-auth-modal-title"><?php esc_html_e('申请身份认证', 'aksrt'); ?></div>
<div class="mt10 em12 padding-w10" id="uc-auth-modal-title"><?php esc_html_e('申请身份认证', 'jio'); ?></div>
</div>
</div>
<div class="uc-auth-modal__body">
<form class="auth-apply-from form-upload uc-auth-form" data-auth-create enctype="multipart/form-data" novalidate>
<div class="uc-auth-form__scroll mini-scrollbar scroll-y max-vh5" style="padding: 0 3px;">
<?php if (!empty($settings['desc'])) : ?><div class="muted-color mb20 uc-auth-intro"><?php echo wp_kses_post((string) $settings['desc']); ?></div><?php endif; ?>
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('认证身份', 'aksrt'); ?></span><input class="form-control" name="name" minlength="4" maxlength="16" required placeholder="<?php esc_attr_e('请输入身份名称', 'aksrt'); ?>"></label>
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('身份简介', 'aksrt'); ?></span><textarea class="form-control" name="description" rows="2" placeholder="<?php esc_attr_e('请输入申请的身份简介', 'aksrt'); ?>"></textarea></label>
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('申请说明', 'aksrt'); ?></span><textarea class="form-control" name="message" rows="2" placeholder="<?php esc_attr_e('请输入申请缘由及说明', 'aksrt'); ?>"></textarea></label>
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('认证身份', 'jio'); ?></span><input class="form-control" name="name" minlength="4" maxlength="16" required placeholder="<?php esc_attr_e('请输入身份名称', 'jio'); ?>"></label>
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('身份简介', 'jio'); ?></span><textarea class="form-control" name="description" rows="2" placeholder="<?php esc_attr_e('请输入申请的身份简介', 'jio'); ?>"></textarea></label>
<label class="uc-auth-field mb20"><span class="uc-auth-field__label"><?php esc_html_e('申请说明', 'jio'); ?></span><textarea class="form-control" name="message" rows="2" placeholder="<?php esc_attr_e('请输入申请缘由及说明', 'jio'); ?>"></textarea></label>
<div class="form-upload mb10 uc-auth-upload">
<div class="em09 muted-2-color mb6"><?php esc_html_e('证明材料', 'aksrt'); ?></div>
<div class="em09 muted-2-color mb6"><?php esc_html_e('证明材料', 'jio'); ?></div>
<div class="preview" data-auth-preview>
<button type="button" class="add" data-auth-file-picker aria-label="<?php esc_attr_e('选择证明材料图片', 'aksrt'); ?>"></button>
<button type="button" class="add" data-auth-file-picker aria-label="<?php esc_attr_e('选择证明材料图片', 'jio'); ?>"></button>
</div>
<input class="hide" type="file" data-auth-evidence accept="image/gif,image/jpeg,image/png,image/webp" multiple>
<div class="muted-2-color em09 mt6"><?php esc_html_e('最多上传 3 张图片,单张不超过 2MB。材料仅本人和认证审核管理员可查看。', 'aksrt'); ?></div>
<div class="muted-2-color em09 mt6"><?php esc_html_e('最多上传 3 张图片,单张不超过 2MB。材料仅本人和认证审核管理员可查看。', 'jio'); ?></div>
</div>
</div>
<div class="but-average modal-buts uc-auth-modal__footer">
<button type="button" class="but" data-aksrt-modal-close><?php esc_html_e('取消', 'aksrt'); ?></button>
<button type="submit" class="but c-blue"><i class="fa fas fa-check mr6" aria-hidden="true"></i><?php esc_html_e('确认提交', 'aksrt'); ?></button>
<button type="button" class="but" data-jio-modal-close><?php esc_html_e('取消', 'jio'); ?></button>
<button type="submit" class="but c-blue"><i class="fa fas fa-check mr6" aria-hidden="true"></i><?php esc_html_e('确认提交', 'jio'); ?></button>
</div>
</form>
</div>
@@ -2,7 +2,7 @@
/**
* User center profile comments part.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -13,7 +13,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
<div class="widget-card">
<div class="profile-list-header">
<h3 class="widget-title widget-title--inline">
<?php printf(esc_html__('我的评论(%d 条)', 'aksrt'), $comment_count); ?>
<?php printf(esc_html__('我的评论(%d 条)', 'jio'), $comment_count); ?>
</h3>
</div>
<?php
@@ -37,12 +37,12 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
</div>
<?php
$comments_total_pages = (int) ceil($comment_count / $per_page);
aksrt_render_profile_pagination($comments_total_pages, $comments_page, 'comments_page');
jio_render_profile_pagination($comments_total_pages, $comments_page, 'comments_page');
else :
aksrt_render_profile_empty(
jio_render_profile_empty(
$svg_empty_comment,
__('暂无评论', 'aksrt'),
__('在你感兴趣的文章下留下你的看法吧。', 'aksrt')
__('暂无评论', 'jio'),
__('在你感兴趣的文章下留下你的看法吧。', 'jio')
);
endif;
?>
@@ -2,7 +2,7 @@
/**
* User center creator income panel.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -10,27 +10,27 @@ defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
if ($user_id <= 0) {
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'aksrt') . '</div>';
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'jio') . '</div>';
return;
}
$settings = class_exists('\\AKSRT\\Settings\\Settings')
? \AKSRT\Settings\Settings::get_payment_revenue_settings()
$settings = class_exists('\\Jio\\Settings\\Settings')
? \Jio\Settings\Settings::get_payment_revenue_settings()
: [];
if (empty($settings['enabled'])) {
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('创作收益功能暂未开启。', 'aksrt') . '</div>';
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('创作收益功能暂未开启。', 'jio') . '</div>';
return;
}
$request = is_array($context['creator_income_request'] ?? null) ? $context['creator_income_request'] : [];
$page = max(1, min(100, (int) ($request['page'] ?? ($_GET['income_page'] ?? 1))));
$view = class_exists('\\AKSRT\\Payment\\Revenue')
? \AKSRT\Payment\Revenue::get_instance()->get_user_income_view($user_id, ['page' => $page])
$view = class_exists('\\Jio\\Payment\\Revenue')
? \Jio\Payment\Revenue::get_instance()->get_user_income_view($user_id, ['page' => $page])
: ['stats' => [], 'items' => [], 'total' => 0, 'max_pages' => 1, 'page' => 1];
$stats = (array) ($view['stats'] ?? []);
$items = (array) ($view['items'] ?? []);
$base_url = function_exists('aksrt_get_user_center_tab_url')
? aksrt_get_user_center_tab_url('creator')
$base_url = function_exists('jio_get_user_center_tab_url')
? jio_get_user_center_tab_url('creator')
: home_url('/profile/?tab=creator');
$page_url = static function (int $target_page) use ($base_url): string {
return add_query_arg(
@@ -40,39 +40,39 @@ $page_url = static function (int $target_page) use ($base_url): string {
};
$format = static function ($amount, string $unit): string {
if ($unit === 'points') {
return aksrt_format_points(max(0, (int) $amount));
return jio_format_points(max(0, (int) $amount));
}
try {
return \AKSRT\Ledger\AssetAmount::balance(is_string($amount) ? $amount : '')->formatted();
return \Jio\Ledger\AssetAmount::balance(is_string($amount) ? $amount : '')->formatted();
} catch (\InvalidArgumentException $e) {
return '0.00';
}
};
$note = trim((string) ($settings['note'] ?? ''));
if ($note === '') {
$note = __('<p>订单完成并经过结算周期后,作者分成会自动转入对应的钱包。</p>', 'aksrt');
$note = __('<p>订单完成并经过结算周期后,作者分成会自动转入对应的钱包。</p>', 'jio');
}
$status_labels = [
'pending' => __('待结算', 'aksrt'),
'settled' => __('已结算', 'aksrt'),
'pending' => __('待结算', 'jio'),
'settled' => __('已结算', 'jio'),
];
// 收益单位名跟随自定义货币名称(后台「积分配置 → 自定义货币名称」)。
$currency_name = class_exists('\\AKSRT\\Settings\\Settings')
? \AKSRT\Settings\Settings::get_currency_name()
: __('积分', 'aksrt');
$points_income_label = sprintf(__('%s收益', 'aksrt'), $currency_name);
$currency_name = class_exists('\\Jio\\Settings\\Settings')
? \Jio\Settings\Settings::get_currency_name()
: __('积分', 'jio');
$points_income_label = sprintf(__('%s收益', 'jio'), $currency_name);
$currency_labels = [
'CNY' => __('现金收益', 'aksrt'),
'CNY' => __('现金收益', 'jio'),
'points' => $points_income_label,
];
?>
<div class="creator-income" data-creator-income>
<section class="creator-income__cards" aria-label="<?php esc_attr_e('收益概览', 'aksrt'); ?>">
<section class="creator-income__cards" aria-label="<?php esc_attr_e('收益概览', 'jio'); ?>">
<?php foreach ($currency_labels as $unit => $label) : ?>
<article class="creator-income-card creator-income-card--<?php echo esc_attr(strtolower($unit)); ?>">
<h2><?php echo esc_html($label); ?></h2>
<div class="creator-income-card__metrics">
<?php foreach (['today' => __('今日收入', 'aksrt'), 'total' => __('累计收益', 'aksrt'), 'pending' => __('待结算', 'aksrt'), 'settled' => __('已结算', 'aksrt')] as $metric => $metric_label) : ?>
<?php foreach (['today' => __('今日收入', 'jio'), 'total' => __('累计收益', 'jio'), 'pending' => __('待结算', 'jio'), 'settled' => __('已结算', 'jio')] as $metric => $metric_label) : ?>
<span>
<strong><?php echo esc_html($format($stats[$metric][$unit] ?? 0, $unit)); ?></strong>
<small><?php echo esc_html($metric_label); ?></small>
@@ -84,35 +84,35 @@ $currency_labels = [
</section>
<section class="creator-income__info widget-card">
<h2><?php esc_html_e('结算备注', 'aksrt'); ?></h2>
<h2><?php esc_html_e('结算备注', 'jio'); ?></h2>
<div><?php echo wp_kses_post($note); ?></div>
</section>
<section class="creator-income__details widget-card">
<div class="creator-income__toolbar">
<div>
<h2><?php esc_html_e('收入明细', 'aksrt'); ?></h2>
<p><?php esc_html_e('按产生时间倒序显示,每页 20 条。', 'aksrt'); ?></p>
<h2><?php esc_html_e('收入明细', 'jio'); ?></h2>
<p><?php esc_html_e('按产生时间倒序显示,每页 20 条。', 'jio'); ?></p>
</div>
</div>
<?php if (!$items) : ?>
<div class="creator-income__empty">
<i class="fa fas fa-chart-line" aria-hidden="true"></i>
<p><?php esc_html_e('暂无收益明细', 'aksrt'); ?></p>
<p><?php esc_html_e('暂无收益明细', 'jio'); ?></p>
</div>
<?php else : ?>
<div class="creator-income__list" role="list" aria-label="<?php esc_attr_e('收入明细', 'aksrt'); ?>">
<div class="creator-income__list" role="list" aria-label="<?php esc_attr_e('收入明细', 'jio'); ?>">
<?php foreach ($items as $item) :
$unit = (string) ($item['currency'] ?? 'CNY') === 'points' ? 'points' : 'CNY';
$status = (string) ($item['status'] ?? '') === 'pending' ? 'pending' : 'settled';
$amount = $format($item['amount'] ?? 0, $unit);
$order_number = trim((string) ($item['order_number'] ?? ''));
$order_number = $order_number !== '' ? $order_number : __('订单号未知', 'aksrt');
$order_number = $order_number !== '' ? $order_number : __('订单号未知', 'jio');
$post = get_post((int) ($item['post_id'] ?? 0));
$source = $post instanceof WP_Post && $post->post_type === 'post'
? get_the_title($post)
: __('内容已删除', 'aksrt');
$source = trim((string) $source) !== '' ? (string) $source : __('内容已删除', 'aksrt');
: __('内容已删除', 'jio');
$source = trim((string) $source) !== '' ? (string) $source : __('内容已删除', 'jio');
$created_at = trim((string) ($item['created_at'] ?? ''));
$time_label = '';
$time_datetime = '';
@@ -131,7 +131,7 @@ $currency_labels = [
<span class="creator-income-row__currency"><?php echo esc_html($currency_labels[$unit === 'points' ? 'points' : 'CNY']); ?></span>
<span class="creator-income-row__source" title="<?php echo esc_attr($source); ?>"><?php echo esc_html($source); ?></span>
<span class="creator-income-row__detail">
<strong class="creator-income-row__amount">+<?php echo esc_html($amount . ($unit === 'points' ? $currency_name : __('现金', 'aksrt'))); ?></strong>
<strong class="creator-income-row__amount">+<?php echo esc_html($amount . ($unit === 'points' ? $currency_name : __('现金', 'jio'))); ?></strong>
<?php if ($time_label !== '') : ?>
<time class="creator-income-row__time" datetime="<?php echo esc_attr($time_datetime); ?>"><?php echo esc_html($time_label); ?></time>
<?php endif; ?>
@@ -141,7 +141,7 @@ $currency_labels = [
<?php endforeach; ?>
</div>
<?php if ((int) ($view['max_pages'] ?? 1) > 1) : ?>
<nav class="creator-income__pagination" aria-label="<?php esc_attr_e('收入明细分页', 'aksrt'); ?>">
<nav class="creator-income__pagination" aria-label="<?php esc_attr_e('收入明细分页', 'jio'); ?>">
<?php for ($i = 1; $i <= (int) $view['max_pages']; $i++) : ?>
<a class="<?php echo $i === (int) ($view['page'] ?? $page) ? 'is-active' : ''; ?>" href="<?php echo esc_url($page_url($i)); ?>"><?php echo esc_html((string) $i); ?></a>
<?php endfor; ?>
@@ -4,7 +4,7 @@
*
* legacy user-tab-balance parity: dual cards + tabbed ledgers.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -16,9 +16,9 @@ $dir = __DIR__;
$show_wallet = !empty($balance_enabled);
$show_credits = !empty($credits_enabled);
// 记录/任务页签文案跟随自定义货币名称(后台「积分配置 → 自定义货币名称」)。
$currency_name = (string) ($currency_name ?? __('积分', 'aksrt'));
$points_record_label = sprintf(__('%s记录', 'aksrt'), $currency_name);
$points_tasks_label = sprintf(__('%s任务', 'aksrt'), $currency_name);
$currency_name = (string) ($currency_name ?? __('积分', 'jio'));
$points_record_label = sprintf(__('%s记录', 'jio'), $currency_name);
$points_tasks_label = sprintf(__('%s任务', 'jio'), $currency_name);
// Dual cards row (legacy row gutters-10).
if ($show_wallet || $show_credits) :
@@ -44,7 +44,7 @@ if ($show_wallet || $show_credits) {
// Tabbed ledgers (legacy record tabs).
if ($show_wallet || $show_credits) :
$show_tasks = $show_credits && class_exists('\AKSRT\Credits\PointsFree') && \AKSRT\Credits\PointsFree::enabled();
$show_tasks = $show_credits && class_exists('\Jio\Credits\PointsFree') && \Jio\Credits\PointsFree::enabled();
$asset_request = is_array($asset_request ?? null) ? $asset_request : [];
$requested_asset = in_array(($asset_request['asset'] ?? ''), ['balance', 'points'], true) ? $asset_request['asset'] : '';
$active_record = $requested_asset !== ''
@@ -55,36 +55,36 @@ if ($show_wallet || $show_credits) :
<ul class="uc-asset-tabs__nav list-inline tab-nav-theme font-bold">
<?php if ($show_wallet) : ?>
<li class="<?php echo $active_record === 'balance' ? 'active' : ''; ?>">
<a href="#record_tab_balance" data-aksrt-asset-tab="balance"><?php esc_html_e('余额记录', 'aksrt'); ?></a>
<a href="#record_tab_balance" data-jio-asset-tab="balance"><?php esc_html_e('余额记录', 'jio'); ?></a>
</li>
<?php endif; ?>
<?php if ($show_credits) : ?>
<li class="<?php echo $active_record === 'points' ? 'active' : ''; ?>">
<a href="#record_tab_points" data-aksrt-asset-tab="points"><?php echo esc_html($points_record_label); ?></a>
<a href="#record_tab_points" data-jio-asset-tab="points"><?php echo esc_html($points_record_label); ?></a>
</li>
<?php endif; ?>
<?php if (!empty($show_tasks)) : ?>
<li class="<?php echo in_array($active_record, ['points_free', 'points_date'], true) ? 'active' : ''; ?>">
<a href="#record_tab_points_free" data-aksrt-asset-tab="points_free"><?php echo esc_html($points_tasks_label); ?></a>
<a href="#record_tab_points_free" data-jio-asset-tab="points_free"><?php echo esc_html($points_tasks_label); ?></a>
</li>
<?php endif; ?>
</ul>
<div class="uc-asset-tabs__content tab-content">
<?php if ($show_wallet) : ?>
<div class="tab-pane<?php echo $active_record === 'balance' ? ' is-active' : ''; ?>" id="record_tab_balance" data-aksrt-asset-pane="balance"<?php echo $active_record === 'balance' ? '' : ' hidden'; ?>>
<div class="tab-pane<?php echo $active_record === 'balance' ? ' is-active' : ''; ?>" id="record_tab_balance" data-jio-asset-pane="balance"<?php echo $active_record === 'balance' ? '' : ' hidden'; ?>>
<?php require $dir . '/credits-wallet-ledger.php'; ?>
</div>
<?php endif; ?>
<?php if ($show_credits) : ?>
<div class="tab-pane<?php echo $active_record === 'points' ? ' is-active' : ''; ?>" id="record_tab_points" data-aksrt-asset-pane="points"<?php echo $active_record === 'points' ? '' : ' hidden'; ?>>
<div class="tab-pane<?php echo $active_record === 'points' ? ' is-active' : ''; ?>" id="record_tab_points" data-jio-asset-pane="points"<?php echo $active_record === 'points' ? '' : ' hidden'; ?>>
<?php require $dir . '/credits-transactions.php'; ?>
</div>
<?php endif; ?>
<?php if (!empty($show_tasks)) : ?>
<div class="tab-pane<?php echo $active_record === 'points_free' ? ' is-active' : ''; ?>" id="record_tab_points_free" data-aksrt-asset-pane="points_free"<?php echo $active_record === 'points_free' ? '' : ' hidden'; ?>>
<div class="tab-pane<?php echo $active_record === 'points_free' ? ' is-active' : ''; ?>" id="record_tab_points_free" data-jio-asset-pane="points_free"<?php echo $active_record === 'points_free' ? '' : ' hidden'; ?>>
<?php $points_tasks_pane = 'tasks'; require $dir . '/credits-points-tasks.php'; ?>
</div>
<div class="tab-pane<?php echo $active_record === 'points_date' ? ' is-active' : ''; ?>" id="tab_points_date" data-aksrt-asset-pane="points_date"<?php echo $active_record === 'points_date' ? '' : ' hidden'; ?>>
<div class="tab-pane<?php echo $active_record === 'points_date' ? ' is-active' : ''; ?>" id="tab_points_date" data-jio-asset-pane="points_date"<?php echo $active_record === 'points_date' ? '' : ' hidden'; ?>>
<?php $points_tasks_pane = 'date'; require $dir . '/credits-points-tasks.php'; ?>
</div>
<?php endif; ?>
@@ -2,7 +2,7 @@
/**
* User center profile favorites part.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -13,7 +13,7 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
<div class="widget-card">
<div class="profile-list-header">
<h3 class="widget-title widget-title--inline">
<?php printf(esc_html__('我的收藏(%d 篇)', 'aksrt'), $favorite_count); ?>
<?php printf(esc_html__('我的收藏(%d 篇)', 'jio'), $favorite_count); ?>
</h3>
</div>
<?php if (!empty($favorite_post_ids)) :
@@ -38,31 +38,31 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
'action' => [
'type' => 'unfavorite',
'url' => '#',
'label' => __('取消收藏', 'aksrt'),
'label' => __('取消收藏', 'jio'),
],
]);
endwhile;
?>
</div>
<?php
aksrt_render_profile_pagination((int) $favorites_query->max_num_pages, $favorites_page, 'favorites_page');
jio_render_profile_pagination((int) $favorites_query->max_num_pages, $favorites_page, 'favorites_page');
wp_reset_postdata();
else :
aksrt_render_profile_empty(
jio_render_profile_empty(
$svg_empty_favorite,
__('收藏列表为空', 'aksrt'),
__('点击文章页面的星标收藏喜欢的内容。', 'aksrt'),
__('收藏列表为空', 'jio'),
__('点击文章页面的星标收藏喜欢的内容。', 'jio'),
home_url('/'),
__('去发现好文', 'aksrt')
__('去发现好文', 'jio')
);
endif;
else :
aksrt_render_profile_empty(
jio_render_profile_empty(
$svg_empty_favorite,
__('收藏列表为空', 'aksrt'),
__('点击文章页面的星标收藏喜欢的内容。', 'aksrt'),
__('收藏列表为空', 'jio'),
__('点击文章页面的星标收藏喜欢的内容。', 'jio'),
home_url('/'),
__('去发现好文', 'aksrt')
__('去发现好文', 'jio')
);
endif;
?>
@@ -2,7 +2,7 @@
/**
* Private follow management panel.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -10,7 +10,7 @@ defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
$follow = class_exists('\\AKSRT\\User\\Follow') ? \AKSRT\User\Follow::get_instance() : null;
$follow = class_exists('\\Jio\\User\\Follow') ? \Jio\User\Follow::get_instance() : null;
$active_list = isset($_GET['follow_list']) ? sanitize_key(wp_unslash($_GET['follow_list'])) : 'followers';
if (!in_array($active_list, ['followers', 'following'], true)) {
$active_list = 'followers';
@@ -23,13 +23,13 @@ $result = $follow
<div class="widget-card uc-follow-management">
<div class="profile-list-header">
<div>
<h2 class="widget-title widget-title--inline"><?php esc_html_e('粉丝与关注', 'aksrt'); ?></h2>
<p class="muted-2-color em09"><?php esc_html_e('查看谁关注了你,并管理你关注的作者。', 'aksrt'); ?></p>
<h2 class="widget-title widget-title--inline"><?php esc_html_e('粉丝与关注', 'jio'); ?></h2>
<p class="muted-2-color em09"><?php esc_html_e('查看谁关注了你,并管理你关注的作者。', 'jio'); ?></p>
</div>
</div>
<div class="profile-status-filter" role="tablist" aria-label="<?php esc_attr_e('关注关系筛选', 'aksrt'); ?>">
<?php foreach (['followers' => __('粉丝', 'aksrt'), 'following' => __('我关注的', 'aksrt')] as $key => $label) :
$url = add_query_arg(['follow_list' => $key, 'follow_page' => 1], aksrt_get_user_center_tab_url('follow'));
<div class="profile-status-filter" role="tablist" aria-label="<?php esc_attr_e('关注关系筛选', 'jio'); ?>">
<?php foreach (['followers' => __('粉丝', 'jio'), 'following' => __('我关注的', 'jio')] as $key => $label) :
$url = add_query_arg(['follow_list' => $key, 'follow_page' => 1], jio_get_user_center_tab_url('follow'));
?>
<a class="profile-status-chip<?php echo $active_list === $key ? ' is-active' : ''; ?>" href="<?php echo esc_url($url); ?>" data-tab="follow" role="tab" aria-selected="<?php echo $active_list === $key ? 'true' : 'false'; ?>">
<?php echo esc_html($label); ?> <span class="profile-status-chip__count"><?php echo esc_html(number_format_i18n((int) ($key === 'followers' ? $follower_count : $following_count))); ?></span>
@@ -40,25 +40,25 @@ $result = $follow
<div class="uc-follow-management__list">
<?php foreach ($result['items'] as $item) :
$member_id = (int) ($item['user_id'] ?? 0);
$home_url = function_exists('aksrt_get_user_home_url') ? aksrt_get_user_home_url($member_id) : '';
$home_url = function_exists('jio_get_user_home_url') ? jio_get_user_home_url($member_id) : '';
?>
<div class="uc-follow-management__item" data-follow-user="<?php echo esc_attr((string) $member_id); ?>">
<a href="<?php echo esc_url($home_url); ?>" class="uc-follow-management__avatar"><?php echo get_avatar($member_id, 48, '', (string) ($item['display_name'] ?? '')); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></a>
<div class="uc-follow-management__identity"><a href="<?php echo esc_url($home_url); ?>"><?php echo esc_html((string) ($item['display_name'] ?? '')); ?></a><span><?php echo esc_html(sprintf(__('关注于 %s', 'aksrt'), get_date_from_gmt((string) ($item['created_at'] ?? ''), get_option('date_format')))); ?></span></div>
<div class="uc-follow-management__identity"><a href="<?php echo esc_url($home_url); ?>"><?php echo esc_html((string) ($item['display_name'] ?? '')); ?></a><span><?php echo esc_html(sprintf(__('关注于 %s', 'jio'), get_date_from_gmt((string) ($item['created_at'] ?? ''), get_option('date_format')))); ?></span></div>
<div class="uc-follow-management__actions">
<a class="btn-ghost btn-sm" href="<?php echo esc_url($home_url); ?>"><?php esc_html_e('主页', 'aksrt'); ?></a>
<?php if ($active_list === 'following') : ?><button type="button" class="btn-outline btn-sm is-following" data-aksrt-follow="<?php echo esc_attr((string) $member_id); ?>"><i class="fa fas fa-heart" aria-hidden="true"></i><span data-aksrt-follow-label><?php esc_html_e('已关注', 'aksrt'); ?></span></button><?php endif; ?>
<a class="btn-ghost btn-sm" href="<?php echo esc_url($home_url); ?>"><?php esc_html_e('主页', 'jio'); ?></a>
<?php if ($active_list === 'following') : ?><button type="button" class="btn-outline btn-sm is-following" data-jio-follow="<?php echo esc_attr((string) $member_id); ?>"><i class="fa fas fa-heart" aria-hidden="true"></i><span data-jio-follow-label><?php esc_html_e('已关注', 'jio'); ?></span></button><?php endif; ?>
</div>
</div>
<?php endforeach; ?>
</div>
<?php aksrt_render_profile_pagination(
<?php jio_render_profile_pagination(
(int) ($result['total_pages'] ?? 1),
$page,
'follow_page',
add_query_arg('follow_list', $active_list, aksrt_get_user_center_tab_url('follow'))
add_query_arg('follow_list', $active_list, jio_get_user_center_tab_url('follow'))
); ?>
<?php else : ?>
<?php aksrt_render_profile_empty('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75"/></svg>', $active_list === 'followers' ? __('还没有粉丝', 'aksrt') : __('还没有关注任何作者', 'aksrt')); ?>
<?php jio_render_profile_empty('<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5"><path d="M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"/><circle cx="9" cy="7" r="4"/><path d="M22 21v-2a4 4 0 0 0-3-3.87M16 3.13a4 4 0 0 1 0 7.75"/></svg>', $active_list === 'followers' ? __('还没有粉丝', 'jio') : __('还没有关注任何作者', 'jio')); ?>
<?php endif; ?>
</div>
@@ -2,69 +2,69 @@
/**
* User center profile form part (orchestrator).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
$profile_details = isset($profile_details) && is_array($profile_details) ? $profile_details : aksrt_get_user_profile_details((int) $user_id);
$profile_details = isset($profile_details) && is_array($profile_details) ? $profile_details : jio_get_user_profile_details((int) $user_id);
?>
<form class="profile-form" id="profile-form" method="post">
<?php wp_nonce_field('aksrt_profile_save', '_profile_nonce'); ?>
<input type="hidden" name="action" value="aksrt_save_profile">
<?php wp_nonce_field('jio_profile_save', '_profile_nonce'); ?>
<input type="hidden" name="action" value="jio_save_profile">
<input type="hidden" name="user_id" value="<?php echo (int) $user_id; ?>">
<div class="widget-card">
<h3 class="widget-title"><?php esc_html_e('昵称', 'aksrt'); ?></h3>
<h3 class="widget-title"><?php esc_html_e('昵称', 'jio'); ?></h3>
<input type="text" name="nickname" id="profile-nickname"
value="<?php echo esc_attr($target_user->display_name); ?>"
class="profile-input" maxlength="50" required>
<p class="profile-hint"><?php esc_html_e('修改后会同步更新个人主页地址', 'aksrt'); ?></p>
<p class="profile-hint"><?php esc_html_e('修改后会同步更新个人主页地址', 'jio'); ?></p>
</div>
<div class="widget-card">
<h3 class="widget-title"><?php esc_html_e('个人签名', 'aksrt'); ?></h3>
<h3 class="widget-title"><?php esc_html_e('个人签名', 'jio'); ?></h3>
<textarea name="description" id="profile-bio" class="profile-input profile-textarea"
rows="4" maxlength="500" placeholder="<?php esc_attr_e('介绍一下自己…', 'aksrt'); ?>"><?php echo esc_textarea($target_user->description); ?></textarea>
<p class="profile-hint"><?php esc_html_e('显示在你的公开用户主页上,最多 500 字', 'aksrt'); ?></p>
rows="4" maxlength="500" placeholder="<?php esc_attr_e('介绍一下自己…', 'jio'); ?>"><?php echo esc_textarea($target_user->description); ?></textarea>
<p class="profile-hint"><?php esc_html_e('显示在你的公开用户主页上,最多 500 字', 'jio'); ?></p>
</div>
<div class="widget-card">
<h3 class="widget-title"><?php esc_html_e('隐私设置', 'aksrt'); ?></h3>
<h3 class="widget-title"><?php esc_html_e('隐私设置', 'jio'); ?></h3>
<select name="privacy" class="profile-input">
<option value="private" <?php selected($profile_details['privacy'], 'private'); ?>><?php esc_html_e('社交资料 所有人不可见', 'aksrt'); ?></option>
<option value="public" <?php selected($profile_details['privacy'], 'public'); ?>><?php esc_html_e('社交资料 所有人可见', 'aksrt'); ?></option>
<option value="members" <?php selected($profile_details['privacy'], 'members'); ?>><?php esc_html_e('社交资料 仅注册用户可见', 'aksrt'); ?></option>
<option value="private" <?php selected($profile_details['privacy'], 'private'); ?>><?php esc_html_e('社交资料 所有人不可见', 'jio'); ?></option>
<option value="public" <?php selected($profile_details['privacy'], 'public'); ?>><?php esc_html_e('社交资料 所有人可见', 'jio'); ?></option>
<option value="members" <?php selected($profile_details['privacy'], 'members'); ?>><?php esc_html_e('社交资料 仅注册用户可见', 'jio'); ?></option>
</select>
</div>
<div class="widget-card">
<h3 class="widget-title"><?php esc_html_e('性别', 'aksrt'); ?></h3>
<h3 class="widget-title"><?php esc_html_e('性别', 'jio'); ?></h3>
<select name="gender" class="profile-input">
<option value="secret" <?php selected($profile_details['gender'], 'secret'); ?>><?php esc_html_e('保密', 'aksrt'); ?></option>
<option value="male" <?php selected($profile_details['gender'], 'male'); ?>><?php esc_html_e('男', 'aksrt'); ?></option>
<option value="female" <?php selected($profile_details['gender'], 'female'); ?>><?php esc_html_e('女', 'aksrt'); ?></option>
<option value="secret" <?php selected($profile_details['gender'], 'secret'); ?>><?php esc_html_e('保密', 'jio'); ?></option>
<option value="male" <?php selected($profile_details['gender'], 'male'); ?>><?php esc_html_e('男', 'jio'); ?></option>
<option value="female" <?php selected($profile_details['gender'], 'female'); ?>><?php esc_html_e('女', 'jio'); ?></option>
</select>
</div>
<div class="widget-card">
<h3 class="widget-title"><?php esc_html_e('社交资料', 'aksrt'); ?></h3>
<h3 class="widget-title"><?php esc_html_e('社交资料', 'jio'); ?></h3>
<div class="profile-form__fields">
<label><span><?php esc_html_e('个人网站', 'aksrt'); ?></span><input type="url" name="website" class="profile-input" value="<?php echo esc_attr($profile_details['website']); ?>" placeholder="https://"></label>
<label><span><?php esc_html_e('个人网站', 'jio'); ?></span><input type="url" name="website" class="profile-input" value="<?php echo esc_attr($profile_details['website']); ?>" placeholder="https://"></label>
<label><span>QQ</span><input type="text" name="qq" class="profile-input" maxlength="50" value="<?php echo esc_attr($profile_details['qq']); ?>"></label>
<label><span><?php esc_html_e('微信', 'aksrt'); ?></span><input type="text" name="wechat" class="profile-input" maxlength="100" value="<?php echo esc_attr($profile_details['wechat']); ?>"></label>
<label><span><?php esc_html_e('微博', 'aksrt'); ?></span><input type="url" name="weibo" class="profile-input" value="<?php echo esc_attr($profile_details['weibo']); ?>" placeholder="https://"></label>
<label><span><?php esc_html_e('微信', 'jio'); ?></span><input type="text" name="wechat" class="profile-input" maxlength="100" value="<?php echo esc_attr($profile_details['wechat']); ?>"></label>
<label><span><?php esc_html_e('微博', 'jio'); ?></span><input type="url" name="weibo" class="profile-input" value="<?php echo esc_attr($profile_details['weibo']); ?>" placeholder="https://"></label>
<label><span>GitHub</span><input type="url" name="github" class="profile-input" value="<?php echo esc_attr($profile_details['github']); ?>" placeholder="https://github.com/"></label>
<label><span><?php esc_html_e('住址', 'aksrt'); ?></span><input type="text" name="address" class="profile-input" maxlength="200" value="<?php echo esc_attr($profile_details['address']); ?>"></label>
<label><span><?php esc_html_e('住址', 'jio'); ?></span><input type="text" name="address" class="profile-input" maxlength="200" value="<?php echo esc_attr($profile_details['address']); ?>"></label>
</div>
</div>
<div class="profile-form__submit">
<button type="submit" class="btn-primary btn-lg" id="profile-save-btn">
<?php esc_html_e('保存修改', 'aksrt'); ?>
<?php esc_html_e('保存修改', 'jio'); ?>
</button>
</div>
</form>
@@ -2,7 +2,7 @@
/**
* User center profile header part.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -12,62 +12,62 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
?>
<div class="uc-header">
<div class="uc-header__cover">
<img id="aksrt-cover-img" class="uc-header__cover-img" src="<?php echo esc_url($user_background_url); ?>" alt="">
<img id="jio-cover-img" class="uc-header__cover-img" src="<?php echo esc_url($user_background_url); ?>" alt="">
<div class="uc-header__cover-mask"></div>
<div class="aksrt-cover-menu" data-aksrt-menu>
<button type="button" class="aksrt-cover-menu__trigger" aria-haspopup="true" aria-expanded="false" aria-label="<?php esc_attr_e('个人主页操作', 'aksrt'); ?>">
<div class="jio-cover-menu" data-jio-menu>
<button type="button" class="jio-cover-menu__trigger" aria-haspopup="true" aria-expanded="false" aria-label="<?php esc_attr_e('个人主页操作', 'jio'); ?>">
<i class="fa fas fa-ellipsis-h" aria-hidden="true"></i>
</button>
<div class="aksrt-cover-menu__panel" role="menu" hidden>
<a role="menuitem" href="<?php echo esc_url(aksrt_get_user_home_url()); ?>"><i class="fa fas fa-home" aria-hidden="true"></i><?php esc_html_e('我的主页', 'aksrt'); ?></a>
<div class="jio-cover-menu__panel" role="menu" hidden>
<a role="menuitem" href="<?php echo esc_url(jio_get_user_home_url()); ?>"><i class="fa fas fa-home" aria-hidden="true"></i><?php esc_html_e('我的主页', 'jio'); ?></a>
<?php if ($allow_bg_upload) : ?>
<button type="button" role="menuitem" id="aksrt-upload-bg-btn"><i class="fa fas fa-image" aria-hidden="true"></i><span><?php esc_html_e('修改背景图', 'aksrt'); ?></span></button>
<button type="button" role="menuitem" id="jio-upload-bg-btn"><i class="fa fas fa-image" aria-hidden="true"></i><span><?php esc_html_e('修改背景图', 'jio'); ?></span></button>
<?php endif; ?>
</div>
</div>
<?php if ($allow_bg_upload) : ?><input type="file" id="aksrt-bg-file-input" accept="image/jpeg,image/png,image/webp,image/gif" hidden><?php endif; ?>
<?php if ($allow_bg_upload) : ?><input type="file" id="jio-bg-file-input" accept="image/jpeg,image/png,image/webp,image/gif" hidden><?php endif; ?>
</div>
<div class="uc-header__content">
<div class="uc-header__avatar">
<?php echo aksrt_get_avatar_html($user_id, 120, ['id' => 'aksrt-user-avatar-image', 'alt' => $target_user->display_name, 'loading' => 'eager']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php echo jio_get_avatar_html($user_id, 120, ['id' => 'jio-user-avatar-image', 'alt' => $target_user->display_name, 'loading' => 'eager']); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if ($show_avatar_edit) : ?>
<button type="button" id="aksrt-upload-avatar-btn" class="uc-header__avatar-upload" title="<?php esc_attr_e('更换头像', 'aksrt'); ?>" aria-label="<?php esc_attr_e('更换头像', 'aksrt'); ?>">
<button type="button" id="jio-upload-avatar-btn" class="uc-header__avatar-upload" title="<?php esc_attr_e('更换头像', 'jio'); ?>" aria-label="<?php esc_attr_e('更换头像', 'jio'); ?>">
<i class="fa fas fa-camera" aria-hidden="true"></i>
<span><?php esc_html_e('更换头像', 'aksrt'); ?></span>
<span><?php esc_html_e('更换头像', 'jio'); ?></span>
</button>
<input type="file" id="aksrt-avatar-file-input" accept="image/jpeg,image/png,image/webp,image/gif" hidden>
<input type="file" id="jio-avatar-file-input" accept="image/jpeg,image/png,image/webp,image/gif" hidden>
<?php endif; ?>
</div>
<div class="uc-header__info">
<h1 class="uc-header__name">
<?php echo esc_html($target_user->display_name); ?>
<?php if (function_exists('aksrt_render_user_identity_chips')) : ?>
<?php echo aksrt_render_user_identity_chips((int) $user_id, 'author', ['include_vip' => true, 'skip_badges' => true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if (function_exists('jio_render_user_identity_chips')) : ?>
<?php echo jio_render_user_identity_chips((int) $user_id, 'author', ['include_vip' => true, 'skip_badges' => true]); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
</h1>
<div class="uc-header__meta desc user-identity flex ac hh">
<?php
// 治理状态入口(参考主题 user_page_header_desc 钩子 / zib_get_user_ban_info_link:
// 用户中心「封禁」元信息,点击打开查看禁封状态弹窗 → 申诉弹窗)。
if (function_exists('aksrt_get_user_ban_info_link')) {
echo aksrt_get_user_ban_info_link((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper escapes internally.
if (function_exists('jio_get_user_ban_info_link')) {
echo jio_get_user_ban_info_link((int) $user_id); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- helper escapes internally.
}
?>
<?php if (function_exists('aksrt_render_user_medal_entry')) : ?>
<?php echo aksrt_render_user_medal_entry((int) $user_id, 'user-center', true); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php if (function_exists('jio_render_user_medal_entry')) : ?>
<?php echo jio_render_user_medal_entry((int) $user_id, 'user-center', true); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php endif; ?>
<span class="uc-header__meta-item" title="<?php esc_attr_e('用户名', 'aksrt'); ?>">
<span class="uc-header__meta-item" title="<?php esc_attr_e('用户名', 'jio'); ?>">
<i class="fa fas fa-user" aria-hidden="true"></i> <?php echo esc_html($target_user->user_login); ?>
</span>
<?php if ($target_user->user_email) : ?>
<span class="uc-header__meta-item" title="<?php esc_attr_e('邮箱', 'aksrt'); ?>">
<span class="uc-header__meta-item" title="<?php esc_attr_e('邮箱', 'jio'); ?>">
<i class="fa fas fa-envelope" aria-hidden="true"></i> <?php echo esc_html($target_user->user_email); ?>
</span>
<?php endif; ?>
<?php
// IP 归属地由扩展设置统一控制。
$uc_city = function_exists('aksrt_get_user_city_badge_html')
? aksrt_get_user_city_badge_html((int) $user_id, 'user_center', 'badg')
$uc_city = function_exists('jio_get_user_city_badge_html')
? jio_get_user_city_badge_html((int) $user_id, 'user_center', 'badg')
: '';
if ($uc_city !== '') {
echo $uc_city; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
@@ -77,24 +77,24 @@ extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_
</div>
<div class="uc-header__actions">
<?php if (!empty($signin_enabled)) : ?>
<span data-aksrt-signin>
<span data-jio-signin>
<?php if (!empty($signin_signed_today)) : ?>
<?php echo aksrt_get_user_checkin_details_link('btn btn-sm uc-header__signin-btn is-done', '<i class="fa fas fa-calendar-check" aria-hidden="true"></i><span>' . esc_html__('已签到', 'aksrt') . '</span>'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php echo jio_get_user_checkin_details_link('btn btn-sm uc-header__signin-btn is-done', '<i class="fa fas fa-calendar-check" aria-hidden="true"></i><span>' . esc_html__('已签到', 'jio') . '</span>'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<?php else : ?>
<button
type="button"
class="btn btn-sm uc-header__signin-btn"
data-signin-btn
data-signin-done-label="<?php esc_attr_e('已签到', 'aksrt'); ?>"
data-signin-done-label="<?php esc_attr_e('已签到', 'jio'); ?>"
>
<i class="fa fas fa-calendar-check" aria-hidden="true"></i>
<span data-signin-label><?php esc_html_e('签到', 'aksrt'); ?></span>
<span data-signin-label><?php esc_html_e('签到', 'jio'); ?></span>
</button>
<?php endif; ?>
</span>
<?php endif; ?>
<?php if (!empty($messages_url)) : ?>
<a href="<?php echo esc_url($messages_url); ?>" class="btn-ghost btn-sm btn-icon uc-header__message-btn" aria-label="<?php esc_attr_e('消息通知', 'aksrt'); ?>" title="<?php esc_attr_e('消息通知', 'aksrt'); ?>">
<a href="<?php echo esc_url($messages_url); ?>" class="btn-ghost btn-sm btn-icon uc-header__message-btn" aria-label="<?php esc_attr_e('消息通知', 'jio'); ?>" title="<?php esc_attr_e('消息通知', 'jio'); ?>">
<i class="fa fas fa-bell" aria-hidden="true"></i>
<?php if ($notification_unread_count > 0) : ?>
<span class="uc-header__action-badge"><?php echo esc_html((string) $notification_unread_count); ?></span>
@@ -2,44 +2,44 @@
/**
* User center: level summary, growth path and experience history.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
if ($user_id <= 0 || !class_exists('\\AKSRT\\User\\Level')) {
if ($user_id <= 0 || !class_exists('\\Jio\\User\\Level')) {
return;
}
$cfg = \AKSRT\User\Level::settings();
$cfg = \Jio\User\Level::settings();
if (empty($cfg['enabled'])) {
return;
}
$progress = \AKSRT\User\Level::get_progress($user_id);
$details = array_slice(\AKSRT\User\Level::get_details($user_id), 0, 50);
$date_details = array_slice(\AKSRT\User\Level::get_date_details($user_id), 0, 30, true);
$labels = \AKSRT\User\Level::integral_labels();
$progress = \Jio\User\Level::get_progress($user_id);
$details = array_slice(\Jio\User\Level::get_details($user_id), 0, 50);
$date_details = array_slice(\Jio\User\Level::get_date_details($user_id), 0, 30, true);
$labels = \Jio\User\Level::integral_labels();
$level_opt = is_array($cfg['level_opt'] ?? null) ? $cfg['level_opt'] : [];
$today = current_time('Y-m-d');
$today_integral = max(0, (int) ($date_details[$today] ?? 0));
$day_max = \AKSRT\User\Level::day_max();
$day_max = \Jio\User\Level::day_max();
$current_level = max(1, (int) ($progress['level'] ?? 1));
$max_level = max(1, (int) ($cfg['max'] ?? 10));
$level_icon = (string) ($progress['icon'] ?? '');
$level_name = (string) ($progress['name'] ?? \AKSRT\User\Level::get_level_name($current_level));
$level_name = (string) ($progress['name'] ?? \Jio\User\Level::get_level_name($current_level));
$badge_html = '';
if ($level_icon !== '') {
$badge_html = '<img' . aksrt_get_lazy_attr('lazy_other', $level_icon, 'aksrt-level-card__badge img-icon') . ' alt="' . esc_attr($level_name) . '" title="' . esc_attr($level_name) . '" decoding="async">';
$badge_html = '<img' . jio_get_lazy_attr('lazy_other', $level_icon, 'jio-level-card__badge img-icon') . ' alt="' . esc_attr($level_name) . '" title="' . esc_attr($level_name) . '" decoding="async">';
} else {
$badge_html = '<span class="aksrt-level-card__badge-text" title="' . esc_attr($level_name) . '">LV' . esc_html((string) $current_level) . '</span>';
$badge_html = '<span class="jio-level-card__badge-text" title="' . esc_attr($level_name) . '">LV' . esc_html((string) $current_level) . '</span>';
}
$avatar_html = function_exists('aksrt_get_avatar_html')
? aksrt_get_avatar_html($user_id, 48, ['class' => 'avatar-mini'])
$avatar_html = function_exists('jio_get_avatar_html')
? jio_get_avatar_html($user_id, 48, ['class' => 'avatar-mini'])
: get_avatar($user_id, 48);
$next_need = max(0, (int) ($progress['next_need'] ?? 0));
@@ -47,48 +47,48 @@ $integral = max(0, (int) ($progress['integral'] ?? 0));
$remaining = max(0, (int) ($progress['remaining'] ?? 0));
$percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
?>
<div class="aksrt-level-page">
<div class="row aksrt-level-page__summary">
<div class="jio-level-page">
<div class="row jio-level-page__summary">
<div class="col-md-5">
<section class="zib-widget colorful-bg jb-vip1 aksrt-level-card aksrt-level-card--summary">
<section class="zib-widget colorful-bg jb-vip1 jio-level-card jio-level-card--summary">
<div class="colorful-make" aria-hidden="true"></div>
<div class="aksrt-level-card__summary-inner">
<div class="aksrt-level-card__identity">
<div class="avatar-mini aksrt-level-card__avatar"><?php echo $avatar_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<strong><?php esc_html_e('我的等级', 'aksrt'); ?></strong>
<div class="jio-level-card__summary-inner">
<div class="jio-level-card__identity">
<div class="avatar-mini jio-level-card__avatar"><?php echo $avatar_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
<strong><?php esc_html_e('我的等级', 'jio'); ?></strong>
</div>
<div class="aksrt-level-card__current">
<div class="jio-level-card__current">
<?php echo $badge_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
<span><?php echo esc_html($level_name); ?></span>
</div>
<div class="aksrt-level-card__progress-copy">
<div class="jio-level-card__progress-copy">
<?php if (!empty($progress['is_max'])) : ?>
<div class="flex jsb mb6 ab"><strong><?php echo esc_html((string) $integral); ?>/<?php echo esc_html((string) $integral); ?></strong><span><?php esc_html_e('已为最高等级', 'aksrt'); ?></span></div>
<div class="flex jsb mb6 ab"><strong><?php echo esc_html((string) $integral); ?>/<?php echo esc_html((string) $integral); ?></strong><span><?php esc_html_e('已为最高等级', 'jio'); ?></span></div>
<?php else : ?>
<div class="flex jsb mb6 ab"><strong><?php echo esc_html((string) $integral); ?>/<?php echo esc_html((string) $next_need); ?></strong><span><?php printf(esc_html__('升级还需 %d 经验', 'aksrt'), $remaining); ?></span></div>
<div class="flex jsb mb6 ab"><strong><?php echo esc_html((string) $integral); ?>/<?php echo esc_html((string) $next_need); ?></strong><span><?php printf(esc_html__('升级还需 %d 经验', 'jio'), $remaining); ?></span></div>
<?php endif; ?>
<div class="aksrt-level-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr((string) $percentage); ?>" aria-label="<?php esc_attr_e('等级进度', 'aksrt'); ?>"><span style="width:<?php echo esc_attr((string) $percentage); ?>%;"></span></div>
<div class="jio-level-progress" role="progressbar" aria-valuemin="0" aria-valuemax="100" aria-valuenow="<?php echo esc_attr((string) $percentage); ?>" aria-label="<?php esc_attr_e('等级进度', 'jio'); ?>"><span style="width:<?php echo esc_attr((string) $percentage); ?>%;"></span></div>
</div>
</div>
</section>
</div>
<div class="col-md-7">
<section class="zib-widget colorful-bg c-gray aksrt-level-card aksrt-level-card--growth">
<section class="zib-widget colorful-bg c-gray jio-level-card jio-level-card--growth">
<div class="colorful-make" aria-hidden="true"></div>
<div class="aksrt-level-card__growth-inner">
<div class="aksrt-level-card__growth-head">
<div class="jio-level-card__growth-inner">
<div class="jio-level-card__growth-head">
<div>
<strong><i class="fa fas fa-chart-line" aria-hidden="true"></i><?php esc_html_e('成长体系', 'aksrt'); ?></strong>
<a class="muted-2-color" data-aksrt-level-tab="tab_integral_my" href="#tab_integral_my"><?php printf(esc_html__('我的经验值:%d', 'aksrt'), $integral); ?></a>
<strong><i class="fa fas fa-chart-line" aria-hidden="true"></i><?php esc_html_e('成长体系', 'jio'); ?></strong>
<a class="muted-2-color" data-jio-level-tab="tab_integral_my" href="#tab_integral_my"><?php printf(esc_html__('我的经验值:%d', 'jio'), $integral); ?></a>
</div>
<a id="tab-integral-date-link" class="muted-2-color" data-aksrt-level-tab="tab_integral_date" href="#tab_integral_date"><?php echo $today_integral > 0 ? esc_html(sprintf(__('今日 +%d', 'aksrt'), $today_integral)) : esc_html__('查看详情', 'aksrt'); ?><i class="fa fas fa-angle-right ml6" aria-hidden="true"></i></a>
<a id="tab-integral-date-link" class="muted-2-color" data-jio-level-tab="tab_integral_date" href="#tab_integral_date"><?php echo $today_integral > 0 ? esc_html(sprintf(__('今日 +%d', 'jio'), $today_integral)) : esc_html__('查看详情', 'jio'); ?><i class="fa fas fa-angle-right ml6" aria-hidden="true"></i></a>
</div>
<div class="swiper-container swiper-scroll pillar-box aksrt-level-growth" scroll-nogroup="1">
<div class="swiper-container swiper-scroll pillar-box jio-level-growth" scroll-nogroup="1">
<div class="swiper-wrapper">
<?php for ($level = 1; $level <= $max_level; $level++) :
$need = $level === 1 ? 0 : max(0, (int) ($level_opt['upgrade_integral_' . $level] ?? (($level - 1) * 500 * $level)));
$name = \AKSRT\User\Level::get_level_name($level);
$icon = \AKSRT\User\Level::get_level_icon_url($level);
$name = \Jio\User\Level::get_level_name($level);
$icon = \Jio\User\Level::get_level_icon_url($level);
$height = $level === 1 ? 0 : (int) round(86 * ($level / $max_level));
$state = $level === $current_level ? ' active' : ($level > $current_level ? ' is-future' : '');
?>
@@ -96,7 +96,7 @@ $percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
<div class="value"><?php echo esc_html((string) $need); ?></div>
<div class="pillar" style="height:<?php echo esc_attr((string) $height); ?>px;"></div>
<div class="level-name">
<?php if ($icon !== '') : ?><img<?php echo aksrt_get_lazy_attr('lazy_other', $icon, 'aksrt-level-growth__badge img-icon'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr($name); ?>" title="<?php echo esc_attr($name); ?>" decoding="async"><?php else : ?><span>LV<?php echo esc_html((string) $level); ?></span><?php endif; ?>
<?php if ($icon !== '') : ?><img<?php echo jio_get_lazy_attr('lazy_other', $icon, 'jio-level-growth__badge img-icon'); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?> alt="<?php echo esc_attr($name); ?>" title="<?php echo esc_attr($name); ?>" decoding="async"><?php else : ?><span>LV<?php echo esc_html((string) $level); ?></span><?php endif; ?>
</div>
</div>
<?php endfor; ?>
@@ -107,41 +107,41 @@ $percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
</div>
</div>
<section class="zib-widget aksrt-level-experience">
<section class="zib-widget jio-level-experience">
<div class="box-body">
<div class="aksrt-level-tabs" role="tablist" aria-label="<?php esc_attr_e('经验记录', 'aksrt'); ?>">
<a id="tab-integral-get" class="but mr6 is-active" data-aksrt-level-tab="tab_integral_get" href="#tab_integral_get" role="tab" aria-controls="tab_integral_get" aria-selected="true"><?php esc_html_e('获取经验值', 'aksrt'); ?></a>
<a id="tab-integral-my" class="but" data-aksrt-level-tab="tab_integral_my" href="#tab_integral_my" role="tab" aria-controls="tab_integral_my" aria-selected="false"><?php esc_html_e('我的经验值', 'aksrt'); ?></a>
<div class="jio-level-tabs" role="tablist" aria-label="<?php esc_attr_e('经验记录', 'jio'); ?>">
<a id="tab-integral-get" class="but mr6 is-active" data-jio-level-tab="tab_integral_get" href="#tab_integral_get" role="tab" aria-controls="tab_integral_get" aria-selected="true"><?php esc_html_e('获取经验值', 'jio'); ?></a>
<a id="tab-integral-my" class="but" data-jio-level-tab="tab_integral_my" href="#tab_integral_my" role="tab" aria-controls="tab_integral_my" aria-selected="false"><?php esc_html_e('我的经验值', 'jio'); ?></a>
</div>
<div class="tab-content mt20">
<div class="tab-pane fade active in" id="tab_integral_get" role="tabpanel" aria-labelledby="tab-integral-get">
<?php
$methods = \AKSRT\User\Level::integral_defaults();
$methods = \Jio\User\Level::integral_defaults();
$methods['checkin'] = 0;
$methods['referral'] = 0;
$methods['shop_gift'] = 0;
$referral_settings = class_exists('\\AKSRT\\Settings\\Settings') ? \AKSRT\Settings\Settings::get_referral_reward_settings() : [];
$referral_settings = class_exists('\\Jio\\Settings\\Settings') ? \Jio\Settings\Settings::get_referral_reward_settings() : [];
$methods['referral'] = max(0, (int) ($referral_settings['level_points'] ?? 0));
foreach ($methods as $key => $default_value) :
if ($key === 'day_max') {
continue;
}
$value = in_array($key, ['checkin', 'shop_gift'], true) ? 0 : ($key === 'referral' ? (int) $default_value : \AKSRT\User\Level::task_points($key));
$value = in_array($key, ['checkin', 'shop_gift'], true) ? 0 : ($key === 'referral' ? (int) $default_value : \Jio\User\Level::task_points($key));
if ($value <= 0 && !in_array($key, ['checkin', 'shop_gift'], true)) {
continue;
}
?>
<div class="border-bottom padding-h10 aksrt-level-list-row">
<div class="border-bottom padding-h10 jio-level-list-row">
<div class="flex jsb ac">
<div class="flex1 mr20"><div class="font-bold mb6"><?php echo esc_html($labels[$key] ?? $key); ?></div><div class="muted-2-color em09"><?php echo in_array($key, ['checkin', 'shop_gift'], true) ? esc_html__('按活动或商品配置发放', 'aksrt') : esc_html__('完成后自动计入经验', 'aksrt'); ?></div></div>
<span class="focus-color em14 shrink0"><i class="fa fas fa-bolt mr6" aria-hidden="true"></i><?php echo $value > 0 ? '+' . esc_html((string) $value) : esc_html__('动态', 'aksrt'); ?></span>
<div class="flex1 mr20"><div class="font-bold mb6"><?php echo esc_html($labels[$key] ?? $key); ?></div><div class="muted-2-color em09"><?php echo in_array($key, ['checkin', 'shop_gift'], true) ? esc_html__('按活动或商品配置发放', 'jio') : esc_html__('完成后自动计入经验', 'jio'); ?></div></div>
<span class="focus-color em14 shrink0"><i class="fa fas fa-bolt mr6" aria-hidden="true"></i><?php echo $value > 0 ? '+' . esc_html((string) $value) : esc_html__('动态', 'jio'); ?></span>
</div>
</div>
<?php endforeach; ?>
</div>
<div class="tab-pane fade" id="tab_integral_my" role="tabpanel" aria-labelledby="tab-integral-my" hidden>
<?php if ($today_integral > 0) : ?>
<div class="border-bottom padding-h10 aksrt-level-list-row"><div class="flex jsb ac"><div class="flex1 mr20"><div class="font-bold mb6"><?php printf(esc_html__('今日累计 +%d', 'aksrt'), $today_integral); ?></div><div class="muted-2-color em09"><?php echo $day_max > $today_integral ? esc_html(sprintf(__('每日最多获得 %d 经验', 'aksrt'), $day_max)) : esc_html__('今日累计已达到上限', 'aksrt'); ?></div></div><a class="muted-2-color shrink0" data-aksrt-level-tab="tab_integral_date" href="#tab_integral_date" role="tab" aria-controls="tab_integral_date"><?php esc_html_e('每日详情', 'aksrt'); ?><i class="fa fas fa-angle-right ml6" aria-hidden="true"></i></a></div></div>
<div class="border-bottom padding-h10 jio-level-list-row"><div class="flex jsb ac"><div class="flex1 mr20"><div class="font-bold mb6"><?php printf(esc_html__('今日累计 +%d', 'jio'), $today_integral); ?></div><div class="muted-2-color em09"><?php echo $day_max > $today_integral ? esc_html(sprintf(__('每日最多获得 %d 经验', 'jio'), $day_max)) : esc_html__('今日累计已达到上限', 'jio'); ?></div></div><a class="muted-2-color shrink0" data-jio-level-tab="tab_integral_date" href="#tab_integral_date" role="tab" aria-controls="tab_integral_date"><?php esc_html_e('每日详情', 'jio'); ?><i class="fa fas fa-angle-right ml6" aria-hidden="true"></i></a></div></div>
<?php endif; ?>
<?php if ($details) : ?>
<?php foreach ($details as $row) :
@@ -149,19 +149,19 @@ $percentage = max(0, min(100, (int) ($progress['progress'] ?? 0)));
$value = max(0, (int) ($row['value'] ?? 0));
$detail_integral = max(0, (int) ($row['integral'] ?? 0));
?>
<div class="border-bottom padding-h10 aksrt-level-list-row"><div class="flex jsb ac"><div class="flex1 mr20"><div class="font-bold mb6"><?php echo esc_html($labels[$key] ?? $key); ?></div><div class="muted-2-color em09"><?php echo esc_html((string) ($row['time'] ?? '')); ?></div></div><div class="text-right shrink0"><div class="focus-color em14 mb6">+ <?php echo esc_html((string) $value); ?></div><div class="muted-2-color em09"><?php printf(esc_html__('累计:%d', 'aksrt'), $detail_integral); ?></div></div></div></div>
<div class="border-bottom padding-h10 jio-level-list-row"><div class="flex jsb ac"><div class="flex1 mr20"><div class="font-bold mb6"><?php echo esc_html($labels[$key] ?? $key); ?></div><div class="muted-2-color em09"><?php echo esc_html((string) ($row['time'] ?? '')); ?></div></div><div class="text-right shrink0"><div class="focus-color em14 mb6">+ <?php echo esc_html((string) $value); ?></div><div class="muted-2-color em09"><?php printf(esc_html__('累计:%d', 'jio'), $detail_integral); ?></div></div></div></div>
<?php endforeach; ?>
<?php else : ?>
<p class="aksrt-level-empty"><?php esc_html_e('暂无经验值获取明细', 'aksrt'); ?></p>
<p class="jio-level-empty"><?php esc_html_e('暂无经验值获取明细', 'jio'); ?></p>
<?php endif; ?>
<?php if ($details) : ?><div class="text-center mt20 muted-3-color"><?php esc_html_e('最多显示近50条记录', 'aksrt'); ?></div><?php endif; ?>
<?php if ($details) : ?><div class="text-center mt20 muted-3-color"><?php esc_html_e('最多显示近50条记录', 'jio'); ?></div><?php endif; ?>
</div>
<div class="tab-pane fade" id="tab_integral_date" role="tabpanel" aria-labelledby="tab-integral-date-link" hidden>
<?php if ($date_details) : ?>
<?php foreach ($date_details as $date => $value) : ?><div class="border-bottom padding-h6 flex jsb ac aksrt-level-date-row"><div class="em12"><?php echo esc_html((string) $date); ?></div><div class="text-right shrink0 focus-color em14 font-bold">+ <?php echo esc_html((string) max(0, (int) $value)); ?></div></div><?php endforeach; ?>
<div class="text-center mt20 muted-3-color"><?php esc_html_e('最多显示近30条记录', 'aksrt'); ?></div>
<?php foreach ($date_details as $date => $value) : ?><div class="border-bottom padding-h6 flex jsb ac jio-level-date-row"><div class="em12"><?php echo esc_html((string) $date); ?></div><div class="text-right shrink0 focus-color em14 font-bold">+ <?php echo esc_html((string) max(0, (int) $value)); ?></div></div><?php endforeach; ?>
<div class="text-center mt20 muted-3-color"><?php esc_html_e('最多显示近30条记录', 'jio'); ?></div>
<?php else : ?>
<p class="aksrt-level-empty"><?php esc_html_e('暂无经验值获取明细', 'aksrt'); ?></p>
<p class="jio-level-empty"><?php esc_html_e('暂无经验值获取明细', 'jio'); ?></p>
<?php endif; ?>
</div>
</div>
@@ -2,49 +2,49 @@
/**
* User center notification preferences panel.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
$preferences = class_exists('\AKSRT\User\NotificationPreferences')
? \AKSRT\User\NotificationPreferences::get($user_id)
$preferences = class_exists('\Jio\User\NotificationPreferences')
? \Jio\User\NotificationPreferences::get($user_id)
: ['posts' => true, 'like' => true, 'system' => true];
$items = [
'posts' => [
'title' => __('文章评论', 'aksrt'),
'description' => __('接收文章、评论、收藏等相关消息', 'aksrt'),
'title' => __('文章评论', 'jio'),
'description' => __('接收文章、评论、收藏等相关消息', 'jio'),
],
'like' => [
'title' => __('点赞喜欢', 'aksrt'),
'description' => __('接收点赞、关注等相关消息', 'aksrt'),
'title' => __('点赞喜欢', 'jio'),
'description' => __('接收点赞、关注等相关消息', 'jio'),
],
'system' => [
'title' => __('系统消息', 'aksrt'),
'description' => __('接收订单、活动、等系统消息', 'aksrt'),
'title' => __('系统消息', 'jio'),
'description' => __('接收订单、活动、等系统消息', 'jio'),
],
];
?>
<form class="uc-notification-preferences" data-aksrt-notification-preferences>
<form class="uc-notification-preferences" data-jio-notification-preferences>
<div class="uc-notification-preferences__header">
<div>
<h2><?php esc_html_e('消息通知', 'aksrt'); ?></h2>
<p><?php esc_html_e('选择你希望接收的站内消息类型。', 'aksrt'); ?></p>
<h2><?php esc_html_e('消息通知', 'jio'); ?></h2>
<p><?php esc_html_e('选择你希望接收的站内消息类型。', 'jio'); ?></p>
</div>
<span class="uc-notification-preferences__header-icon" aria-hidden="true"><i class="fa fas fa-bell"></i></span>
</div>
<div class="uc-notification-preferences__list">
<?php foreach ($items as $key => $item) : ?>
<label class="uc-notification-preference" for="aksrt-notification-<?php echo esc_attr($key); ?>">
<label class="uc-notification-preference" for="jio-notification-<?php echo esc_attr($key); ?>">
<span class="uc-notification-preference__copy">
<strong><?php echo esc_html($item['title']); ?></strong>
<small><?php echo esc_html($item['description']); ?></small>
</span>
<span class="uc-notification-switch">
<input id="aksrt-notification-<?php echo esc_attr($key); ?>" type="checkbox" name="<?php echo esc_attr($key); ?>" value="1" role="switch" <?php checked(!empty($preferences[$key])); ?>>
<input id="jio-notification-<?php echo esc_attr($key); ?>" type="checkbox" name="<?php echo esc_attr($key); ?>" value="1" role="switch" <?php checked(!empty($preferences[$key])); ?>>
<span aria-hidden="true"></span>
</span>
</label>
@@ -52,6 +52,6 @@ $items = [
</div>
<div class="uc-notification-preferences__footer">
<button type="submit" class="btn-primary"><?php esc_html_e('保存设置', 'aksrt'); ?></button>
<button type="submit" class="btn-primary"><?php esc_html_e('保存设置', 'jio'); ?></button>
</div>
</form>
@@ -2,7 +2,7 @@
/**
* User-center knowledge-payment order panel.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -10,7 +10,7 @@ defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
if ($user_id <= 0) {
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'aksrt') . '</div>';
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'jio') . '</div>';
return;
}
@@ -21,9 +21,9 @@ $raw_query = [
'page' => 1,
'per_page' => 20,
];
$query = \AKSRT\Payment\OrderCenterQuery::from_array($raw_query);
$orders_view = function_exists('aksrt_get_orders_page_view')
? aksrt_get_orders_page_view($user_id, $query->page(), $query->per_page(), $query->status(), $query->product_type(), $query->order_number())
$query = \Jio\Payment\OrderCenterQuery::from_array($raw_query);
$orders_view = function_exists('jio_get_orders_page_view')
? jio_get_orders_page_view($user_id, $query->page(), $query->per_page(), $query->status(), $query->product_type(), $query->order_number())
: ['items' => [], 'total' => 0, 'total_pages' => 1, 'page' => 1, 'stats' => [], 'product_types' => []];
$orders = (array) ($orders_view['items'] ?? []);
@@ -36,97 +36,97 @@ $type = $query->product_type();
$order_number = $query->order_number();
$status_options = [
'all' => __('全部', 'aksrt'),
'pending' => __('待支付', 'aksrt'),
'paid' => __('已支付', 'aksrt'),
'refunded' => __('已退款', 'aksrt'),
'closed' => __('已关闭', 'aksrt'),
'all' => __('全部', 'jio'),
'pending' => __('待支付', 'jio'),
'paid' => __('已支付', 'jio'),
'refunded' => __('已退款', 'jio'),
'closed' => __('已关闭', 'jio'),
];
?>
<div class="aksrt-orders-page uc-orders-panel" data-aksrt-order-center>
<div class="jio-orders-page uc-orders-panel" data-jio-order-center>
<header class="uc-orders-panel__head">
<div class="uc-orders-panel__title-wrap">
<p class="aksrt-orders-page__eyebrow"><?php esc_html_e('我的购买', 'aksrt'); ?></p>
<p class="jio-orders-page__eyebrow"><?php esc_html_e('我的购买', 'jio'); ?></p>
<div class="uc-orders-panel__title font-bold em12">
<i class="fa fas fa-file-alt uc-orders-panel__title-icon" aria-hidden="true"></i>
<?php esc_html_e('我的订单', 'aksrt'); ?>
<?php esc_html_e('我的订单', 'jio'); ?>
</div>
<p class="muted-2-color em09 mt3"><?php esc_html_e('管理已购内容、会员与账户权益。', 'aksrt'); ?></p>
<p class="muted-2-color em09 mt3"><?php esc_html_e('管理已购内容、会员与账户权益。', 'jio'); ?></p>
</div>
<div class="aksrt-orders-page__stats" data-aksrt-order-stats>
<div class="aksrt-orders-page__stat"><span><?php esc_html_e('全部', 'aksrt'); ?></span><strong><?php echo esc_html((string) (int) ($stats['total'] ?? 0)); ?></strong></div>
<div class="aksrt-orders-page__stat"><span><?php esc_html_e('待支付', 'aksrt'); ?></span><strong class="is-pending"><?php echo esc_html((string) (int) ($stats['pending'] ?? 0)); ?></strong></div>
<div class="aksrt-orders-page__stat"><span><?php esc_html_e('已支付', 'aksrt'); ?></span><strong class="is-paid"><?php echo esc_html((string) (int) ($stats['paid'] ?? 0)); ?></strong></div>
<div class="aksrt-orders-page__stat"><span><?php esc_html_e('已关闭', 'aksrt'); ?></span><strong><?php echo esc_html((string) (int) ($stats['closed'] ?? 0)); ?></strong></div>
<div class="jio-orders-page__stats" data-jio-order-stats>
<div class="jio-orders-page__stat"><span><?php esc_html_e('全部', 'jio'); ?></span><strong><?php echo esc_html((string) (int) ($stats['total'] ?? 0)); ?></strong></div>
<div class="jio-orders-page__stat"><span><?php esc_html_e('待支付', 'jio'); ?></span><strong class="is-pending"><?php echo esc_html((string) (int) ($stats['pending'] ?? 0)); ?></strong></div>
<div class="jio-orders-page__stat"><span><?php esc_html_e('已支付', 'jio'); ?></span><strong class="is-paid"><?php echo esc_html((string) (int) ($stats['paid'] ?? 0)); ?></strong></div>
<div class="jio-orders-page__stat"><span><?php esc_html_e('已关闭', 'jio'); ?></span><strong><?php echo esc_html((string) (int) ($stats['closed'] ?? 0)); ?></strong></div>
</div>
</header>
<form class="aksrt-orders-page__search" data-aksrt-orders-search>
<label class="screen-reader-text" for="aksrt-order-number"><?php esc_html_e('按订单号查找', 'aksrt'); ?></label>
<form class="jio-orders-page__search" data-jio-orders-search>
<label class="screen-reader-text" for="jio-order-number"><?php esc_html_e('按订单号查找', 'jio'); ?></label>
<i class="fa fas fa-search" aria-hidden="true"></i>
<input id="aksrt-order-number" value="<?php echo esc_attr($order_number); ?>" maxlength="22" placeholder="<?php esc_attr_e('输入订单号查找', 'aksrt'); ?>">
<button class="btn-primary" type="submit"><?php esc_html_e('查找', 'aksrt'); ?></button>
<button class="aksrt-orders-page__filter-toggle" type="button" data-aksrt-orders-filter-toggle aria-expanded="false" aria-controls="aksrt-orders-filter-panel"><i class="fa fas fa-sliders-h" aria-hidden="true"></i> <?php esc_html_e('筛选', 'aksrt'); ?></button>
<input id="jio-order-number" value="<?php echo esc_attr($order_number); ?>" maxlength="22" placeholder="<?php esc_attr_e('输入订单号查找', 'jio'); ?>">
<button class="btn-primary" type="submit"><?php esc_html_e('查找', 'jio'); ?></button>
<button class="jio-orders-page__filter-toggle" type="button" data-jio-orders-filter-toggle aria-expanded="false" aria-controls="jio-orders-filter-panel"><i class="fa fas fa-sliders-h" aria-hidden="true"></i> <?php esc_html_e('筛选', 'jio'); ?></button>
</form>
<div id="aksrt-orders-filter-panel" class="aksrt-orders-page__filter-panel" data-aksrt-orders-filter-panel hidden>
<div class="aksrt-orders-page__filter-group">
<span class="aksrt-orders-page__filter-label"><?php esc_html_e('订单状态', 'aksrt'); ?></span>
<nav class="aksrt-orders-page__status-filters" aria-label="<?php esc_attr_e('订单状态', 'aksrt'); ?>">
<div id="jio-orders-filter-panel" class="jio-orders-page__filter-panel" data-jio-orders-filter-panel hidden>
<div class="jio-orders-page__filter-group">
<span class="jio-orders-page__filter-label"><?php esc_html_e('订单状态', 'jio'); ?></span>
<nav class="jio-orders-page__status-filters" aria-label="<?php esc_attr_e('订单状态', 'jio'); ?>">
<?php foreach ($status_options as $key => $label) : ?>
<button class="aksrt-orders-page__filter-chip<?php echo $status === $key ? ' is-active' : ''; ?>" type="button" data-aksrt-order-filter="status" data-aksrt-order-filter-value="<?php echo esc_attr($key); ?>" aria-pressed="<?php echo $status === $key ? 'true' : 'false'; ?>">
<button class="jio-orders-page__filter-chip<?php echo $status === $key ? ' is-active' : ''; ?>" type="button" data-jio-order-filter="status" data-jio-order-filter-value="<?php echo esc_attr($key); ?>" aria-pressed="<?php echo $status === $key ? 'true' : 'false'; ?>">
<?php echo esc_html($label); ?>
<?php if ($key === 'pending') : ?><span class="aksrt-orders-page__filter-count"<?php echo empty($stats['pending']) ? ' hidden' : ''; ?>><?php echo esc_html((string) (int) ($stats['pending'] ?? 0)); ?></span><?php endif; ?>
<?php if ($key === 'pending') : ?><span class="jio-orders-page__filter-count"<?php echo empty($stats['pending']) ? ' hidden' : ''; ?>><?php echo esc_html((string) (int) ($stats['pending'] ?? 0)); ?></span><?php endif; ?>
</button>
<?php endforeach; ?>
</nav>
</div>
<div class="aksrt-orders-page__filter-group">
<span class="aksrt-orders-page__filter-label"><?php esc_html_e('订单类型', 'aksrt'); ?></span>
<div class="aksrt-orders-page__type-filters">
<div class="jio-orders-page__filter-group">
<span class="jio-orders-page__filter-label"><?php esc_html_e('订单类型', 'jio'); ?></span>
<div class="jio-orders-page__type-filters">
<?php foreach ($type_options as $key => $label) : ?>
<button class="aksrt-orders-page__filter-chip<?php echo (string) $key === $type ? ' is-active' : ''; ?>" type="button" data-aksrt-order-filter="type" data-aksrt-order-filter-value="<?php echo esc_attr((string) $key); ?>" aria-pressed="<?php echo (string) $key === $type ? 'true' : 'false'; ?>"><?php echo esc_html((string) $label); ?></button>
<button class="jio-orders-page__filter-chip<?php echo (string) $key === $type ? ' is-active' : ''; ?>" type="button" data-jio-order-filter="type" data-jio-order-filter-value="<?php echo esc_attr((string) $key); ?>" aria-pressed="<?php echo (string) $key === $type ? 'true' : 'false'; ?>"><?php echo esc_html((string) $label); ?></button>
<?php endforeach; ?>
</div>
</div>
<button class="aksrt-orders-page__clear" type="button" data-aksrt-orders-clear><?php esc_html_e('清除条件', 'aksrt'); ?></button>
<button class="jio-orders-page__clear" type="button" data-jio-orders-clear><?php esc_html_e('清除条件', 'jio'); ?></button>
</div>
<?php if ($orders !== []) : ?>
<div class="aksrt-orders-page__list" data-aksrt-order-list>
<div class="jio-orders-page__list" data-jio-order-list>
<?php foreach ($orders as $order) :
$number = (string) ($order['order_number'] ?? '');
$actions = (array) ($order['allowed_actions'] ?? []);
if (!empty($order['is_points'])) {
$amount = esc_html((string) ($order['currency_symbol'] ?? __('积分', 'aksrt')) . ' ' . (string) max(0, (int) ($order['amount'] ?? 0)));
$amount = esc_html((string) ($order['currency_symbol'] ?? __('积分', 'jio')) . ' ' . (string) max(0, (int) ($order['amount'] ?? 0)));
} else {
try {
$order_amount = \AKSRT\Ledger\AssetAmount::balance(is_string($order['amount'] ?? null) ? $order['amount'] : '')->formatted();
$order_amount = \Jio\Ledger\AssetAmount::balance(is_string($order['amount'] ?? null) ? $order['amount'] : '')->formatted();
} catch (\InvalidArgumentException $e) {
$order_amount = '0.00';
}
$amount = '¥' . esc_html($order_amount);
}
?>
<article class="aksrt-orders-page__card" data-aksrt-order-card="<?php echo esc_attr($number); ?>" data-order-status="<?php echo esc_attr((string) ($order['status_group'] ?? '')); ?>">
<div class="aksrt-orders-page__card-rail"><span><?php echo esc_html((string) ($order['product_type_label'] ?? '')); ?></span><time><?php echo esc_html((string) ($order['created_at'] ?? '')); ?></time><span class="aksrt-orders-page__card-status is-<?php echo esc_attr((string) ($order['status_group'] ?? '')); ?>"><?php echo esc_html((string) ($order['status_label'] ?? '')); ?></span></div>
<div class="aksrt-orders-page__card-main">
<?php if (!empty($order['image'])) : ?><img class="aksrt-orders-page__card-img" src="<?php echo esc_url((string) $order['image']); ?>" alt=""><?php else : ?><div class="aksrt-orders-page__card-art" aria-hidden="true"><i class="fa fas fa-book"></i></div><?php endif; ?>
<div class="aksrt-orders-page__card-copy"><h3><?php echo esc_html((string) ($order['product_name'] ?? __('订单', 'aksrt'))); ?></h3><p><?php printf(esc_html__('订单号 %s', 'aksrt'), esc_html($number)); ?></p></div>
<div class="aksrt-orders-page__card-value"><strong><?php echo $amount; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong><span><?php esc_html_e('实付', 'aksrt'); ?></span></div>
<article class="jio-orders-page__card" data-jio-order-card="<?php echo esc_attr($number); ?>" data-order-status="<?php echo esc_attr((string) ($order['status_group'] ?? '')); ?>">
<div class="jio-orders-page__card-rail"><span><?php echo esc_html((string) ($order['product_type_label'] ?? '')); ?></span><time><?php echo esc_html((string) ($order['created_at'] ?? '')); ?></time><span class="jio-orders-page__card-status is-<?php echo esc_attr((string) ($order['status_group'] ?? '')); ?>"><?php echo esc_html((string) ($order['status_label'] ?? '')); ?></span></div>
<div class="jio-orders-page__card-main">
<?php if (!empty($order['image'])) : ?><img class="jio-orders-page__card-img" src="<?php echo esc_url((string) $order['image']); ?>" alt=""><?php else : ?><div class="jio-orders-page__card-art" aria-hidden="true"><i class="fa fas fa-book"></i></div><?php endif; ?>
<div class="jio-orders-page__card-copy"><h3><?php echo esc_html((string) ($order['product_name'] ?? __('订单', 'jio'))); ?></h3><p><?php printf(esc_html__('订单号 %s', 'jio'), esc_html($number)); ?></p></div>
<div class="jio-orders-page__card-value"><strong><?php echo $amount; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></strong><span><?php esc_html_e('实付', 'jio'); ?></span></div>
</div>
<footer class="aksrt-orders-page__card-actions">
<?php if (!empty($order['time_left'])) : ?><span class="aksrt-orders-page__countdown" data-aksrt-order-countdown="<?php echo esc_attr((string) $order['time_left']); ?>"></span><?php endif; ?>
<button class="btn-outline" type="button" data-aksrt-order-detail="<?php echo esc_attr($number); ?>"><?php esc_html_e('订单详情', 'aksrt'); ?></button>
<?php if (!empty($actions['can_cancel'])) : ?><button class="btn-ghost" type="button" data-aksrt-order-cancel="<?php echo esc_attr($number); ?>"><?php esc_html_e('关闭订单', 'aksrt'); ?></button><?php endif; ?>
<?php if (!empty($actions['can_pay'])) : ?><button class="btn-primary" type="button" data-aksrt-order-pay="<?php echo esc_attr($number); ?>" data-aksrt-order-method="<?php echo esc_attr((string) ($order['payment_method']['value'] ?? '')); ?>"><?php esc_html_e('继续支付', 'aksrt'); ?></button><?php endif; ?>
<footer class="jio-orders-page__card-actions">
<?php if (!empty($order['time_left'])) : ?><span class="jio-orders-page__countdown" data-jio-order-countdown="<?php echo esc_attr((string) $order['time_left']); ?>"></span><?php endif; ?>
<button class="btn-outline" type="button" data-jio-order-detail="<?php echo esc_attr($number); ?>"><?php esc_html_e('订单详情', 'jio'); ?></button>
<?php if (!empty($actions['can_cancel'])) : ?><button class="btn-ghost" type="button" data-jio-order-cancel="<?php echo esc_attr($number); ?>"><?php esc_html_e('关闭订单', 'jio'); ?></button><?php endif; ?>
<?php if (!empty($actions['can_pay'])) : ?><button class="btn-primary" type="button" data-jio-order-pay="<?php echo esc_attr($number); ?>" data-jio-order-method="<?php echo esc_attr((string) ($order['payment_method']['value'] ?? '')); ?>"><?php esc_html_e('继续支付', 'jio'); ?></button><?php endif; ?>
</footer>
</article>
<?php endforeach; ?>
</div>
<?php if ($total_pages > 1) : ?><nav class="aksrt-orders-page__pagination" aria-label="<?php esc_attr_e('订单分页', 'aksrt'); ?>"><?php for ($index = 1; $index <= $total_pages; $index++) : ?><button class="aksrt-orders-page__page-chip<?php echo $index === $page ? ' is-active' : ''; ?>" type="button" data-aksrt-order-page="<?php echo esc_attr((string) $index); ?>"<?php echo $index === $page ? ' aria-current="page"' : ''; ?>><?php echo esc_html((string) $index); ?></button><?php endfor; ?></nav><?php endif; ?>
<?php if ($total_pages > 1) : ?><nav class="jio-orders-page__pagination" aria-label="<?php esc_attr_e('订单分页', 'jio'); ?>"><?php for ($index = 1; $index <= $total_pages; $index++) : ?><button class="jio-orders-page__page-chip<?php echo $index === $page ? ' is-active' : ''; ?>" type="button" data-jio-order-page="<?php echo esc_attr((string) $index); ?>"<?php echo $index === $page ? ' aria-current="page"' : ''; ?>><?php echo esc_html((string) $index); ?></button><?php endfor; ?></nav><?php endif; ?>
<?php else : ?>
<div class="aksrt-orders-page__empty" data-aksrt-order-list><i class="fa fas fa-file-alt" aria-hidden="true"></i><h3><?php esc_html_e('还没有购买记录', 'aksrt'); ?></h3><p><?php esc_html_e('购买内容或开通权益后,订单会出现在这里。', 'aksrt'); ?></p></div>
<div class="jio-orders-page__empty" data-jio-order-list><i class="fa fas fa-file-alt" aria-hidden="true"></i><h3><?php esc_html_e('还没有购买记录', 'jio'); ?></h3><p><?php esc_html_e('购买内容或开通权益后,订单会出现在这里。', 'jio'); ?></p></div>
<?php endif; ?>
@@ -2,24 +2,24 @@
/**
* User center profile posts part (orchestrator).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
$can_submit_posts = class_exists('\\AKSRT\\Core\\FrontSubmit')
&& \AKSRT\Core\FrontSubmit::get_instance()->can_submit((int) $user_id);
$can_submit_posts = class_exists('\\Jio\\Core\\FrontSubmit')
&& \Jio\Core\FrontSubmit::get_instance()->can_submit((int) $user_id);
?>
<div class="widget-card">
<div class="profile-list-header creator-center-header">
<div class="creator-center-heading">
<h2 class="widget-title widget-title--inline"><?php esc_html_e('创作中心', 'aksrt'); ?></h2>
<h2 class="widget-title widget-title--inline"><?php esc_html_e('创作中心', 'jio'); ?></h2>
<p class="creator-center-heading__summary">
<?php
/* translators: %d: total post count */
printf(esc_html__('管理你的文章、草稿和审核状态(共 %d 篇)', 'aksrt'), $post_count);
printf(esc_html__('管理你的文章、草稿和审核状态(共 %d 篇)', 'jio'), $post_count);
?>
</p>
</div>
@@ -27,7 +27,7 @@ $can_submit_posts = class_exists('\\AKSRT\\Core\\FrontSubmit')
<?php if (!empty($new_post_url) && $can_submit_posts) : ?>
<a class="btn-primary btn-sm" href="<?php echo esc_url($new_post_url); ?>">
<span aria-hidden="true">+</span>
<?php esc_html_e('新建文章', 'aksrt'); ?>
<?php esc_html_e('新建文章', 'jio'); ?>
</a>
<?php endif; ?>
<?php require __DIR__ . '/posts-status-filter.php'; ?>
@@ -2,7 +2,7 @@
/**
* User center commission and referral revenue panel.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -10,27 +10,27 @@ defined('ABSPATH') || exit;
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
if ($user_id <= 0) {
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'aksrt') . '</div>';
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'jio') . '</div>';
return;
}
$affiliate = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_payment_affiliate_settings()
$affiliate = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::get_payment_affiliate_settings()
: [];
$affiliate_on = !empty($affiliate['enabled']);
$withdrawal = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_withdrawal_settings()
$withdrawal = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::get_withdrawal_settings()
: [];
$recharge = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_payment_recharge_settings() : [];
$recharge = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_payment_recharge_settings() : [];
$withdraw_on = $affiliate_on && !empty($recharge['enabled']);
if ($withdraw_on && class_exists('\AKSRT\Settings\Capabilities') && !\AKSRT\Settings\Capabilities::user_can('balance_withdraw', $user_id)) {
if ($withdraw_on && class_exists('\Jio\Settings\Capabilities') && !\Jio\Settings\Capabilities::user_can('balance_withdraw', $user_id)) {
$withdraw_on = false;
}
$normalize_balance = static function ($value): \AKSRT\Ledger\AssetAmount {
$normalize_balance = static function ($value): \Jio\Ledger\AssetAmount {
try {
return \AKSRT\Ledger\AssetAmount::balance(is_string($value) ? $value : '');
return \Jio\Ledger\AssetAmount::balance(is_string($value) ? $value : '');
} catch (\InvalidArgumentException $e) {
return \AKSRT\Ledger\AssetAmount::balance('0');
return \Jio\Ledger\AssetAmount::balance('0');
}
};
$signed_balance_minor = static function ($value) use ($normalize_balance): int {
@@ -41,29 +41,29 @@ $signed_balance_minor = static function ($value) use ($normalize_balance): int {
};
$withdraw_min = $normalize_balance($withdrawal['min_amount'] ?? '50')->decimal();
$commission_stats = class_exists('\AKSRT\Payment\CommissionLedger')
? \AKSRT\Payment\CommissionLedger::get_instance()->overview($user_id)
$commission_stats = class_exists('\Jio\Payment\CommissionLedger')
? \Jio\Payment\CommissionLedger::get_instance()->overview($user_id)
: ['total' => 0, 'pool' => 0, 'withdrawn' => 0, 'debt' => 0];
/* 佣金池提现的每日次数/额度:与余额提现相互独立,按 commission source 计。 */
$commission_withdraw_usage = ['remaining_count' => 0, 'remaining_amount' => '0.00'];
if ($withdraw_on && class_exists('\AKSRT\Payment\Withdrawal')) {
$commission_withdraw_usage = \AKSRT\Payment\Withdrawal::get_instance()->daily_usage($user_id, $withdrawal, \AKSRT\Payment\Withdrawal::SOURCE_COMMISSION);
if ($withdraw_on && class_exists('\Jio\Payment\Withdrawal')) {
$commission_withdraw_usage = \Jio\Payment\Withdrawal::get_instance()->daily_usage($user_id, $withdrawal, \Jio\Payment\Withdrawal::SOURCE_COMMISSION);
}
$commission_ratio = class_exists('\AKSRT\Settings\Settings')
? (int) \AKSRT\Settings\Settings::affiliate_ratio_for_user($user_id)
$commission_ratio = class_exists('\Jio\Settings\Settings')
? (int) \Jio\Settings\Settings::affiliate_ratio_for_user($user_id)
: 0;
$details_text = trim((string) ($affiliate['promotion_text'] ?? ''));
if ($details_text === '') {
$details_text = __('好友通过推广链接完成符合条件的订单后,系统会按当前佣金比例记录返佣,结算后进入可提现余额。', 'aksrt');
$details_text = __('好友通过推广链接完成符合条件的订单后,系统会按当前佣金比例记录返佣,结算后进入可提现余额。', 'jio');
}
$details_title = trim((string) ($affiliate['details_title'] ?? ''));
if ($details_title === '') {
$details_title = __('返佣详解', 'aksrt');
$details_title = __('返佣详解', 'jio');
}
/* 推广链接服务端直出:避免为了一个本地拼接的 URL 多绕一次 REST 往返。 */
$affiliate_link_url = '';
if (class_exists('\AKSRT\Payment\ReferralAttribution')) {
$affiliate_link_url = (string) (\AKSRT\Payment\ReferralAttribution::get_instance()->create_link($user_id)['url'] ?? '');
if (class_exists('\Jio\Payment\ReferralAttribution')) {
$affiliate_link_url = (string) (\Jio\Payment\ReferralAttribution::get_instance()->create_link($user_id)['url'] ?? '');
}
$revenue_request = is_array($context['revenue_request'] ?? null) ? $context['revenue_request'] : [];
@@ -74,8 +74,8 @@ if (!in_array($active_reward_tab, ['detail', 'orders', 'users'], true)) {
if (!$affiliate_on && $active_reward_tab === 'orders') {
$active_reward_tab = 'detail';
}
$base_url = function_exists('aksrt_get_user_center_tab_url')
? aksrt_get_user_center_tab_url('revenue')
$base_url = function_exists('jio_get_user_center_tab_url')
? jio_get_user_center_tab_url('revenue')
: home_url('/user/revenue/');
$reward_url = static function (string $tab, array $extra = []) use ($base_url): string {
return add_query_arg(array_merge(['reward_tab' => $tab], $extra), $base_url);
@@ -85,27 +85,27 @@ $format_amount = static function ($amount) use ($normalize_balance): string {
};
$commission_page = max(1, (int) ($revenue_request['commission_page'] ?? ($_GET['commission_page'] ?? 1)));
$commission_view = class_exists('\AKSRT\Payment\CommissionLedger')
? \AKSRT\Payment\CommissionLedger::get_instance()->list_entries($user_id, [
$commission_view = class_exists('\Jio\Payment\CommissionLedger')
? \Jio\Payment\CommissionLedger::get_instance()->list_entries($user_id, [
'per_page' => 10,
'page' => $commission_page,
])
: ['items' => [], 'total' => 0, 'max_pages' => 1, 'page' => 1];
$commission_items = (array) ($commission_view['items'] ?? []);
$user_page = max(1, (int) ($_GET['user_page'] ?? 1));
$user_view = class_exists('\AKSRT\Payment\ReferralAttribution')
? \AKSRT\Payment\ReferralAttribution::get_instance()->list_referred_users($user_id, $user_page, 10)
$user_view = class_exists('\Jio\Payment\ReferralAttribution')
? \Jio\Payment\ReferralAttribution::get_instance()->list_referred_users($user_id, $user_page, 10)
: ['items' => [], 'total' => 0, 'max_pages' => 1, 'page' => 1];
$user_total_pages = max(1, (int) ($user_view['max_pages'] ?? 1));
if ($user_page > $user_total_pages && class_exists('\AKSRT\Payment\ReferralAttribution')) {
if ($user_page > $user_total_pages && class_exists('\Jio\Payment\ReferralAttribution')) {
$user_page = $user_total_pages;
$user_view = \AKSRT\Payment\ReferralAttribution::get_instance()->list_referred_users($user_id, $user_page, 10);
$user_view = \Jio\Payment\ReferralAttribution::get_instance()->list_referred_users($user_id, $user_page, 10);
}
$commission_total_pages = max(1, (int) ($commission_view['max_pages'] ?? ceil(max(1, (int) ($commission_view['total'] ?? 0)) / 10)));
if ($commission_page > $commission_total_pages) {
$commission_page = $commission_total_pages;
if (class_exists('\AKSRT\Payment\CommissionLedger')) {
$commission_view = \AKSRT\Payment\CommissionLedger::get_instance()->list_entries($user_id, [
if (class_exists('\Jio\Payment\CommissionLedger')) {
$commission_view = \Jio\Payment\CommissionLedger::get_instance()->list_entries($user_id, [
'per_page' => 10,
'page' => $commission_page,
]);
@@ -113,8 +113,8 @@ if ($commission_page > $commission_total_pages) {
}
$commission_items = (array) ($commission_view['items'] ?? []);
$status_labels = [
'credited' => __('已入账', 'aksrt'),
'cancelled' => __('已退款', 'aksrt'),
'credited' => __('已入账', 'jio'),
'cancelled' => __('已退款', 'jio'),
];
?>
<?php
@@ -130,53 +130,53 @@ $pane_is_active = static function (string $tab) use ($active_reward_tab): bool {
return $active_reward_tab === $tab;
};
?>
<div class="uc-revenue-panel" data-aksrt-revenue-page>
<div class="uc-revenue-panel" data-jio-revenue-page>
<?php if ($affiliate_on) : ?>
<section class="uc-commission-summary" aria-label="<?php esc_attr_e('佣金概览', 'aksrt'); ?>">
<section class="uc-commission-summary" aria-label="<?php esc_attr_e('佣金概览', 'jio'); ?>">
<article class="uc-commission-card uc-commission-card--ratio">
<div class="uc-commission-card__body">
<span><?php esc_html_e('佣金比例', 'aksrt'); ?></span>
<span><?php esc_html_e('佣金比例', 'jio'); ?></span>
<strong><?php echo esc_html((string) $commission_ratio); ?><small>%</small></strong>
<p><?php echo $commission_ratio > 0 ? esc_html__('普通用户推广订单返佣比例', 'aksrt') : esc_html__('暂未参与', 'aksrt'); ?></p>
<p><?php echo $commission_ratio > 0 ? esc_html__('普通用户推广订单返佣比例', 'jio') : esc_html__('暂未参与', 'jio'); ?></p>
</div>
</article>
<article class="uc-commission-card uc-commission-card--balance">
<div class="uc-commission-card__body">
<span><?php esc_html_e('我的佣金', 'aksrt'); ?></span>
<span><?php esc_html_e('我的佣金', 'jio'); ?></span>
<strong><small>¥</small><?php echo esc_html($pool_amount); ?></strong>
<p class="uc-commission-card__meta">
<span><?php printf(esc_html__('累计佣金 ¥%s', 'aksrt'), esc_html($total_amount)); ?></span>
<span><?php printf(esc_html__('已提现 ¥%s', 'aksrt'), esc_html($withdrawn_amount)); ?></span>
<span><?php printf(esc_html__('累计佣金 ¥%s', 'jio'), esc_html($total_amount)); ?></span>
<span><?php printf(esc_html__('已提现 ¥%s', 'jio'), esc_html($withdrawn_amount)); ?></span>
</p>
</div>
<?php if ($withdraw_on) : ?>
<button type="button" class="uc-commission-card__action" data-aksrt-withdraw-open data-aksrt-withdraw-source="commission" data-withdraw-min="<?php echo esc_attr($withdraw_min); ?>" data-withdraw-remaining-amount="<?php echo esc_attr((string) ($commission_withdraw_usage['remaining_amount'] ?? '0.00')); ?>" data-withdraw-remaining-count="<?php echo esc_attr((string) ($commission_withdraw_usage['remaining_count'] ?? 0)); ?>"><?php esc_html_e('立即提现', 'aksrt'); ?><i class="fa fas fa-angle-right" aria-hidden="true"></i></button>
<button type="button" class="uc-commission-card__action" data-jio-withdraw-open data-jio-withdraw-source="commission" data-withdraw-min="<?php echo esc_attr($withdraw_min); ?>" data-withdraw-remaining-amount="<?php echo esc_attr((string) ($commission_withdraw_usage['remaining_amount'] ?? '0.00')); ?>" data-withdraw-remaining-count="<?php echo esc_attr((string) ($commission_withdraw_usage['remaining_count'] ?? 0)); ?>"><?php esc_html_e('立即提现', 'jio'); ?><i class="fa fas fa-angle-right" aria-hidden="true"></i></button>
<?php endif; ?>
</article>
</section>
<?php endif; ?>
<section class="uc-reward-area" aria-labelledby="uc-reward-area-title">
<div class="uc-reward-area__heading">
<h3 id="uc-reward-area-title"><?php esc_html_e('推广收益', 'aksrt'); ?></h3>
<span><?php echo esc_html($affiliate_on ? __('推广链接、佣金订单与推广用户', 'aksrt') : __('推广链接与推广用户', 'aksrt')); ?></span>
<h3 id="uc-reward-area-title"><?php esc_html_e('推广收益', 'jio'); ?></h3>
<span><?php echo esc_html($affiliate_on ? __('推广链接、佣金订单与推广用户', 'jio') : __('推广链接与推广用户', 'jio')); ?></span>
</div>
<nav class="uc-reward-tabs" aria-label="<?php esc_attr_e('收益明细', 'aksrt'); ?>">
<a data-reward-tab="detail" <?php echo $pane_is_active('detail') ? 'aria-current="page"' : ''; ?> class="<?php echo $pane_is_active('detail') ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('detail')); ?>"><?php esc_html_e('推广详情', 'aksrt'); ?></a>
<?php if ($affiliate_on) : ?><a data-reward-tab="orders" <?php echo $pane_is_active('orders') ? 'aria-current="page"' : ''; ?> class="<?php echo $pane_is_active('orders') ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('orders')); ?>"><?php esc_html_e('佣金明细', 'aksrt'); ?></a><?php endif; ?>
<a data-reward-tab="users" <?php echo $pane_is_active('users') ? 'aria-current="page"' : ''; ?> class="<?php echo $pane_is_active('users') ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('users')); ?>"><?php esc_html_e('推广用户', 'aksrt'); ?></a>
<nav class="uc-reward-tabs" aria-label="<?php esc_attr_e('收益明细', 'jio'); ?>">
<a data-reward-tab="detail" <?php echo $pane_is_active('detail') ? 'aria-current="page"' : ''; ?> class="<?php echo $pane_is_active('detail') ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('detail')); ?>"><?php esc_html_e('推广详情', 'jio'); ?></a>
<?php if ($affiliate_on) : ?><a data-reward-tab="orders" <?php echo $pane_is_active('orders') ? 'aria-current="page"' : ''; ?> class="<?php echo $pane_is_active('orders') ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('orders')); ?>"><?php esc_html_e('佣金明细', 'jio'); ?></a><?php endif; ?>
<a data-reward-tab="users" <?php echo $pane_is_active('users') ? 'aria-current="page"' : ''; ?> class="<?php echo $pane_is_active('users') ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('users')); ?>"><?php esc_html_e('推广用户', 'jio'); ?></a>
</nav>
<div class="uc-reward-pane uc-reward-pane--detail" data-reward-pane="detail"<?php echo $pane_is_active('detail') ? '' : ' hidden'; ?>>
<div class="uc-revenue-summary-list">
<div class="uc-revenue-summary-row uc-revenue-summary-row--link">
<span><?php esc_html_e('推广链接', 'aksrt'); ?></span>
<input type="text" readonly data-affiliate-link value="<?php echo esc_attr($affiliate_link_url); ?>" aria-label="<?php esc_attr_e('推广链接', 'aksrt'); ?>">
<button type="button" class="btn-primary btn-sm" data-affiliate-copy><?php esc_html_e('复制链接', 'aksrt'); ?></button>
<?php if (!empty($affiliate['poster']['enabled'])) : ?><button type="button" class="btn-outline btn-sm" data-affiliate-poster hidden><?php esc_html_e('推广海报', 'aksrt'); ?></button><?php endif; ?>
<span><?php esc_html_e('推广链接', 'jio'); ?></span>
<input type="text" readonly data-affiliate-link value="<?php echo esc_attr($affiliate_link_url); ?>" aria-label="<?php esc_attr_e('推广链接', 'jio'); ?>">
<button type="button" class="btn-primary btn-sm" data-affiliate-copy><?php esc_html_e('复制链接', 'jio'); ?></button>
<?php if (!empty($affiliate['poster']['enabled'])) : ?><button type="button" class="btn-outline btn-sm" data-affiliate-poster hidden><?php esc_html_e('推广海报', 'jio'); ?></button><?php endif; ?>
</div>
<?php if ($affiliate_on) : ?>
<div class="uc-revenue-summary-row"><span><?php esc_html_e('佣金比例', 'aksrt'); ?></span><strong data-affiliate-ratio><?php echo esc_html((string) $commission_ratio); ?>%</strong></div>
<div class="uc-revenue-summary-row uc-revenue-summary-row--total"><span><?php esc_html_e('累计佣金', 'aksrt'); ?></span><div><strong><?php printf(esc_html__('累计 %s 元', 'aksrt'), esc_html($total_amount)); ?></strong><strong><?php printf(esc_html__('已提现 %s 元', 'aksrt'), esc_html($withdrawn_amount)); ?></strong></div></div>
<div class="uc-revenue-summary-row"><span><?php esc_html_e('佣金比例', 'jio'); ?></span><strong data-affiliate-ratio><?php echo esc_html((string) $commission_ratio); ?>%</strong></div>
<div class="uc-revenue-summary-row uc-revenue-summary-row--total"><span><?php esc_html_e('累计佣金', 'jio'); ?></span><div><strong><?php printf(esc_html__('累计 %s 元', 'jio'), esc_html($total_amount)); ?></strong><strong><?php printf(esc_html__('已提现 %s 元', 'jio'), esc_html($withdrawn_amount)); ?></strong></div></div>
<div class="uc-revenue-summary-row uc-revenue-summary-row--explain"><span><?php echo esc_html($details_title); ?></span><div class="uc-reward-richtext"><?php echo wp_kses_post(wpautop($details_text)); ?></div></div>
<?php endif; ?>
</div>
@@ -184,34 +184,34 @@ $pane_is_active = static function (string $tab) use ($active_reward_tab): bool {
<?php if ($affiliate_on) : ?>
<div class="uc-reward-pane" data-reward-pane="orders"<?php echo $pane_is_active('orders') ? '' : ' hidden'; ?>>
<div class="uc-reward-list-heading"><div><h4><?php esc_html_e('佣金订单', 'aksrt'); ?></h4><p><?php esc_html_e('每页显示 10 条佣金记录。', 'aksrt'); ?></p></div><strong><?php printf(esc_html__('%d 条', 'aksrt'), (int) ($commission_view['total'] ?? 0)); ?></strong></div>
<div class="uc-reward-list-heading"><div><h4><?php esc_html_e('佣金订单', 'jio'); ?></h4><p><?php esc_html_e('每页显示 10 条佣金记录。', 'jio'); ?></p></div><strong><?php printf(esc_html__('%d 条', 'jio'), (int) ($commission_view['total'] ?? 0)); ?></strong></div>
<?php if ($commission_items) : ?>
<div class="uc-commission-list">
<?php foreach ($commission_items as $item) :
$status = sanitize_key((string) ($item['status'] ?? 'pending'));
$source_user = !empty($item['source_user_id']) ? get_userdata((int) $item['source_user_id']) : null;
$source_name = $source_user instanceof WP_User ? $source_user->display_name : __('推广用户', 'aksrt');
$source_name = $source_user instanceof WP_User ? $source_user->display_name : __('推广用户', 'jio');
$commission_minor = $signed_balance_minor($item['original_amount'] ?? '0') + $signed_balance_minor($item['adjustment_total'] ?? '0');
$commission_amount = \AKSRT\Ledger\AssetAmount::decimal_from_minor(max(0, $commission_minor));
$commission_amount = \Jio\Ledger\AssetAmount::decimal_from_minor(max(0, $commission_minor));
?>
<article class="uc-commission-row"><span class="uc-commission-row__icon"><i class="fa fas fa-file-alt" aria-hidden="true"></i></span><div class="uc-commission-row__main"><strong><?php echo esc_html($source_name); ?></strong><span><?php printf(esc_html__('订单 %s', 'aksrt'), esc_html((string) ($item['order_number'] ?? '-'))); ?></span><time><?php echo esc_html((string) ($item['created_at'] ?? '')); ?></time></div><div class="uc-commission-row__value"><strong><?php echo esc_html($format_amount($commission_amount)); ?></strong><span class="is-<?php echo esc_attr($status); ?>"><?php echo esc_html($status_labels[$status] ?? $status); ?></span></div></article>
<article class="uc-commission-row"><span class="uc-commission-row__icon"><i class="fa fas fa-file-alt" aria-hidden="true"></i></span><div class="uc-commission-row__main"><strong><?php echo esc_html($source_name); ?></strong><span><?php printf(esc_html__('订单 %s', 'jio'), esc_html((string) ($item['order_number'] ?? '-'))); ?></span><time><?php echo esc_html((string) ($item['created_at'] ?? '')); ?></time></div><div class="uc-commission-row__value"><strong><?php echo esc_html($format_amount($commission_amount)); ?></strong><span class="is-<?php echo esc_attr($status); ?>"><?php echo esc_html($status_labels[$status] ?? $status); ?></span></div></article>
<?php endforeach; ?>
</div>
<?php if ($commission_total_pages > 1) : ?><nav class="uc-reward-pagination" aria-label="<?php esc_attr_e('佣金明细分页', 'aksrt'); ?>"><?php for ($i = 1; $i <= $commission_total_pages; $i++) : ?><a class="<?php echo $i === $commission_page ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('orders', ['commission_page' => $i])); ?>"><?php echo esc_html((string) $i); ?></a><?php endfor; ?></nav><?php endif; ?>
<?php else : ?><p class="uc-reward-empty"><?php esc_html_e('暂无佣金订单', 'aksrt'); ?></p><?php endif; ?>
<?php if ($commission_total_pages > 1) : ?><nav class="uc-reward-pagination" aria-label="<?php esc_attr_e('佣金明细分页', 'jio'); ?>"><?php for ($i = 1; $i <= $commission_total_pages; $i++) : ?><a class="<?php echo $i === $commission_page ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('orders', ['commission_page' => $i])); ?>"><?php echo esc_html((string) $i); ?></a><?php endfor; ?></nav><?php endif; ?>
<?php else : ?><p class="uc-reward-empty"><?php esc_html_e('暂无佣金订单', 'jio'); ?></p><?php endif; ?>
</div>
<?php endif; ?>
<div class="uc-reward-pane" data-reward-pane="users"<?php echo $pane_is_active('users') ? '' : ' hidden'; ?>>
<div class="uc-reward-list-heading"><div><h4><?php esc_html_e('推广用户', 'aksrt'); ?></h4><p><?php esc_html_e('通过你的 ref 推广链接完成绑定的用户。', 'aksrt'); ?></p></div><strong><?php printf(esc_html__('%d 人', 'aksrt'), (int) ($user_view['total'] ?? 0)); ?></strong></div>
<div class="uc-reward-list-heading"><div><h4><?php esc_html_e('推广用户', 'jio'); ?></h4><p><?php esc_html_e('通过你的 ref 推广链接完成绑定的用户。', 'jio'); ?></p></div><strong><?php printf(esc_html__('%d 人', 'jio'), (int) ($user_view['total'] ?? 0)); ?></strong></div>
<?php if (!empty($user_view['items'])) : ?>
<div class="uc-revenue-user-list">
<?php foreach ($user_view['items'] as $item) : ?>
<article class="uc-revenue-user-row"><img src="<?php echo esc_url((string) ($item['avatar'] ?? '')); ?>" alt=""><div><strong><?php echo esc_html((string) ($item['name'] ?? __('推广用户', 'aksrt'))); ?></strong><small><?php echo esc_html((string) ($item['bound_at'] ?? '')); ?></small></div><span><?php esc_html_e('已绑定', 'aksrt'); ?></span></article>
<article class="uc-revenue-user-row"><img src="<?php echo esc_url((string) ($item['avatar'] ?? '')); ?>" alt=""><div><strong><?php echo esc_html((string) ($item['name'] ?? __('推广用户', 'jio'))); ?></strong><small><?php echo esc_html((string) ($item['bound_at'] ?? '')); ?></small></div><span><?php esc_html_e('已绑定', 'jio'); ?></span></article>
<?php endforeach; ?>
</div>
<?php if ($user_total_pages > 1) : ?><nav class="uc-reward-pagination" aria-label="<?php esc_attr_e('推广用户分页', 'aksrt'); ?>"><?php for ($i = 1; $i <= $user_total_pages; $i++) : ?><a class="<?php echo $i === $user_page ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('users', ['user_page' => $i])); ?>"><?php echo esc_html((string) $i); ?></a><?php endfor; ?></nav><?php endif; ?>
<?php else : ?><p class="uc-reward-empty"><?php esc_html_e('暂无推广用户', 'aksrt'); ?></p><?php endif; ?>
<?php if ($user_total_pages > 1) : ?><nav class="uc-reward-pagination" aria-label="<?php esc_attr_e('推广用户分页', 'jio'); ?>"><?php for ($i = 1; $i <= $user_total_pages; $i++) : ?><a class="<?php echo $i === $user_page ? 'is-active' : ''; ?>" href="<?php echo esc_url($reward_url('users', ['user_page' => $i])); ?>"><?php echo esc_html((string) $i); ?></a><?php endfor; ?></nav><?php endif; ?>
<?php else : ?><p class="uc-reward-empty"><?php esc_html_e('暂无推广用户', 'jio'); ?></p><?php endif; ?>
</div>
</section>
</div>
@@ -2,7 +2,7 @@
/**
* User center profile settings part (orchestrator).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -2,7 +2,7 @@
/**
* User center profile sidebar orchestrator.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -15,8 +15,8 @@ require __DIR__ . '/sidebar-vip.php';
require __DIR__ . '/sidebar-commerce.php';
require __DIR__ . '/sidebar-creator.php';
require __DIR__ . '/sidebar-nav.php';
$drawer_trigger_icon = aksrt_icon_markup('zibsvg-menu');
$drawer_trigger_icon = jio_icon_markup('zibsvg-menu');
?>
<button type="button" class="uc-sidebar__drawer-trigger" id="uc-drawer-trigger" aria-label="<?php esc_attr_e('打开导航', 'aksrt'); ?>">
<button type="button" class="uc-sidebar__drawer-trigger" id="uc-drawer-trigger" aria-label="<?php esc_attr_e('打开导航', 'jio'); ?>">
<?php echo $drawer_trigger_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</button>
@@ -2,10 +2,10 @@
/**
* User center ticket (工单) panel.
*
* 数据全部来自 /aksrt/v1/tickets* REST;本文件只输出容器、筛选控件与首屏骨架,
* 交互在 assets/js/ticket-center.js(附件 / 公告 / 催单配置取自 aksrtData.ticket)。
* 数据全部来自 /jio/v1/tickets* REST;本文件只输出容器、筛选控件与首屏骨架,
* 交互在 assets/js/ticket-center.js(附件 / 公告 / 催单配置取自 jioData.ticket)。
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -14,84 +14,84 @@ $context = is_array($args['context'] ?? null) ? $args['context'] : [];
$user_id = (int) ($context['user_id'] ?? get_current_user_id());
if ($user_id <= 0) {
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'aksrt') . '</div>';
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('请先登录', 'jio') . '</div>';
return;
}
$enabled = class_exists('\AKSRT\Ticket\TicketSettings') && \AKSRT\Ticket\TicketSettings::enabled();
$enabled = class_exists('\Jio\Ticket\TicketSettings') && \Jio\Ticket\TicketSettings::enabled();
if (!$enabled) {
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('工单功能暂未开启', 'aksrt') . '</div>';
echo '<div class="uc-panel-empty muted-2-color">' . esc_html__('工单功能暂未开启', 'jio') . '</div>';
return;
}
$statuses = class_exists('\AKSRT\Ticket\TicketStatusService')
? \AKSRT\Ticket\TicketStatusService::all()
$statuses = class_exists('\Jio\Ticket\TicketStatusService')
? \Jio\Ticket\TicketStatusService::all()
: [];
$types = class_exists('\AKSRT\Ticket\TicketTypeService')
? \AKSRT\Ticket\TicketTypeService::public_list()
$types = class_exists('\Jio\Ticket\TicketTypeService')
? \Jio\Ticket\TicketTypeService::public_list()
: [];
?>
<div class="aksrt-tickets-page uc-tickets-panel" data-aksrt-ticket-center>
<div class="jio-tickets-page uc-tickets-panel" data-jio-ticket-center>
<header class="uc-tickets-panel__head">
<div class="uc-tickets-panel__title-wrap">
<p class="aksrt-tickets-page__eyebrow"><?php esc_html_e('我的服务', 'aksrt'); ?></p>
<p class="jio-tickets-page__eyebrow"><?php esc_html_e('我的服务', 'jio'); ?></p>
<div class="uc-tickets-panel__title font-bold em12">
<i class="fa fas fa-headset uc-tickets-panel__title-icon" aria-hidden="true"></i>
<?php esc_html_e('工单中心', 'aksrt'); ?>
<?php esc_html_e('工单中心', 'jio'); ?>
</div>
<p class="muted-2-color em09 mt3"><?php esc_html_e('提交问题工单,跟踪处理进度并与客服沟通。', 'aksrt'); ?></p>
<p class="muted-2-color em09 mt3"><?php esc_html_e('提交问题工单,跟踪处理进度并与客服沟通。', 'jio'); ?></p>
</div>
<button class="btn-primary aksrt-tickets-page__create" type="button" data-aksrt-ticket-create>
<i class="fa fas fa-plus" aria-hidden="true"></i><?php esc_html_e('提交工单', 'aksrt'); ?>
<button class="btn-primary jio-tickets-page__create" type="button" data-jio-ticket-create>
<i class="fa fas fa-plus" aria-hidden="true"></i><?php esc_html_e('提交工单', 'jio'); ?>
</button>
</header>
<?php // 统计卡同时是状态快捷筛选:点击按该状态过滤,再次点击取消。 ?>
<div class="aksrt-tickets-page__stats" data-aksrt-ticket-stats role="group" aria-label="<?php esc_attr_e('按状态筛选', 'aksrt'); ?>">
<button type="button" class="aksrt-tickets-page__stat is-active" data-aksrt-ticket-stat="" aria-pressed="true">
<span><?php esc_html_e('全部', 'aksrt'); ?></span><strong>0</strong>
<div class="jio-tickets-page__stats" data-jio-ticket-stats role="group" aria-label="<?php esc_attr_e('按状态筛选', 'jio'); ?>">
<button type="button" class="jio-tickets-page__stat is-active" data-jio-ticket-stat="" aria-pressed="true">
<span><?php esc_html_e('全部', 'jio'); ?></span><strong>0</strong>
</button>
<?php foreach ($statuses as $status) : ?>
<button
type="button"
class="aksrt-tickets-page__stat"
data-aksrt-ticket-stat="<?php echo esc_attr((string) $status['status_key']); ?>"
style="--aksrt-ticket-color: <?php echo esc_attr((string) $status['color']); ?>"
class="jio-tickets-page__stat"
data-jio-ticket-stat="<?php echo esc_attr((string) $status['status_key']); ?>"
style="--jio-ticket-color: <?php echo esc_attr((string) $status['color']); ?>"
aria-pressed="false"
>
<span><i class="aksrt-tickets-page__stat-dot" aria-hidden="true"></i><?php echo esc_html((string) $status['name']); ?></span><strong>0</strong>
<span><i class="jio-tickets-page__stat-dot" aria-hidden="true"></i><?php echo esc_html((string) $status['name']); ?></span><strong>0</strong>
</button>
<?php endforeach; ?>
</div>
<form class="aksrt-tickets-page__search" data-aksrt-tickets-search role="search">
<label class="aksrt-tickets-page__search-box">
<span class="screen-reader-text"><?php esc_html_e('按工单号或标题查找', 'aksrt'); ?></span>
<form class="jio-tickets-page__search" data-jio-tickets-search role="search">
<label class="jio-tickets-page__search-box">
<span class="screen-reader-text"><?php esc_html_e('按工单号或标题查找', 'jio'); ?></span>
<i class="fa fas fa-search" aria-hidden="true"></i>
<input type="search" maxlength="60" autocomplete="off" placeholder="<?php esc_attr_e('搜索工单号或标题', 'aksrt'); ?>">
<input type="search" maxlength="60" autocomplete="off" placeholder="<?php esc_attr_e('搜索工单号或标题', 'jio'); ?>">
</label>
<select data-aksrt-ticket-filter="status" aria-label="<?php esc_attr_e('工单状态', 'aksrt'); ?>">
<option value=""><?php esc_html_e('全部状态', 'aksrt'); ?></option>
<select data-jio-ticket-filter="status" aria-label="<?php esc_attr_e('工单状态', 'jio'); ?>">
<option value=""><?php esc_html_e('全部状态', 'jio'); ?></option>
<?php foreach ($statuses as $status) : ?>
<option value="<?php echo esc_attr((string) $status['status_key']); ?>"><?php echo esc_html((string) $status['name']); ?></option>
<?php endforeach; ?>
</select>
<?php if ($types !== []) : ?>
<select data-aksrt-ticket-filter="ticket_type_id" aria-label="<?php esc_attr_e('工单部门', 'aksrt'); ?>">
<option value=""><?php esc_html_e('全部部门', 'aksrt'); ?></option>
<select data-jio-ticket-filter="ticket_type_id" aria-label="<?php esc_attr_e('工单部门', 'jio'); ?>">
<option value=""><?php esc_html_e('全部部门', 'jio'); ?></option>
<?php foreach ($types as $type) : ?>
<option value="<?php echo esc_attr((string) $type['id']); ?>"><?php echo esc_html((string) $type['name']); ?></option>
<?php endforeach; ?>
</select>
<?php endif; ?>
<button class="aksrt-tickets-page__reset" type="button" data-aksrt-ticket-reset hidden><?php esc_html_e('清除筛选', 'aksrt'); ?></button>
<button class="jio-tickets-page__reset" type="button" data-jio-ticket-reset hidden><?php esc_html_e('清除筛选', 'jio'); ?></button>
</form>
<div class="aksrt-tickets-page__list" data-aksrt-ticket-list aria-live="polite" aria-busy="true">
<div class="jio-tickets-page__list" data-jio-ticket-list aria-live="polite" aria-busy="true">
<?php // 首屏骨架:沿用全站 .post_ajax_loader + .is-loading 契约,JS 拿到数据后整体替换。 ?>
<div class="post_ajax_loader is-loading" aria-hidden="true">
<?php for ($i = 0; $i < 3; $i++) : ?>
<div class="aksrt-tickets-page__card is-placeholder">
<div class="jio-tickets-page__card is-placeholder">
<div class="placeholder s1"></div>
<div class="placeholder k1"></div>
<div class="placeholder k3" style="width: 42%;"></div>
@@ -100,14 +100,14 @@ $types = class_exists('\AKSRT\Ticket\TicketTypeService')
</div>
</div>
<nav class="aksrt-tickets-page__pagination" data-aksrt-ticket-pagination aria-label="<?php esc_attr_e('工单分页', 'aksrt'); ?>" hidden></nav>
<nav class="jio-tickets-page__pagination" data-jio-ticket-pagination aria-label="<?php esc_attr_e('工单分页', 'jio'); ?>" hidden></nav>
<?php
// 人机验证挂载点(提交工单 / 回复):场景未启用时 aksrt_render_captcha 无输出,
// 人机验证挂载点(提交工单 / 回复):场景未启用时 jio_render_captcha 无输出,
// ticket-center.js 以挂载点存在与否决定是否先过验证。
if (function_exists('aksrt_render_captcha')) {
aksrt_render_captcha('ticket_create');
aksrt_render_captcha('ticket_reply');
if (function_exists('jio_render_captcha')) {
jio_render_captcha('ticket_create');
jio_render_captcha('ticket_reply');
}
?>
</div>
@@ -2,7 +2,7 @@
/**
* User center VIP panel entry (maps tab=vip).
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -2,7 +2,7 @@
/**
* User center account settings rows and reference-theme account dialogs.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -11,33 +11,33 @@ $account_user = isset($target_user) && $target_user instanceof WP_User ? $target
$account_user_id = $account_user instanceof WP_User ? (int) $account_user->ID : (int) ($user_id ?? 0);
$account_email = $account_user instanceof WP_User ? (string) $account_user->user_email : '';
$account_phone = $account_user_id > 0 ? (string) get_user_meta($account_user_id, 'phone_number', true) : '';
$account_phone_display = function_exists('aksrt_phone_mask_display') ? aksrt_phone_mask_display($account_phone) : $account_phone;
$account_phone_display = function_exists('jio_phone_mask_display') ? jio_phone_mask_display($account_phone) : $account_phone;
$account_oauth_new = $account_user_id > 0 && get_user_meta($account_user_id, 'oauth_new', true);
$user_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
$sms_settings = class_exists('\AKSRT\Sms\SMS') ? \AKSRT\Sms\SMS::get_instance()->get_provider_config() : [];
$user_settings = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_all() : [];
$sms_settings = class_exists('\Jio\Sms\SMS') ? \Jio\Sms\SMS::get_instance()->get_provider_config() : [];
$phone_available = !empty($user_settings['bind_phone']) && (($sms_settings['sms_sdk'] ?? 'null') !== 'null');
$agreement = function_exists('aksrt_get_auth_agreement_view') ? aksrt_get_auth_agreement_view() : ['enabled' => false, 'required' => false, 'label_html' => ''];
$agreement = function_exists('jio_get_auth_agreement_view') ? jio_get_auth_agreement_view() : ['enabled' => false, 'required' => false, 'label_html' => ''];
$email_verify_required = $account_email !== '' && !empty($user_settings['email_set_captch']);
$reset_channel = class_exists('\\AKSRT\\Settings\\Settings') ? \AKSRT\Settings\Settings::reset_password_verification_type() : 'email';
$sign_in_available = !class_exists('\\AKSRT\\Settings\\Settings') || (!\AKSRT\Settings\Settings::close_sign() && !\AKSRT\Settings\Settings::close_signin());
$reset_channel = class_exists('\\Jio\\Settings\\Settings') ? \Jio\Settings\Settings::reset_password_verification_type() : 'email';
$sign_in_available = !class_exists('\\Jio\\Settings\\Settings') || (!\Jio\Settings\Settings::close_sign() && !\Jio\Settings\Settings::close_signin());
$can_recover_password = $sign_in_available && ($reset_channel === 'email_phone'
? ($account_email !== '' || $account_phone !== '')
: ($reset_channel === 'phone' ? $account_phone !== '' : $account_email !== ''));
$recovery_target = $reset_channel === 'phone' ? $account_phone : ($account_email !== '' ? $account_email : $account_phone);
$recovery_channel = $reset_channel === 'email_phone' ? '' : $reset_channel;
$account_close_icon = function_exists('aksrt_icon_markup') ? aksrt_icon_markup('zibsvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$account_close_icon = function_exists('jio_icon_markup') ? jio_icon_markup('zibsvg-close', 'ic-close') : '<i class="fa fas fa-times" aria-hidden="true"></i>';
$render_row = static function (string $icon, string $title, string $value, string $action, string $modal, string $icon_tone, string $action_tone, bool $interactive = true): void {
?>
<div class="aksrt-account-row<?php echo $value === '' ? ' aksrt-account-row--simple' : ''; ?>">
<div class="aksrt-account-row__identity">
<span class="aksrt-account-row__icon aksrt-account-row__icon--<?php echo esc_attr($icon_tone); ?>"><i class="fa fas <?php echo esc_attr($icon); ?>" aria-hidden="true"></i></span>
<strong class="aksrt-account-row__copy"><?php echo esc_html($title); ?></strong>
<div class="jio-account-row<?php echo $value === '' ? ' jio-account-row--simple' : ''; ?>">
<div class="jio-account-row__identity">
<span class="jio-account-row__icon jio-account-row__icon--<?php echo esc_attr($icon_tone); ?>"><i class="fa fas <?php echo esc_attr($icon); ?>" aria-hidden="true"></i></span>
<strong class="jio-account-row__copy"><?php echo esc_html($title); ?></strong>
</div>
<?php if ($value !== '') : ?><div class="aksrt-account-row__value" title="<?php echo esc_attr($value); ?>"><?php echo esc_html($value); ?></div><?php endif; ?>
<?php if ($value !== '') : ?><div class="jio-account-row__value" title="<?php echo esc_attr($value); ?>"><?php echo esc_html($value); ?></div><?php endif; ?>
<?php if ($interactive) : ?>
<button type="button" class="but hollow <?php echo esc_attr($action_tone); ?> aksrt-account-row__action" data-aksrt-settings-modal="<?php echo esc_attr($modal); ?>"><?php echo esc_html($action); ?></button>
<?php else : ?><span class="aksrt-account-row__action aksrt-account-row__action--unavailable"><?php esc_html_e('暂不可修改', 'aksrt'); ?></span><?php endif; ?>
<button type="button" class="but hollow <?php echo esc_attr($action_tone); ?> jio-account-row__action" data-jio-settings-modal="<?php echo esc_attr($modal); ?>"><?php echo esc_html($action); ?></button>
<?php else : ?><span class="jio-account-row__action jio-account-row__action--unavailable"><?php esc_html_e('暂不可修改', 'jio'); ?></span><?php endif; ?>
</div>
<?php
};
@@ -46,137 +46,137 @@ $render_email_form = static function () use ($user_settings, $agreement): void {
?>
<form id="email-new-form">
<div class="mb20">
<div class="relative line-form mb10 modal-line-field"><input type="email" id="email-new" name="new_email" class="line-form-input" required><div class="scale-placeholder"><?php esc_html_e('请输入邮箱', 'aksrt'); ?></div><i class="line-form-line"></i></div>
<?php if (function_exists('aksrt_render_captcha')) : ?><?php aksrt_render_captcha('change_email'); ?><?php endif; ?>
<?php if (!empty($user_settings['email_set_captch'])) : ?><div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" id="email-code" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'aksrt'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn account-code-send" data-account-code-scene="change_email"><?php esc_html_e('发送验证码', 'aksrt'); ?></button></span><i class="line-form-line"></i></div><?php endif; ?>
<div class="relative line-form mb10 modal-line-field"><input type="email" id="email-new" name="new_email" class="line-form-input" required><div class="scale-placeholder"><?php esc_html_e('请输入邮箱', 'jio'); ?></div><i class="line-form-line"></i></div>
<?php if (function_exists('jio_render_captcha')) : ?><?php jio_render_captcha('change_email'); ?><?php endif; ?>
<?php if (!empty($user_settings['email_set_captch'])) : ?><div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" id="email-code" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'jio'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn account-code-send" data-account-code-scene="change_email"><?php esc_html_e('发送验证码', 'jio'); ?></button></span><i class="line-form-line"></i></div><?php endif; ?>
</div>
<?php if (!empty($agreement['enabled'])) : ?><label class="form-checkbox muted-color mb20"><input type="checkbox" name="agree_terms" value="1"<?php echo !empty($agreement['required']) ? ' required' : ' checked'; ?>> <?php echo wp_kses_post($agreement['label_html']); ?></label><?php endif; ?>
<button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-check" aria-hidden="true"></i> <?php esc_html_e('确认提交', 'aksrt'); ?></button>
<button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-check" aria-hidden="true"></i> <?php esc_html_e('确认提交', 'jio'); ?></button>
</form>
<?php
};
$render_phone_form = static function () use ($agreement): void {
?>
<form id="aksrt-bind-phone-form">
<form id="jio-bind-phone-form">
<div class="mb20">
<div class="relative line-form mb10 modal-line-field"><input type="tel" id="bind-phone-input" name="phone" class="line-form-input" inputmode="tel" autocomplete="tel" required><div class="scale-placeholder"><?php esc_html_e('手机号', 'aksrt'); ?></div><i class="line-form-line"></i></div>
<?php if (function_exists('aksrt_render_captcha')) : ?><?php aksrt_render_captcha('bind_phone'); ?><?php endif; ?>
<div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" id="bind-phone-code" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'aksrt'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn" data-aksrt-sms-trigger data-aksrt-sms-scene="bind_new_phone"><?php esc_html_e('发送验证码', 'aksrt'); ?></button></span><i class="line-form-line"></i></div>
<div class="relative line-form mb10 modal-line-field"><input type="tel" id="bind-phone-input" name="phone" class="line-form-input" inputmode="tel" autocomplete="tel" required><div class="scale-placeholder"><?php esc_html_e('手机号', 'jio'); ?></div><i class="line-form-line"></i></div>
<?php if (function_exists('jio_render_captcha')) : ?><?php jio_render_captcha('bind_phone'); ?><?php endif; ?>
<div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" id="bind-phone-code" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'jio'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn" data-jio-sms-trigger data-jio-sms-scene="bind_new_phone"><?php esc_html_e('发送验证码', 'jio'); ?></button></span><i class="line-form-line"></i></div>
</div>
<?php if (!empty($agreement['enabled'])) : ?><label class="form-checkbox muted-color mb20"><input type="checkbox" name="agree_terms" value="1"<?php echo !empty($agreement['required']) ? ' required' : ' checked'; ?>> <?php echo wp_kses_post($agreement['label_html']); ?></label><?php endif; ?>
<button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-check" aria-hidden="true"></i> <?php esc_html_e('确认提交', 'aksrt'); ?></button>
<button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-check" aria-hidden="true"></i> <?php esc_html_e('确认提交', 'jio'); ?></button>
</form>
<?php
};
?>
<section class="aksrt-account-settings" data-aksrt-settings-root data-aksrt-captcha-scope>
<div class="aksrt-account-settings__section">
<div class="aksrt-account-settings__heading"><div><h3 class="title-h-left"><b><?php esc_html_e('绑定邮箱', 'aksrt'); ?></b></h3><p><?php esc_html_e('绑定邮箱账号,及时接收订单、审核等重要信息', 'aksrt'); ?></p></div></div>
<div class="aksrt-account-list"><?php $render_row('fa-envelope', __('邮箱', 'aksrt'), $account_email !== '' ? $account_email : __('暂未绑定', 'aksrt'), $account_email !== '' ? __('修改', 'aksrt') : __('绑定', 'aksrt'), 'email', 'blue', $account_email !== '' ? 'c-yellow-2' : 'c-blue'); ?></div>
<section class="jio-account-settings" data-jio-settings-root data-jio-captcha-scope>
<div class="jio-account-settings__section">
<div class="jio-account-settings__heading"><div><h3 class="title-h-left"><b><?php esc_html_e('绑定邮箱', 'jio'); ?></b></h3><p><?php esc_html_e('绑定邮箱账号,及时接收订单、审核等重要信息', 'jio'); ?></p></div></div>
<div class="jio-account-list"><?php $render_row('fa-envelope', __('邮箱', 'jio'), $account_email !== '' ? $account_email : __('暂未绑定', 'jio'), $account_email !== '' ? __('修改', 'jio') : __('绑定', 'jio'), 'email', 'blue', $account_email !== '' ? 'c-yellow-2' : 'c-blue'); ?></div>
</div>
<?php if ($account_phone !== '' || $phone_available) : ?>
<div class="aksrt-account-settings__section">
<div class="aksrt-account-settings__heading"><div><h3 class="title-h-left"><b><?php esc_html_e('绑定手机', 'aksrt'); ?></b></h3><p><?php esc_html_e('绑定手机号,提高账户安全性', 'aksrt'); ?></p></div></div>
<div class="aksrt-account-list"><?php $render_row('fa-phone', __('手机号', 'aksrt'), $account_phone !== '' ? $account_phone_display : __('暂未绑定', 'aksrt'), $account_phone !== '' ? __('修改', 'aksrt') : __('绑定', 'aksrt'), 'phone', 'blue-2', $account_phone !== '' ? 'c-yellow' : 'c-blue', $phone_available); ?></div>
<div class="jio-account-settings__section">
<div class="jio-account-settings__heading"><div><h3 class="title-h-left"><b><?php esc_html_e('绑定手机', 'jio'); ?></b></h3><p><?php esc_html_e('绑定手机号,提高账户安全性', 'jio'); ?></p></div></div>
<div class="jio-account-list"><?php $render_row('fa-phone', __('手机号', 'jio'), $account_phone !== '' ? $account_phone_display : __('暂未绑定', 'jio'), $account_phone !== '' ? __('修改', 'jio') : __('绑定', 'jio'), 'phone', 'blue-2', $account_phone !== '' ? 'c-yellow' : 'c-blue', $phone_available); ?></div>
</div>
<?php endif; ?>
<?php require __DIR__ . '/settings-bindings.php'; ?>
<div class="aksrt-account-settings__section">
<div class="aksrt-account-settings__heading"><div><h3 class="title-h-left"><b><?php esc_html_e('账户密码', 'aksrt'); ?></b></h3><p><?php echo $account_oauth_new ? esc_html__('您还未设置过密码,请在此设置新密码', 'aksrt') : esc_html__('定期修改密码有助于账户安全', 'aksrt'); ?></p></div></div>
<div class="aksrt-account-list"><?php $render_row('fa-unlock-alt', __('账户密码', 'aksrt'), '', $account_oauth_new ? __('设置新密码', 'aksrt') : __('修改密码', 'aksrt'), 'password', 'purple', 'c-blue-2'); ?></div>
<div class="jio-account-settings__section">
<div class="jio-account-settings__heading"><div><h3 class="title-h-left"><b><?php esc_html_e('账户密码', 'jio'); ?></b></h3><p><?php echo $account_oauth_new ? esc_html__('您还未设置过密码,请在此设置新密码', 'jio') : esc_html__('定期修改密码有助于账户安全', 'jio'); ?></p></div></div>
<div class="jio-account-list"><?php $render_row('fa-unlock-alt', __('账户密码', 'jio'), '', $account_oauth_new ? __('设置新密码', 'jio') : __('修改密码', 'jio'), 'password', 'purple', 'c-blue-2'); ?></div>
</div>
<template data-aksrt-settings-modal-template="password">
<div class="aksrt-settings-modal" data-account-dialog="password" data-recovery-channel="<?php echo esc_attr($recovery_channel); ?>" data-recovery-target="<?php echo esc_attr($recovery_target); ?>">
<div class="modal-colorful-header colorful-bg jb-yellow"><button type="button" class="close" data-aksrt-modal-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><?php echo $account_close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa fas fa-unlock-alt" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10" data-account-password-title data-change-label="<?php echo esc_attr($account_oauth_new ? __('设置密码', 'aksrt') : __('修改密码', 'aksrt')); ?>" data-recovery-label="<?php esc_attr_e('重设密码', 'aksrt'); ?>"><?php echo $account_oauth_new ? esc_html__('设置密码', 'aksrt') : esc_html__('修改密码', 'aksrt'); ?></div></div></div>
<div class="aksrt-settings-modal__pane" data-account-password-pane="change">
<template data-jio-settings-modal-template="password">
<div class="jio-settings-modal" data-account-dialog="password" data-recovery-channel="<?php echo esc_attr($recovery_channel); ?>" data-recovery-target="<?php echo esc_attr($recovery_target); ?>">
<div class="modal-colorful-header colorful-bg jb-yellow"><button type="button" class="close" data-jio-modal-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><?php echo $account_close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa fas fa-unlock-alt" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10" data-account-password-title data-change-label="<?php echo esc_attr($account_oauth_new ? __('设置密码', 'jio') : __('修改密码', 'jio')); ?>" data-recovery-label="<?php esc_attr_e('重设密码', 'jio'); ?>"><?php echo $account_oauth_new ? esc_html__('设置密码', 'jio') : esc_html__('修改密码', 'jio'); ?></div></div></div>
<div class="jio-settings-modal__pane" data-account-password-pane="change">
<form id="pwd-form" autocomplete="off" novalidate>
<div class="aksrt-settings-modal__fields mb20">
<?php if (!$account_oauth_new) : ?><div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-old" name="passwordold" class="line-form-input" tabindex="1" required><div class="scale-placeholder"><?php esc_html_e('请输入原密码', 'aksrt'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-old" aria-label="<?php esc_attr_e('显示或隐藏密码', 'aksrt'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div><?php endif; ?>
<div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-new" name="password" class="line-form-input" tabindex="2" required minlength="6"><div class="scale-placeholder"><?php echo $account_oauth_new ? esc_html__('设置新密码', 'aksrt') : esc_html__('请输入新密码', 'aksrt'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-new" aria-label="<?php esc_attr_e('显示或隐藏密码', 'aksrt'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div>
<div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-confirm" name="password2" class="line-form-input" tabindex="3" required minlength="6"><div class="scale-placeholder"><?php esc_html_e('请再次输入新密码', 'aksrt'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-confirm" aria-label="<?php esc_attr_e('显示或隐藏密码', 'aksrt'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div>
<?php if (function_exists('aksrt_render_captcha')) : ?><?php aksrt_render_captcha('change_password'); ?><?php endif; ?>
<div class="jio-settings-modal__fields mb20">
<?php if (!$account_oauth_new) : ?><div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-old" name="passwordold" class="line-form-input" tabindex="1" required><div class="scale-placeholder"><?php esc_html_e('请输入原密码', 'jio'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-old" aria-label="<?php esc_attr_e('显示或隐藏密码', 'jio'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div><?php endif; ?>
<div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-new" name="password" class="line-form-input" tabindex="2" required minlength="6"><div class="scale-placeholder"><?php echo $account_oauth_new ? esc_html__('设置新密码', 'jio') : esc_html__('请输入新密码', 'jio'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-new" aria-label="<?php esc_attr_e('显示或隐藏密码', 'jio'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div>
<div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-confirm" name="password2" class="line-form-input" tabindex="3" required minlength="6"><div class="scale-placeholder"><?php esc_html_e('请再次输入新密码', 'jio'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-confirm" aria-label="<?php esc_attr_e('显示或隐藏密码', 'jio'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div>
<?php if (function_exists('jio_render_captcha')) : ?><?php jio_render_captcha('change_password'); ?><?php endif; ?>
</div>
<?php if ($account_oauth_new) : ?><input type="hidden" name="oauth_new" value="1"><?php endif; ?>
<button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-check" aria-hidden="true"></i> <span data-aksrt-settings-submit-label><?php esc_html_e('确认提交', 'aksrt'); ?></span></button>
<button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-check" aria-hidden="true"></i> <span data-jio-settings-submit-label><?php esc_html_e('确认提交', 'jio'); ?></span></button>
</form>
<?php if (!$account_oauth_new && $can_recover_password) : ?><div class="text-right mt6"><button type="button" class="em09 muted-2-color account-recovery-toggle" data-account-recovery-open><?php esc_html_e('忘记原密码?点击重设密码', 'aksrt'); ?></button></div><?php endif; ?>
<?php if (!$account_oauth_new && $can_recover_password) : ?><div class="text-right mt6"><button type="button" class="em09 muted-2-color account-recovery-toggle" data-account-recovery-open><?php esc_html_e('忘记原密码?点击重设密码', 'jio'); ?></button></div><?php endif; ?>
</div>
<?php if (!$account_oauth_new && $can_recover_password) : ?>
<div class="aksrt-settings-modal__pane" data-account-password-pane="recovery" hidden>
<div class="text-right mb10"><button type="button" class="em09 but p2-10 account-recovery-toggle" data-account-recovery-back><i class="fa fas fa-angle-left em12" aria-hidden="true"></i> <?php esc_html_e('返回使用原密码修改密码', 'aksrt'); ?></button></div>
<div class="jio-settings-modal__pane" data-account-password-pane="recovery" hidden>
<div class="text-right mb10"><button type="button" class="em09 but p2-10 account-recovery-toggle" data-account-recovery-back><i class="fa fas fa-angle-left em12" aria-hidden="true"></i> <?php esc_html_e('返回使用原密码修改密码', 'jio'); ?></button></div>
<form id="pwd-recovery-form" autocomplete="off" novalidate>
<div class="aksrt-settings-modal__fields mb20">
<div class="relative line-form mb10 modal-line-field"><input type="text" id="pwd-recovery-target" name="target" value="<?php echo esc_attr($recovery_target); ?>" class="line-form-input" autocomplete="username" required><div class="scale-placeholder"><?php esc_html_e('邮箱或手机号', 'aksrt'); ?></div><i class="line-form-line"></i></div>
<?php if (function_exists('aksrt_render_captcha')) : ?><?php aksrt_render_captcha('lostpassword'); ?><?php endif; ?>
<div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" id="pwd-recovery-code" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'aksrt'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn" data-account-recovery-send><?php esc_html_e('发送验证码', 'aksrt'); ?></button></span><i class="line-form-line"></i></div>
<div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-recovery-new" name="password" class="line-form-input" required minlength="6"><div class="scale-placeholder"><?php esc_html_e('设置新密码', 'aksrt'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-recovery-new" aria-label="<?php esc_attr_e('显示或隐藏密码', 'aksrt'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div>
<div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-recovery-confirm" name="password_confirm" class="line-form-input" required minlength="6"><div class="scale-placeholder"><?php esc_html_e('重复密码', 'aksrt'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-recovery-confirm" aria-label="<?php esc_attr_e('显示或隐藏密码', 'aksrt'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div>
<div class="jio-settings-modal__fields mb20">
<div class="relative line-form mb10 modal-line-field"><input type="text" id="pwd-recovery-target" name="target" value="<?php echo esc_attr($recovery_target); ?>" class="line-form-input" autocomplete="username" required><div class="scale-placeholder"><?php esc_html_e('邮箱或手机号', 'jio'); ?></div><i class="line-form-line"></i></div>
<?php if (function_exists('jio_render_captcha')) : ?><?php jio_render_captcha('lostpassword'); ?><?php endif; ?>
<div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" id="pwd-recovery-code" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'jio'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn" data-account-recovery-send><?php esc_html_e('发送验证码', 'jio'); ?></button></span><i class="line-form-line"></i></div>
<div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-recovery-new" name="password" class="line-form-input" required minlength="6"><div class="scale-placeholder"><?php esc_html_e('设置新密码', 'jio'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-recovery-new" aria-label="<?php esc_attr_e('显示或隐藏密码', 'jio'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div>
<div class="relative line-form mb10 modal-line-field"><input type="password" id="pwd-recovery-confirm" name="password_confirm" class="line-form-input" required minlength="6"><div class="scale-placeholder"><?php esc_html_e('重复密码', 'jio'); ?></div><button type="button" class="toggle-pwd abs-right passw" data-target="pwd-recovery-confirm" aria-label="<?php esc_attr_e('显示或隐藏密码', 'jio'); ?>"><i class="fa fas fa-eye" aria-hidden="true"></i></button><i class="line-form-line"></i></div>
</div>
<button type="submit" class="but jb-green padding-lg btn-block"><i class="fa fas fa-check" aria-hidden="true"></i> <span data-aksrt-settings-submit-label><?php esc_html_e('确认提交', 'aksrt'); ?></span></button>
<button type="submit" class="but jb-green padding-lg btn-block"><i class="fa fas fa-check" aria-hidden="true"></i> <span data-jio-settings-submit-label><?php esc_html_e('确认提交', 'jio'); ?></span></button>
</form>
</div>
<?php endif; ?>
</div>
</template>
<template data-aksrt-settings-modal-template="email">
<div class="aksrt-settings-modal" data-account-dialog="email">
<div class="modal-colorful-header colorful-bg jb-blue"><button type="button" class="close" data-aksrt-modal-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><?php echo $account_close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa far fa-envelope" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10"><?php echo esc_html($account_email !== '' ? __('修改邮箱', 'aksrt') : __('绑定邮箱', 'aksrt')); ?></div></div></div>
<template data-jio-settings-modal-template="email">
<div class="jio-settings-modal" data-account-dialog="email">
<div class="modal-colorful-header colorful-bg jb-blue"><button type="button" class="close" data-jio-modal-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><?php echo $account_close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa far fa-envelope" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10"><?php echo esc_html($account_email !== '' ? __('修改邮箱', 'jio') : __('绑定邮箱', 'jio')); ?></div></div></div>
<?php if ($email_verify_required) : ?>
<ul class="mb20 step-simple account-step-list" data-account-step-list="email"><li class="active"><span><?php esc_html_e('验证老邮箱', 'aksrt'); ?></span></li><li><span><?php esc_html_e('验证新邮箱', 'aksrt'); ?></span></li><li><span><?php esc_html_e('修改成功', 'aksrt'); ?></span></li></ul>
<ul class="mb20 step-simple account-step-list" data-account-step-list="email"><li class="active"><span><?php esc_html_e('验证老邮箱', 'jio'); ?></span></li><li><span><?php esc_html_e('验证新邮箱', 'jio'); ?></span></li><li><span><?php esc_html_e('修改成功', 'jio'); ?></span></li></ul>
<div class="account-step-panels">
<div class="account-step is-active" data-account-step="email-old"><p class="muted-2-color"><?php printf(esc_html__('请在下方获取验证码以验证您的老邮箱 %s', 'aksrt'), '<span class="badg">' . esc_html($account_email) . '</span>'); ?></p><form id="email-old-verify-form"><div class="mb20"><?php if (function_exists('aksrt_render_captcha')) : ?><?php aksrt_render_captcha('change_email'); ?><?php endif; ?><div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'aksrt'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn account-code-send" data-account-code-scene="verify_email"><?php esc_html_e('发送验证码', 'aksrt'); ?></button></span><i class="line-form-line"></i></div></div><button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-shield-alt" aria-hidden="true"></i> <?php esc_html_e('立即验证', 'aksrt'); ?></button></form></div>
<div class="account-step" data-account-step="email-new"><p class="muted-2-color"><?php esc_html_e('请输入您需要修改的新邮箱账号', 'aksrt'); ?></p><?php $render_email_form(); ?></div>
<div class="account-step" data-account-step="email-success"><div class="text-center padding-h10"><i class="fa fas fa-check-circle c-green em3x mb10" aria-hidden="true"></i><p><?php esc_html_e('邮箱修改成功', 'aksrt'); ?></p></div></div>
<div class="account-step is-active" data-account-step="email-old"><p class="muted-2-color"><?php printf(esc_html__('请在下方获取验证码以验证您的老邮箱 %s', 'jio'), '<span class="badg">' . esc_html($account_email) . '</span>'); ?></p><form id="email-old-verify-form"><div class="mb20"><?php if (function_exists('jio_render_captcha')) : ?><?php jio_render_captcha('change_email'); ?><?php endif; ?><div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'jio'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn account-code-send" data-account-code-scene="verify_email"><?php esc_html_e('发送验证码', 'jio'); ?></button></span><i class="line-form-line"></i></div></div><button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-shield-alt" aria-hidden="true"></i> <?php esc_html_e('立即验证', 'jio'); ?></button></form></div>
<div class="account-step" data-account-step="email-new"><p class="muted-2-color"><?php esc_html_e('请输入您需要修改的新邮箱账号', 'jio'); ?></p><?php $render_email_form(); ?></div>
<div class="account-step" data-account-step="email-success"><div class="text-center padding-h10"><i class="fa fas fa-check-circle c-green em3x mb10" aria-hidden="true"></i><p><?php esc_html_e('邮箱修改成功', 'jio'); ?></p></div></div>
</div>
<?php else : ?>
<div class="aksrt-settings-modal__pane"><p class="muted-2-color"><?php esc_html_e('请输入您需要修改的新邮箱账号', 'aksrt'); ?></p><?php $render_email_form(); ?></div>
<div class="jio-settings-modal__pane"><p class="muted-2-color"><?php esc_html_e('请输入您需要修改的新邮箱账号', 'jio'); ?></p><?php $render_email_form(); ?></div>
<?php endif; ?>
</div>
</template>
<?php if ($phone_available) : ?>
<template data-aksrt-settings-modal-template="phone">
<div class="aksrt-settings-modal" data-account-dialog="phone">
<div class="modal-colorful-header colorful-bg jb-blue"><button type="button" class="close" data-aksrt-modal-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><?php echo $account_close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa fas fa-phone" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10"><?php echo esc_html($account_phone !== '' ? __('修改手机', 'aksrt') : __('绑定手机', 'aksrt')); ?></div></div></div>
<template data-jio-settings-modal-template="phone">
<div class="jio-settings-modal" data-account-dialog="phone">
<div class="modal-colorful-header colorful-bg jb-blue"><button type="button" class="close" data-jio-modal-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><?php echo $account_close_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></button><div class="colorful-make"></div><div class="text-center"><div class="em2x"><i class="fa fas fa-phone" aria-hidden="true"></i></div><div class="mt10 em12 padding-w10"><?php echo esc_html($account_phone !== '' ? __('修改手机', 'jio') : __('绑定手机', 'jio')); ?></div></div></div>
<?php if ($account_phone !== '') : ?>
<ul class="mb20 step-simple account-step-list" data-account-step-list="phone"><li class="active"><span><?php esc_html_e('验证老手机', 'aksrt'); ?></span></li><li><span><?php esc_html_e('验证新手机', 'aksrt'); ?></span></li><li><span><?php esc_html_e('修改成功', 'aksrt'); ?></span></li></ul>
<ul class="mb20 step-simple account-step-list" data-account-step-list="phone"><li class="active"><span><?php esc_html_e('验证老手机', 'jio'); ?></span></li><li><span><?php esc_html_e('验证新手机', 'jio'); ?></span></li><li><span><?php esc_html_e('修改成功', 'jio'); ?></span></li></ul>
<div class="account-step-panels">
<div class="account-step is-active" data-account-step="phone-old">
<?php $phone_mask = function_exists('aksrt_phone_mask_parts') ? aksrt_phone_mask_parts($account_phone) : null; ?>
<?php $phone_mask = function_exists('jio_phone_mask_parts') ? jio_phone_mask_parts($account_phone) : null; ?>
<?php if ($phone_mask !== null) : ?>
<p class="muted-2-color"><?php esc_html_e('为确认是您本人操作,请补全绑定手机号', 'aksrt'); ?></p>
<p class="muted-2-color"><?php esc_html_e('为确认是您本人操作,请补全绑定手机号', 'jio'); ?></p>
<?php else : ?>
<p class="muted-2-color"><?php printf(esc_html__('请在下方获取验证码以验证您的老手机号 %s', 'aksrt'), '<br><span class="badg">' . esc_html($account_phone_display) . '</span>'); ?></p>
<p class="muted-2-color"><?php printf(esc_html__('请在下方获取验证码以验证您的老手机号 %s', 'jio'), '<br><span class="badg">' . esc_html($account_phone_display) . '</span>'); ?></p>
<?php endif; ?>
<form id="phone-old-verify-form" novalidate>
<?php if ($phone_mask !== null) : ?>
<div class="mb20 aksrt-phone-digits" data-aksrt-phone-digits data-hidden-length="<?php echo esc_attr((string) $phone_mask['hidden_length']); ?>" role="group" aria-label="<?php esc_attr_e('请补全手机号中缺失的数字', 'aksrt'); ?>">
<span class="aksrt-phone-digit__edge"><?php echo esc_html(($phone_mask['leading_plus'] ? '+' : '') . (string) $phone_mask['prefix']); ?></span>
<div class="mb20 jio-phone-digits" data-jio-phone-digits data-hidden-length="<?php echo esc_attr((string) $phone_mask['hidden_length']); ?>" role="group" aria-label="<?php esc_attr_e('请补全手机号中缺失的数字', 'jio'); ?>">
<span class="jio-phone-digit__edge"><?php echo esc_html(($phone_mask['leading_plus'] ? '+' : '') . (string) $phone_mask['prefix']); ?></span>
<?php for ($phone_digit_index = 0; $phone_digit_index < (int) $phone_mask['hidden_length']; $phone_digit_index++) : ?>
<input type="text" class="aksrt-phone-digit" inputmode="numeric" maxlength="1" autocomplete="one-time-code" data-digit-index="<?php echo esc_attr((string) $phone_digit_index); ?>" aria-label="<?php echo esc_attr(sprintf(__('手机号第 %d 位数字', 'aksrt'), 4 + $phone_digit_index)); ?>">
<input type="text" class="jio-phone-digit" inputmode="numeric" maxlength="1" autocomplete="one-time-code" data-digit-index="<?php echo esc_attr((string) $phone_digit_index); ?>" aria-label="<?php echo esc_attr(sprintf(__('手机号第 %d 位数字', 'jio'), 4 + $phone_digit_index)); ?>">
<?php endfor; ?>
<span class="aksrt-phone-digit__edge"><?php echo esc_html((string) $phone_mask['suffix']); ?></span>
<span class="jio-phone-digit__edge"><?php echo esc_html((string) $phone_mask['suffix']); ?></span>
</div>
<p class="aksrt-phone-digits__error" data-aksrt-phone-digits-error hidden></p>
<p class="jio-phone-digits__error" data-jio-phone-digits-error hidden></p>
<?php endif; ?>
<div class="mb20" data-aksrt-phone-code-area<?php echo $phone_mask !== null ? ' hidden' : ''; ?>>
<?php if (function_exists('aksrt_render_captcha')) : ?><?php aksrt_render_captcha('bind_phone'); ?><?php endif; ?>
<div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'aksrt'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn account-code-send" data-aksrt-sms-trigger data-aksrt-sms-scene="verify_old_phone"><?php esc_html_e('发送验证码', 'aksrt'); ?></button></span><i class="line-form-line"></i></div>
<button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-shield-alt" aria-hidden="true"></i> <?php esc_html_e('立即验证', 'aksrt'); ?></button>
<div class="mb20" data-jio-phone-code-area<?php echo $phone_mask !== null ? ' hidden' : ''; ?>>
<?php if (function_exists('jio_render_captcha')) : ?><?php jio_render_captcha('bind_phone'); ?><?php endif; ?>
<div class="relative line-form mb10 modal-line-field modal-line-field--code"><input type="text" name="code" class="line-form-input" maxlength="6" inputmode="numeric" autocomplete="one-time-code" required><div class="scale-placeholder"><?php esc_html_e('验证码', 'jio'); ?></div><span class="yztx abs-right"><button type="button" class="but c-blue code-send-btn account-code-send" data-jio-sms-trigger data-jio-sms-scene="verify_old_phone"><?php esc_html_e('发送验证码', 'jio'); ?></button></span><i class="line-form-line"></i></div>
<button type="submit" class="but jb-blue padding-lg btn-block"><i class="fa fas fa-shield-alt" aria-hidden="true"></i> <?php esc_html_e('立即验证', 'jio'); ?></button>
</div>
</form>
</div>
<div class="account-step" data-account-step="phone-new"><p class="muted-2-color"><?php esc_html_e('请输入您需要修改的新手机号码', 'aksrt'); ?></p><?php $render_phone_form(); ?></div>
<div class="account-step" data-account-step="phone-success"><div class="text-center padding-h10"><i class="fa fas fa-check-circle c-green em3x mb10" aria-hidden="true"></i><p><?php esc_html_e('手机号修改成功', 'aksrt'); ?></p></div></div>
<div class="account-step" data-account-step="phone-new"><p class="muted-2-color"><?php esc_html_e('请输入您需要修改的新手机号码', 'jio'); ?></p><?php $render_phone_form(); ?></div>
<div class="account-step" data-account-step="phone-success"><div class="text-center padding-h10"><i class="fa fas fa-check-circle c-green em3x mb10" aria-hidden="true"></i><p><?php esc_html_e('手机号修改成功', 'jio'); ?></p></div></div>
</div>
<?php else : ?>
<div class="aksrt-settings-modal__pane"><p class="muted-2-color"><?php esc_html_e('请输入您需要绑定的手机号', 'aksrt'); ?></p><?php $render_phone_form(); ?></div>
<div class="jio-settings-modal__pane"><p class="muted-2-color"><?php esc_html_e('请输入您需要绑定的手机号', 'jio'); ?></p><?php $render_phone_form(); ?></div>
<?php endif; ?>
</div>
</template>
@@ -4,12 +4,12 @@
*
* Expects extracted $context vars.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$oauth = class_exists('\AKSRT\Auth\OAuth') ? \AKSRT\Auth\OAuth::get_instance() : null;
$oauth = class_exists('\Jio\Auth\OAuth') ? \Jio\Auth\OAuth::get_instance() : null;
$oauth_data = $oauth ? $oauth->get_frontend_bindings_data($user_id) : ['bindings' => [], 'available' => []];
$binding_name_map = [
'github' => 'GitHub',
@@ -54,43 +54,43 @@ foreach ((array) ($oauth_data['available'] ?? []) as $binding) {
];
}
?>
<div class="aksrt-account-settings__section aksrt-account-settings__section--social">
<div class="aksrt-account-settings__heading">
<div class="jio-account-settings__section jio-account-settings__section--social">
<div class="jio-account-settings__heading">
<div>
<h3 class="title-h-left"><b><?php esc_html_e('绑定社交账号', 'aksrt'); ?></b></h3>
<p><?php esc_html_e('绑定社交账号,您可更安全、更快速的登录本站', 'aksrt'); ?></p>
<h3 class="title-h-left"><b><?php esc_html_e('绑定社交账号', 'jio'); ?></b></h3>
<p><?php esc_html_e('绑定社交账号,您可更安全、更快速的登录本站', 'jio'); ?></p>
</div>
</div>
<?php if (!empty($binding_rows)) : ?>
<?php if (function_exists('aksrt_render_captcha')) : ?>
<div class="binding-captcha" data-aksrt-oauth-bind-captcha><?php aksrt_render_captcha('bind'); ?></div>
<?php if (function_exists('jio_render_captcha')) : ?>
<div class="binding-captcha" data-jio-oauth-bind-captcha><?php jio_render_captcha('bind'); ?></div>
<?php endif; ?>
<div class="aksrt-account-list aksrt-account-list--social">
<div class="jio-account-list jio-account-list--social">
<?php foreach ($binding_rows as $binding) : ?>
<?php if (!empty($binding['is_bound'])) : ?>
<div class="aksrt-account-row binding-item">
<div class="jio-account-row binding-item">
<span class="social-login-item circular <?php echo esc_attr($binding['icon_type']); ?>"><?php echo $binding['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="aksrt-account-row__social-name"><?php echo esc_html($binding['name']); ?></span>
<span class="jio-account-row__social-name"><?php echo esc_html($binding['name']); ?></span>
<span class="binding-status">
<i class="fa fas fa-check-circle badge__icon" aria-hidden="true"></i>
<?php esc_html_e('已绑定', 'aksrt'); ?>
<?php esc_html_e('已绑定', 'jio'); ?>
</span>
<button type="button" class="but hollow c-yellow aksrt-account-row__action binding-unbind-btn" data-provider="<?php echo esc_attr($binding['key']); ?>">
<?php esc_html_e('解绑', 'aksrt'); ?>
<button type="button" class="but hollow c-yellow jio-account-row__action binding-unbind-btn" data-provider="<?php echo esc_attr($binding['key']); ?>">
<?php esc_html_e('解绑', 'jio'); ?>
</button>
</div>
<?php else : ?>
<a href="<?php echo esc_url($binding['url']); ?>" class="aksrt-account-row binding-item binding-item--linkable" target="_self" data-provider="<?php echo esc_attr($binding['key']); ?>" data-bind-start-url="<?php echo esc_url($binding['url']); ?>">
<a href="<?php echo esc_url($binding['url']); ?>" class="jio-account-row binding-item binding-item--linkable" target="_self" data-provider="<?php echo esc_attr($binding['key']); ?>" data-bind-start-url="<?php echo esc_url($binding['url']); ?>">
<span class="social-login-item circular <?php echo esc_attr($binding['icon_type']); ?>"><?php echo $binding['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="aksrt-account-row__social-name"><?php echo esc_html($binding['name']); ?></span>
<span class="binding-status binding-status--idle"><?php esc_html_e('未绑定', 'aksrt'); ?></span>
<span class="but hollow c-blue aksrt-account-row__action"><?php esc_html_e('绑定', 'aksrt'); ?></span>
<span class="jio-account-row__social-name"><?php echo esc_html($binding['name']); ?></span>
<span class="binding-status binding-status--idle"><?php esc_html_e('未绑定', 'jio'); ?></span>
<span class="but hollow c-blue jio-account-row__action"><?php esc_html_e('绑定', 'jio'); ?></span>
</a>
<?php endif; ?>
<?php endforeach; ?>
</div>
<?php else : ?>
<p class="settings-empty"><?php esc_html_e('暂无可用的第三方登录服务', 'aksrt'); ?></p>
<p class="settings-empty"><?php esc_html_e('暂无可用的第三方登录服务', 'jio'); ?></p>
<?php endif; ?>
</div>
@@ -4,7 +4,7 @@
*
* Expects extracted $context vars.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -13,9 +13,9 @@ $user_email = isset($target_user) && $target_user instanceof WP_User
? (string) $target_user->user_email
: (string) ($user_email ?? '');
?>
<input type="hidden" id="aksrt-settings-nonce" value="<?php echo esc_attr(wp_create_nonce('aksrt_account_settings')); ?>">
<input type="hidden" id="aksrt-oauth-unbind-nonce" value="<?php echo esc_attr(wp_create_nonce('aksrt_oauth_unbind')); ?>">
<input type="hidden" id="aksrt-user-email" value="<?php echo esc_attr($user_email); ?>">
<input type="hidden" id="aksrt-ajax-url" value="<?php echo esc_url(admin_url('admin-ajax.php')); ?>">
<input type="hidden" id="aksrt-login-url" value="<?php echo esc_attr(aksrt_get_login_url()); ?>">
<input type="hidden" id="aksrt-public-nonce" value="<?php echo esc_attr(wp_create_nonce('aksrt_public_nonce')); ?>">
<input type="hidden" id="jio-settings-nonce" value="<?php echo esc_attr(wp_create_nonce('jio_account_settings')); ?>">
<input type="hidden" id="jio-oauth-unbind-nonce" value="<?php echo esc_attr(wp_create_nonce('jio_oauth_unbind')); ?>">
<input type="hidden" id="jio-user-email" value="<?php echo esc_attr($user_email); ?>">
<input type="hidden" id="jio-ajax-url" value="<?php echo esc_url(admin_url('admin-ajax.php')); ?>">
<input type="hidden" id="jio-login-url" value="<?php echo esc_attr(jio_get_login_url()); ?>">
<input type="hidden" id="jio-public-nonce" value="<?php echo esc_attr(wp_create_nonce('jio_public_nonce')); ?>">
@@ -2,7 +2,7 @@
/**
* User center sidebar: balance and points pair.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -13,32 +13,32 @@ if (!$show_wallet && !$show_credits) {
return;
}
$assets_url = aksrt_get_user_center_tab_url('credits');
$assets_url = jio_get_user_center_tab_url('credits');
try {
$wallet = \AKSRT\Ledger\AssetAmount::balance(is_string($wallet_balance ?? null) ? $wallet_balance : '')->formatted();
$wallet = \Jio\Ledger\AssetAmount::balance(is_string($wallet_balance ?? null) ? $wallet_balance : '')->formatted();
} catch (\InvalidArgumentException $e) {
$wallet = '0.00';
}
$points = max(0, (int) ($credit_balance ?? 0));
$wallet_icon = aksrt_icon_markup('zibsvg-money-color-2');
$points_icon = aksrt_icon_markup('zibsvg-points-color');
$arrow_icon = aksrt_icon_markup('zibsvg-right');
$wallet_icon = jio_icon_markup('zibsvg-money-color-2');
$points_icon = jio_icon_markup('zibsvg-points-color');
$arrow_icon = jio_icon_markup('zibsvg-right');
?>
<div class="uc-sidebar__pair uc-sidebar__pair--assets">
<?php if ($show_wallet) : ?>
<a class="uc-summary-card uc-summary-card--wallet" href="<?php echo esc_url($assets_url); ?>" data-tab="credits">
<span class="uc-summary-card__head"><?php esc_html_e('账户余额', 'aksrt'); ?><?php echo $arrow_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="uc-summary-card__head"><?php esc_html_e('账户余额', 'jio'); ?><?php echo $arrow_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="uc-summary-card__body">
<strong data-aksrt-wallet-value><?php echo esc_html($wallet); ?></strong>
<strong data-jio-wallet-value><?php echo esc_html($wallet); ?></strong>
<?php echo $wallet_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</span>
</a>
<?php endif; ?>
<?php if ($show_credits) : ?>
<a class="uc-summary-card uc-summary-card--points" href="<?php echo esc_url($assets_url); ?>" data-tab="credits">
<span class="uc-summary-card__head"><?php echo esc_html((string) ($currency_name ?? __('积分', 'aksrt'))); ?><?php echo $arrow_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="uc-summary-card__head"><?php echo esc_html((string) ($currency_name ?? __('积分', 'jio'))); ?><?php echo $arrow_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
<span class="uc-summary-card__body">
<strong data-aksrt-points-value data-credits-value><?php echo esc_html(aksrt_format_points($points)); ?></strong>
<strong data-jio-points-value data-credits-value><?php echo esc_html(jio_format_points($points)); ?></strong>
<?php echo $points_icon; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</span>
</a>
@@ -4,15 +4,15 @@
*
* 1:1 port of the reference theme zib_user_center_page_sidebar_income_rebate():
* two zib-widget cards, each with an icon title row and two centered stats.
* Navigation keeps the AKSRT <a href data-tab> contract instead of the reference click proxy.
* Navigation keeps the Jio <a href data-tab> contract instead of the reference click proxy.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$creation_url = isset($dashboard_tabs['creator']) ? aksrt_get_user_center_tab_url('creator') : '';
$revenue_url = isset($dashboard_tabs['revenue']) ? aksrt_get_user_center_tab_url('revenue') : '';
$creation_url = isset($dashboard_tabs['creator']) ? jio_get_user_center_tab_url('creator') : '';
$revenue_url = isset($dashboard_tabs['revenue']) ? jio_get_user_center_tab_url('revenue') : '';
if ($creation_url === '' && $revenue_url === '') {
return;
@@ -22,52 +22,52 @@ $user_id = (int) ($user_id ?? get_current_user_id());
$centers = [];
if ($creation_url !== '') {
$income_stats = $user_id > 0 && class_exists('\AKSRT\Payment\Revenue')
? (array) (\AKSRT\Payment\Revenue::get_instance()->get_user_income_view($user_id)['stats'] ?? [])
$income_stats = $user_id > 0 && class_exists('\Jio\Payment\Revenue')
? (array) (\Jio\Payment\Revenue::get_instance()->get_user_income_view($user_id)['stats'] ?? [])
: [];
// 累计收益(pending + settled),现金与积分分开统计。
$cash_income = (float) ($income_stats['total']['CNY'] ?? 0);
$points_income = (int) ($income_stats['total']['points'] ?? 0);
// 收益单位名跟随自定义货币名称(后台「积分配置 → 自定义货币名称」)。
$currency_name = class_exists('\AKSRT\Settings\Settings')
? \AKSRT\Settings\Settings::get_currency_name()
: __('积分', 'aksrt');
$currency_name = class_exists('\Jio\Settings\Settings')
? \Jio\Settings\Settings::get_currency_name()
: __('积分', 'jio');
$centers[] = [
'url' => $creation_url,
'tab' => 'creator',
'icon' => aksrt_icon_markup('zibsvg-merchant-color', 'mr6'),
'title' => __('创作中心', 'aksrt'),
'first' => aksrt_cut_count($cash_income),
'first_l' => __('现金收益', 'aksrt'),
'second' => aksrt_cut_count($points_income),
'second_l' => sprintf(__('%s收益', 'aksrt'), $currency_name),
'icon' => jio_icon_markup('zibsvg-merchant-color', 'mr6'),
'title' => __('创作中心', 'jio'),
'first' => jio_cut_count($cash_income),
'first_l' => __('现金收益', 'jio'),
'second' => jio_cut_count($points_income),
'second_l' => sprintf(__('%s收益', 'jio'), $currency_name),
];
}
if ($revenue_url !== '') {
$overview = $user_id > 0 && class_exists('\AKSRT\Payment\CommissionLedger')
? \AKSRT\Payment\CommissionLedger::get_instance()->overview($user_id)
$overview = $user_id > 0 && class_exists('\Jio\Payment\CommissionLedger')
? \Jio\Payment\CommissionLedger::get_instance()->overview($user_id)
: [];
$pool = (float) ($overview['pool'] ?? 0);
if ($pool > 0) {
$rebate_label = __('待提现', 'aksrt');
$rebate_value = aksrt_cut_count($pool);
$rebate_label = __('待提现', 'jio');
$rebate_value = jio_cut_count($pool);
} else {
$rebate_label = __('累计佣金', 'aksrt');
$rebate_value = aksrt_cut_count((float) ($overview['total'] ?? 0));
$rebate_label = __('累计佣金', 'jio');
$rebate_value = jio_cut_count((float) ($overview['total'] ?? 0));
}
$rebate_ratio = $user_id > 0 && class_exists('\AKSRT\Settings\Settings')
? max(0, (int) \AKSRT\Settings\Settings::affiliate_ratio_for_user($user_id))
$rebate_ratio = $user_id > 0 && class_exists('\Jio\Settings\Settings')
? max(0, (int) \Jio\Settings\Settings::affiliate_ratio_for_user($user_id))
: 0;
$centers[] = [
'url' => $revenue_url,
'tab' => 'revenue',
'icon' => aksrt_icon_markup('zibsvg-money-color', 'mr6'),
'title' => __('推广中心', 'aksrt'),
'icon' => jio_icon_markup('zibsvg-money-color', 'mr6'),
'title' => __('推广中心', 'jio'),
'first' => $rebate_ratio . '%',
'first_l' => __('比例', 'aksrt'),
'first_l' => __('比例', 'jio'),
'second' => $rebate_value,
'second_l' => $rebate_label,
];
@@ -3,44 +3,44 @@
* User center sidebar: services and account settings.
*
* Icon set mirrors the reference theme user-center sidebar: every entry renders
* an inline SVG from the theme sprite through aksrt_icon_markup().
* an inline SVG from the theme sprite through jio_icon_markup().
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$level_url = isset($dashboard_tabs['level'])
? aksrt_get_user_center_tab_url('level')
? jio_get_user_center_tab_url('level')
: '';
$auth_url = isset($dashboard_tabs['auth']) ? aksrt_get_user_center_tab_url('auth') : '';
$auth_url = isset($dashboard_tabs['auth']) ? jio_get_user_center_tab_url('auth') : '';
$orders_available = isset($dashboard_tabs['orders']);
$orders_url = $orders_available ? (string) ($orders_url ?? '') : '';
$tickets_available = isset($dashboard_tabs['tickets']);
$tickets_url = $tickets_available ? aksrt_get_user_center_tab_url('tickets') : '';
$tickets_url = $tickets_available ? jio_get_user_center_tab_url('tickets') : '';
// 参考主题由 zibpay 把「我的订单」前插到按钮组最前,其后才是等级 / 认证。
$services = array_values(array_filter([
[
'label' => __('我的订单', 'aksrt'),
'label' => __('我的订单', 'jio'),
'icon' => 'order-color',
'url' => $orders_url,
'tab' => 'orders',
],
[
'label' => __('我的等级', 'aksrt'),
'label' => __('我的等级', 'jio'),
'icon' => 'trend-color',
'url' => $level_url,
'tab' => 'level',
],
[
'label' => __('官方认证', 'aksrt'),
'label' => __('官方认证', 'jio'),
'icon' => 'user-auth',
'url' => $auth_url,
'tab' => 'auth',
],
[
'label' => __('工单中心', 'aksrt'),
'label' => __('工单中心', 'jio'),
'icon' => 'comment-color',
'url' => $tickets_url,
'tab' => 'tickets',
@@ -49,21 +49,21 @@ $services = array_values(array_filter([
$settings = array_values(array_filter([
[
'label' => __('消息通知', 'aksrt'),
'label' => __('消息通知', 'jio'),
'icon' => 'msg-color',
'url' => isset($dashboard_tabs['msg']) ? aksrt_get_user_center_tab_url('msg') : '',
'url' => isset($dashboard_tabs['msg']) ? jio_get_user_center_tab_url('msg') : '',
'tab' => 'msg',
],
[
'label' => __('个人资料', 'aksrt'),
'label' => __('个人资料', 'jio'),
'icon' => 'user-color',
'url' => isset($dashboard_tabs['profile']) ? aksrt_get_user_center_tab_url('profile') : '',
'url' => isset($dashboard_tabs['profile']) ? jio_get_user_center_tab_url('profile') : '',
'tab' => 'profile',
],
[
'label' => __('账户安全', 'aksrt'),
'label' => __('账户安全', 'jio'),
'icon' => 'security-color',
'url' => isset($dashboard_tabs['settings']) ? aksrt_get_user_center_tab_url('settings') : '',
'url' => isset($dashboard_tabs['settings']) ? jio_get_user_center_tab_url('settings') : '',
'tab' => 'settings',
],
], static fn(array $item): bool => (string) $item['url'] !== ''));
@@ -74,7 +74,7 @@ $render_grid = static function (array $items): void {
<?php foreach ($items as $item) :
$tab = (string) ($item['tab'] ?? '');
$item_class = 'icon-but-' . ($tab !== '' ? $tab : 'item');
$icon_html = aksrt_icon_markup('zibsvg-' . (string) $item['icon']);
$icon_html = jio_icon_markup('zibsvg-' . (string) $item['icon']);
?>
<a class="<?php echo esc_attr($item_class); ?>" href="<?php echo esc_url((string) $item['url']); ?>"<?php if ($tab !== '') : ?> data-tab="<?php echo esc_attr($tab); ?>"<?php endif; ?>>
<div class="em16"><?php echo $icon_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></div>
@@ -87,14 +87,14 @@ $render_grid = static function (array $items): void {
?>
<?php if ($services) : ?>
<div class="uc-sidebar-iconbox zib-widget padding-6 mb10-sm">
<div class="padding-6 ml3"><?php esc_html_e('我的服务', 'aksrt'); ?></div>
<div class="padding-6 ml3"><?php esc_html_e('我的服务', 'jio'); ?></div>
<?php $render_grid($services); ?>
</div>
<?php endif; ?>
<?php if ($settings) : ?>
<div class="uc-sidebar-iconbox zib-widget padding-6">
<div class="padding-6 ml3"><?php esc_html_e('功能设置', 'aksrt'); ?></div>
<div class="padding-6 ml3"><?php esc_html_e('功能设置', 'jio'); ?></div>
<?php $render_grid($settings); ?>
</div>
<?php endif; ?>
@@ -2,41 +2,41 @@
/**
* User center sidebar: one-line account statistics.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$stats = [
[
'label' => __('文章', 'aksrt'),
'label' => __('文章', 'jio'),
'value' => (int) ($post_count ?? 0),
'url' => aksrt_get_user_center_tab_url('posts'),
'url' => jio_get_user_center_tab_url('posts'),
'tab' => 'posts',
],
[
'label' => __('评论', 'aksrt'),
'label' => __('评论', 'jio'),
'value' => (int) ($comment_count ?? 0),
'url' => isset($dashboard_tabs['comments']) ? aksrt_get_user_center_tab_url('comments') : $public_home_url,
'url' => isset($dashboard_tabs['comments']) ? jio_get_user_center_tab_url('comments') : $public_home_url,
'tab' => isset($dashboard_tabs['comments']) ? 'comments' : '',
],
[
'label' => __('收藏', 'aksrt'),
'label' => __('收藏', 'jio'),
'value' => (int) ($favorite_count ?? 0),
'url' => isset($dashboard_tabs['favorites']) ? aksrt_get_user_center_tab_url('favorites') : $public_home_url,
'url' => isset($dashboard_tabs['favorites']) ? jio_get_user_center_tab_url('favorites') : $public_home_url,
'tab' => isset($dashboard_tabs['favorites']) ? 'favorites' : '',
],
[
'label' => __('粉丝', 'aksrt'),
'label' => __('粉丝', 'jio'),
'value' => (int) ($follower_count ?? 0),
'url' => aksrt_get_user_center_tab_url('follow'),
'url' => jio_get_user_center_tab_url('follow'),
'tab' => 'follow',
],
];
?>
<?php // 1:1 参考主题 zib_user_center_page_sidebar_statistics():单张 zib-widget,四项 space-around 平铺。 ?>
<div class="uc-sidebar-statistics mb10-sm mb20 flex ac jsa zib-widget padding-10 text-center" aria-label="<?php esc_attr_e('账号统计', 'aksrt'); ?>">
<div class="uc-sidebar-statistics mb10-sm mb20 flex ac jsa zib-widget padding-10 text-center" aria-label="<?php esc_attr_e('账号统计', 'jio'); ?>">
<?php foreach ($stats as $stat) : ?>
<a class="user-statistics-item" href="<?php echo esc_url((string) $stat['url']); ?>"<?php if (!empty($stat['tab'])) : ?> data-tab="<?php echo esc_attr((string) $stat['tab']); ?>"<?php endif; ?>><div class="em14"><?php echo esc_html(aksrt_cut_count((int) $stat['value'])); ?></div><div class="em09 opacity5 mt6"><?php echo esc_html((string) $stat['label']); ?></div></a>
<a class="user-statistics-item" href="<?php echo esc_url((string) $stat['url']); ?>"<?php if (!empty($stat['tab'])) : ?> data-tab="<?php echo esc_attr((string) $stat['tab']); ?>"<?php endif; ?>><div class="em14"><?php echo esc_html(jio_cut_count((int) $stat['value'])); ?></div><div class="em09 opacity5 mt6"><?php echo esc_html((string) $stat['label']); ?></div></a>
<?php endforeach; ?>
</div>
@@ -5,9 +5,9 @@
* 1:1 port of the reference theme zib_user_center_page_sidebar_vip():
* metallic payvip-icon bar, level icon + name + expiry badge for members,
* vip_1 icon + "开通会员 尊享会员权益" otherwise, chevron pinned right.
* Navigation keeps the AKSRT <a href data-tab> contract instead of the reference click proxy.
* Navigation keeps the Jio <a href data-tab> contract instead of the reference click proxy.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
@@ -21,9 +21,9 @@ if (!$vip_enabled) {
}
$user_id = (int) ($user_id ?? get_current_user_id());
$vip_state = function_exists('aksrt_get_user_vip_state') ? aksrt_get_user_vip_state($user_id) : [];
$vip_state = function_exists('jio_get_user_vip_state') ? jio_get_user_vip_state($user_id) : [];
$vip_level = (int) ($vip_state['level'] ?? 0);
$vip_url = aksrt_get_user_center_tab_url('vip');
$vip_url = jio_get_user_center_tab_url('vip');
if ($vip_level > 0) {
$vip_name = (string) ($vip_levels[$vip_level]['name_html'] ?? $vip_levels[$vip_level]['name'] ?? ('VIP' . $vip_level));
@@ -32,20 +32,20 @@ if ($vip_level > 0) {
$expires = max(0, (int) ($vip_state['expires'] ?? 0));
$exp_label = '';
if ($expires > 0) {
$exp_label = $expires <= time() ? __('会员已过期', 'aksrt') : wp_date('Y年m月d日', $expires);
$exp_label = $expires <= time() ? __('会员已过期', 'jio') : wp_date('Y年m月d日', $expires);
} elseif (!empty($vip_state['is_permanent'])) {
$exp_label = __('永久会员', 'aksrt');
$exp_label = __('永久会员', 'jio');
}
$button = (function_exists('aksrt_get_vip_icon') ? aksrt_get_vip_icon($user_id, 'em12 mr6', false) : '')
$button = (function_exists('jio_get_vip_icon') ? jio_get_vip_icon($user_id, 'em12 mr6', false) : '')
. '<span>' . wp_kses_post($vip_name) . '</span>';
if ($exp_label !== '') {
$button .= '<span class="ml10 badg jb-yellow vip-expdate-tag">'
. aksrt_icon_markup('zibsvg-time', 'mr3')
. jio_icon_markup('zibsvg-time', 'mr3')
. esc_html($exp_label) . '</span>';
}
} else {
$button = aksrt_icon_markup('zibsvg-vip_1', 'em12 mr6') . esc_html__('开通会员 尊享会员权益', 'aksrt');
$button = jio_icon_markup('zibsvg-vip_1', 'em12 mr6') . esc_html__('开通会员 尊享会员权益', 'jio');
}
$vip_class = 'uc-sidebar-vip mb20 mb10-sm main-radius payvip-icon btn-block badg pointer' . ($user_id <= 0 ? ' signin-loader' : '');
@@ -2,53 +2,53 @@
/**
* Shared transfer modal for balance and points assets.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$transfer_recharge = class_exists('\AKSRT\Settings\Settings') && method_exists('\AKSRT\Settings\Settings', 'get_payment_recharge_settings')
? \AKSRT\Settings\Settings::get_payment_recharge_settings()
$transfer_recharge = class_exists('\Jio\Settings\Settings') && method_exists('\Jio\Settings\Settings', 'get_payment_recharge_settings')
? \Jio\Settings\Settings::get_payment_recharge_settings()
: [];
$transfer_all_settings = class_exists('\AKSRT\Settings\Settings') ? \AKSRT\Settings\Settings::get_all() : [];
$transfer_all_settings = class_exists('\Jio\Settings\Settings') ? \Jio\Settings\Settings::get_all() : [];
$points_transfer_min = max(1, (int) ($transfer_all_settings['points_transfer_min'] ?? 1));
$points_transfer_fee = max(0, min(50, (int) ($transfer_all_settings['points_service_charge'] ?? 0)));
// 转账提示里的货币名跟随自定义名称(后台「积分配置 → 自定义货币名称」)。
$currency_name = (string) ($currency_name ?? __('积分', 'aksrt'));
$currency_name = (string) ($currency_name ?? __('积分', 'jio'));
?>
<div class="uc-modal" id="aksrt-transfer-modal" hidden data-aksrt-transfer-modal>
<div class="uc-modal__overlay" data-aksrt-transfer-close></div>
<div class="uc-modal" id="jio-transfer-modal" hidden data-jio-transfer-modal>
<div class="uc-modal__overlay" data-jio-transfer-close></div>
<div class="uc-modal__dialog" role="dialog" aria-modal="true">
<button type="button" class="uc-modal__close" data-aksrt-transfer-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
<h3 class="uc-modal__title" data-aksrt-transfer-title><?php esc_html_e('余额转账', 'aksrt'); ?></h3>
<form data-aksrt-transfer-form>
<input type="hidden" name="type" value="balance" data-aksrt-transfer-type>
<button type="button" class="uc-modal__close" data-jio-transfer-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
<h3 class="uc-modal__title" data-jio-transfer-title><?php esc_html_e('余额转账', 'jio'); ?></h3>
<form data-jio-transfer-form>
<input type="hidden" name="type" value="balance" data-jio-transfer-type>
<div class="mb10">
<label class="muted-color em09"><?php esc_html_e('收款用户', 'aksrt'); ?></label>
<input type="search" class="uc-card-pass__input" data-aksrt-transfer-search placeholder="<?php esc_attr_e('搜索用户名/昵称/邮箱', 'aksrt'); ?>" autocomplete="off">
<div class="uc-transfer-results" data-aksrt-transfer-results></div>
<input type="hidden" name="recipient" value="" data-aksrt-transfer-recipient>
<div class="uc-transfer-selected muted-2-color em09 mt6" data-aksrt-transfer-selected></div>
<label class="muted-color em09"><?php esc_html_e('收款用户', 'jio'); ?></label>
<input type="search" class="uc-card-pass__input" data-jio-transfer-search placeholder="<?php esc_attr_e('搜索用户名/昵称/邮箱', 'jio'); ?>" autocomplete="off">
<div class="uc-transfer-results" data-jio-transfer-results></div>
<input type="hidden" name="recipient" value="" data-jio-transfer-recipient>
<div class="uc-transfer-selected muted-2-color em09 mt6" data-jio-transfer-selected></div>
</div>
<div class="mb10">
<label class="muted-color em09" data-aksrt-transfer-amount-label><?php esc_html_e('金额', 'aksrt'); ?></label>
<input type="number" class="uc-card-pass__input" name="amount" min="0.01" step="0.01" data-aksrt-transfer-amount>
<label class="muted-color em09" data-jio-transfer-amount-label><?php esc_html_e('金额', 'jio'); ?></label>
<input type="number" class="uc-card-pass__input" name="amount" min="0.01" step="0.01" data-jio-transfer-amount>
</div>
<div data-aksrt-transfer-balance-info>
<div data-jio-transfer-balance-info>
<?php if (!empty($transfer_recharge['transfer']['desc'])) : ?>
<div class="muted-box em09 mb10"><?php echo esc_html((string) $transfer_recharge['transfer']['desc']); ?></div>
<?php endif; ?>
<?php if (!empty($transfer_recharge['transfer']['service_charge'])) : ?>
<div class="c-yellow em09 mb10"><?php printf(esc_html__('转账将扣除 %s%% 手续费', 'aksrt'), esc_html((string) (int) $transfer_recharge['transfer']['service_charge'])); ?></div>
<div class="c-yellow em09 mb10"><?php printf(esc_html__('转账将扣除 %s%% 手续费', 'jio'), esc_html((string) (int) $transfer_recharge['transfer']['service_charge'])); ?></div>
<?php endif; ?>
</div>
<div class="muted-box em09 mb10" hidden data-aksrt-transfer-points-info>
<?php printf(esc_html__('%s转账仅支持正整数,单笔至少 %d %s。', 'aksrt'), esc_html($currency_name), $points_transfer_min, esc_html($currency_name)); ?>
<div class="muted-box em09 mb10" hidden data-jio-transfer-points-info>
<?php printf(esc_html__('%s转账仅支持正整数,单笔至少 %d %s。', 'jio'), esc_html($currency_name), $points_transfer_min, esc_html($currency_name)); ?>
<?php if ($points_transfer_fee > 0) : ?>
<?php printf(esc_html__(' 将扣除 %d%% 手续费。', 'aksrt'), $points_transfer_fee); ?>
<?php printf(esc_html__(' 将扣除 %d%% 手续费。', 'jio'), $points_transfer_fee); ?>
<?php endif; ?>
</div>
<button type="submit" class="but jb-blue btn-block" data-aksrt-transfer-submit><?php esc_html_e('确认转账', 'aksrt'); ?></button>
<button type="submit" class="but jb-blue btn-block" data-jio-transfer-submit><?php esc_html_e('确认转账', 'jio'); ?></button>
</form>
</div>
</div>
+33 -33
View File
@@ -4,22 +4,22 @@
*
* Expects extracted $context vars via profile-vip.php / capture path.
*
* @package AKSRT
* @package Jio
*/
defined('ABSPATH') || exit;
$vip_settings = is_array($vip_settings ?? null) ? $vip_settings : [];
if (empty($vip_settings['enabled']) && class_exists('\AKSRT\Settings\Settings')) {
$vip_settings = \AKSRT\Settings\Settings::get_payment_vip_settings();
if (empty($vip_settings['enabled']) && class_exists('\Jio\Settings\Settings')) {
$vip_settings = \Jio\Settings\Settings::get_payment_vip_settings();
}
if (empty($vip_settings['enabled'])) {
echo '<div class="aksrt-panel padding-20 muted-2-color">' . esc_html__('会员功能未启用。', 'aksrt') . '</div>';
echo '<div class="jio-panel padding-20 muted-2-color">' . esc_html__('会员功能未启用。', 'jio') . '</div>';
return;
}
$user_id = (int) ($user_id ?? get_current_user_id());
$vip_state = function_exists('aksrt_get_user_vip_state') ? aksrt_get_user_vip_state($user_id) : [];
$vip_state = function_exists('jio_get_user_vip_state') ? jio_get_user_vip_state($user_id) : [];
$level = (int) ($vip_state['level'] ?? 0);
$expires = max(0, (int) ($vip_state['current_expires'] ?? $vip_state['expires'] ?? 0));
$base_level = min(2, max(0, (int) ($vip_state['fallback_level'] ?? 0)));
@@ -34,10 +34,10 @@ $upgrade_desc = (string) ($vip_settings['upgrade']['desc'] ?? '');
// Membership summary: title → level → intro → expiry.
$vip_state = 'unopened';
$vip_state_label = __('未开通', 'aksrt');
$vip_state_label = __('未开通', 'jio');
$vip_level_number = 0;
$vip_level_name = __('未开通会员', 'aksrt');
$vip_description = $desc_top !== '' ? $desc_top : __('开通会员,尊享专属特权', 'aksrt');
$vip_level_name = __('未开通会员', 'jio');
$vip_description = $desc_top !== '' ? $desc_top : __('开通会员,尊享专属特权', 'jio');
// 未开通时不留到期文案:状态标签已显示「未开通」,参考主题对从未开通
// 用户同样不输出任何到期信息(仅生效中/永久/已过期才有)。
$vip_expiry_text = '';
@@ -48,50 +48,50 @@ if ($level > 0) {
$vip_level_number = $level;
$vip_level_name = (string) ($levels[$level]['name_html'] ?? $levels[$level]['name'] ?? ('VIP' . $level));
$level_desc = (string) ($levels[$level]['desc'] ?? '');
$vip_description = $level_desc !== '' ? $level_desc : __('尊享专属特权', 'aksrt');
$vip_description = $level_desc !== '' ? $level_desc : __('尊享专属特权', 'jio');
if ($expires <= 0 && $vip_state_source !== 'order') {
$vip_state = 'permanent';
$vip_state_label = __('永久有效', 'aksrt');
$vip_expiry_text = __('到期时间:永久会员', 'aksrt');
$vip_state_label = __('永久有效', 'jio');
$vip_expiry_text = __('到期时间:永久会员', 'jio');
$vip_is_permanent = true;
if ($level < 2) {
$btn_type = 'upgrade';
}
} else {
$vip_state = 'active';
$vip_state_label = __('生效中', 'aksrt');
$vip_expiry_text = sprintf(__('到期时间:%s', 'aksrt'), wp_date('Y年m月d日', $expires));
$vip_state_label = __('生效中', 'jio');
$vip_expiry_text = sprintf(__('到期时间:%s', 'jio'), wp_date('Y年m月d日', $expires));
if ($base_level > 0 && $base_level < $level) {
$base_name = wp_strip_all_tags((string) ($levels[$base_level]['name'] ?? ('VIP' . $base_level)));
$base_expiry_text = $base_expires > 0
? wp_date('Y年m月d日', $base_expires)
: __('永久', 'aksrt');
$vip_expiry_text .= ';' . sprintf(__('%s:%s', 'aksrt'), $base_name, $base_expiry_text);
: __('永久', 'jio');
$vip_expiry_text .= ';' . sprintf(__('%s:%s', 'jio'), $base_name, $base_expiry_text);
}
$btn_type = 'renew_' . $level;
}
} elseif ($expired_level > 0) {
$vip_state = 'expired';
$vip_state_label = __('已过期', 'aksrt');
$vip_state_label = __('已过期', 'jio');
$vip_level_number = $expired_level;
$vip_level_name = (string) ($levels[$expired_level]['name_html'] ?? $levels[$expired_level]['name'] ?? ('VIP' . $expired_level));
$expired_desc = (string) ($levels[$expired_level]['desc'] ?? '');
$vip_description = $expired_desc !== ''
? $expired_desc
: ($desc_top !== '' ? $desc_top : __('会员已过期', 'aksrt'));
: ($desc_top !== '' ? $desc_top : __('会员已过期', 'jio'));
$vip_expiry_text = $expires > 0
? sprintf(__('到期时间:%s', 'aksrt'), wp_date('Y年m月d日', $expires))
: __('到期时间:已过期', 'aksrt');
? sprintf(__('到期时间:%s', 'jio'), wp_date('Y年m月d日', $expires))
: __('到期时间:已过期', 'jio');
}
$status_icon_url = esc_url((string) ($levels[$vip_level_number]['img_icon'] ?? ''));
$status_icon = $status_icon_url !== ''
? '<img' . aksrt_get_lazy_attr('lazy_other', $status_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
? '<img' . jio_get_lazy_attr('lazy_other', $status_icon_url, 'jio-vip-level-icon') . ' alt="" decoding="async">'
: '<i class="fa fas fa-certificate"></i>';
$status_html = '<div class="uc-vip-status" role="status">'
. '<div class="uc-vip-status__heading">'
. '<h2 class="uc-vip-status__label">' . esc_html__('我的会员', 'aksrt') . '</h2>'
. '<h2 class="uc-vip-status__label">' . esc_html__('我的会员', 'jio') . '</h2>'
. '<span class="uc-vip-status__state">' . esc_html($vip_state_label) . '</span>'
. '</div>'
. '<div class="uc-vip-status__main uc-vip-status__main--level-' . (int) $vip_level_number . '">'
@@ -113,25 +113,25 @@ foreach ([1, 2] as $lv) {
$lv_desc = (string) ($levels[$lv]['desc'] ?? '');
// Preserve admin equity HTML as-is (sanitize/wrap only; never re-split into items).
$equity_raw = (string) ($levels[$lv]['equity'] ?? '');
$equity = function_exists('aksrt_format_vip_equity_html')
? aksrt_format_vip_equity_html($equity_raw)
$equity = function_exists('jio_format_vip_equity_html')
? jio_format_vip_equity_html($equity_raw)
: '';
$cta = __('开通', 'aksrt') . wp_kses_post($lv_name);
$cta = __('开通', 'jio') . wp_kses_post($lv_name);
$vip_attr = $lv;
// 参考主题 zibpay_get_vip_card:续费/升级档位卡展示各自的一句话简介。
$card_action = 'pay';
$card_desc = $lv_desc;
$lv_icon_url = esc_url((string) ($levels[$lv]['img_icon'] ?? ''));
$lv_icon = $lv_icon_url !== ''
? '<img' . aksrt_get_lazy_attr('lazy_other', $lv_icon_url, 'aksrt-vip-level-icon') . ' alt="" decoding="async">'
? '<img' . jio_get_lazy_attr('lazy_other', $lv_icon_url, 'jio-vip-level-icon') . ' alt="" decoding="async">'
: '<i class="fa fas fa-certificate" aria-hidden="true"></i>';
if (str_starts_with($btn_type, 'renew_')) {
$renew_lv = (int) substr($btn_type, 6);
if ($lv === $renew_lv) {
$cta = __('续费', 'aksrt') . wp_kses_post($lv_name);
$cta = __('续费', 'jio') . wp_kses_post($lv_name);
$card_action = 'renew';
} elseif ($lv > $renew_lv) {
$cta = __('升级', 'aksrt') . wp_kses_post($lv_name);
$cta = __('升级', 'jio') . wp_kses_post($lv_name);
$card_action = 'upgrade';
} else {
continue;
@@ -140,13 +140,13 @@ foreach ([1, 2] as $lv) {
if ($lv <= $level) {
continue;
}
$cta = __('升级', 'aksrt') . wp_kses_post($lv_name);
$cta = __('升级', 'jio') . wp_kses_post($lv_name);
$card_action = 'upgrade';
$vip_attr = 2;
} elseif ($level > 0 && $lv < $level) {
continue;
} elseif ($level > 0 && $lv === $level) {
$cta = __('续费', 'aksrt') . wp_kses_post($lv_name);
$cta = __('续费', 'jio') . wp_kses_post($lv_name);
$card_action = 'renew';
}
if ($card_action === 'renew' && $renew_desc !== '') {
@@ -155,7 +155,7 @@ foreach ([1, 2] as $lv) {
$card_desc = $upgrade_desc;
}
$cards .= '<div class="aksrt-panel text-center pay-vip-info flex1 level-' . $lv . ' uc-vip-level-card">';
$cards .= '<div class="jio-panel text-center pay-vip-info flex1 level-' . $lv . ' uc-vip-level-card">';
$cards .= '<div class="relative uc-vip-level-card__inner">';
$cards .= '<div class="v-iconbox mb10">';
$cards .= '<div class="v-name font-bold"><span class="v-icon">' . $lv_icon . '</span>' . wp_kses_post($lv_name) . '</div>';
@@ -171,8 +171,8 @@ foreach ([1, 2] as $lv) {
}
?>
<div class="uc-vip-tab" data-aksrt-vip-tab>
<div class="uc-vip-summary" data-aksrt-vip-summary data-vip-state="<?php echo esc_attr($vip_state); ?>" data-vip-level="<?php echo (int) $vip_level_number; ?>" data-vip-permanent="<?php echo $vip_is_permanent ? 'true' : 'false'; ?>">
<div class="uc-vip-tab" data-jio-vip-tab>
<div class="uc-vip-summary" data-jio-vip-summary data-vip-state="<?php echo esc_attr($vip_state); ?>" data-vip-level="<?php echo (int) $vip_level_number; ?>" data-vip-permanent="<?php echo $vip_is_permanent ? 'true' : 'false'; ?>">
<div class="uc-vip-summary__watermark" aria-hidden="true"><i class="fa fas fa-certificate"></i></div>
<?php echo $status_html; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
</div>
@@ -184,6 +184,6 @@ foreach ([1, 2] as $lv) {
<?php
// 积分兑换会员入口(参考主题 zibpay_user_page_tab_content_vip 1:1:档位购买卡
// 下方的全宽横条;仅非会员 + 积分兑换开启 + 有可兑换套餐时输出)。
echo aksrt_get_vip_points_exchange_entry_html($user_id, $level); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 各字段已在生成时转义。
echo jio_get_vip_points_exchange_entry_html($user_id, $level); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- 各字段已在生成时转义。
?>
</div>
@@ -1,13 +1,13 @@
<?php
/** Shared balance withdrawal modal. @package AKSRT */
/** Shared balance withdrawal modal. @package Jio */
defined('ABSPATH') || exit;
if (!empty($GLOBALS['aksrt_withdraw_modal_rendered'])) {
if (!empty($GLOBALS['jio_withdraw_modal_rendered'])) {
return;
}
$GLOBALS['aksrt_withdraw_modal_rendered'] = true;
$GLOBALS['jio_withdraw_modal_rendered'] = true;
try {
$withdraw_min = \AKSRT\Ledger\AssetAmount::balance(is_string($withdraw_min ?? null) ? $withdraw_min : '')->decimal();
$withdraw_min = \Jio\Ledger\AssetAmount::balance(is_string($withdraw_min ?? null) ? $withdraw_min : '')->decimal();
} catch (\InvalidArgumentException $e) {
$withdraw_min = '0.00';
}
@@ -18,24 +18,24 @@ if (!$withdraw_channels) {
$withdraw_channels = ['alipay', 'wechat'];
}
?>
<div class="uc-modal" id="aksrt-withdraw-modal" hidden data-aksrt-withdraw-modal>
<div class="uc-modal__overlay" data-aksrt-withdraw-close></div>
<div class="uc-modal" id="jio-withdraw-modal" hidden data-jio-withdraw-modal>
<div class="uc-modal__overlay" data-jio-withdraw-close></div>
<div class="uc-modal__dialog" role="dialog" aria-modal="true">
<button type="button" class="uc-modal__close" data-aksrt-withdraw-close aria-label="<?php esc_attr_e('关闭', 'aksrt'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
<h3 class="uc-modal__title"><?php esc_html_e('余额提现', 'aksrt'); ?></h3>
<form data-aksrt-withdraw-form>
<label class="muted-color em09"><?php esc_html_e('提现金额', 'aksrt'); ?></label>
<input type="number" class="uc-card-pass__input" name="amount" min="<?php echo esc_attr($withdraw_min); ?>" max="<?php echo esc_attr((string) ($withdraw_usage['remaining_amount'] ?? '0.00')); ?>" step="0.01" inputmode="decimal" data-aksrt-withdraw-amount data-withdraw-min="<?php echo esc_attr($withdraw_min); ?>" data-withdraw-remaining-amount="<?php echo esc_attr((string) ($withdraw_usage['remaining_amount'] ?? '0.00')); ?>" data-withdraw-remaining-count="<?php echo esc_attr((string) ($withdraw_usage['remaining_count'] ?? 0)); ?>">
<p class="muted-2-color em09 mt6"><?php printf(esc_html__('最低提现%s 元,今日可提现%d次,提现手续费率%d%%', 'aksrt'), esc_html($withdraw_min), (int) ($withdraw_usage['remaining_count'] ?? 0), $withdraw_fee_rate); ?></p>
<label class="muted-color em09 mt10"><?php esc_html_e('收款方式', 'aksrt'); ?></label>
<select class="uc-card-pass__input" name="method" data-aksrt-withdraw-method>
<button type="button" class="uc-modal__close" data-jio-withdraw-close aria-label="<?php esc_attr_e('关闭', 'jio'); ?>"><i class="fa fas fa-times" aria-hidden="true"></i></button>
<h3 class="uc-modal__title"><?php esc_html_e('余额提现', 'jio'); ?></h3>
<form data-jio-withdraw-form>
<label class="muted-color em09"><?php esc_html_e('提现金额', 'jio'); ?></label>
<input type="number" class="uc-card-pass__input" name="amount" min="<?php echo esc_attr($withdraw_min); ?>" max="<?php echo esc_attr((string) ($withdraw_usage['remaining_amount'] ?? '0.00')); ?>" step="0.01" inputmode="decimal" data-jio-withdraw-amount data-withdraw-min="<?php echo esc_attr($withdraw_min); ?>" data-withdraw-remaining-amount="<?php echo esc_attr((string) ($withdraw_usage['remaining_amount'] ?? '0.00')); ?>" data-withdraw-remaining-count="<?php echo esc_attr((string) ($withdraw_usage['remaining_count'] ?? 0)); ?>">
<p class="muted-2-color em09 mt6"><?php printf(esc_html__('最低提现%s 元,今日可提现%d次,提现手续费率%d%%', 'jio'), esc_html($withdraw_min), (int) ($withdraw_usage['remaining_count'] ?? 0), $withdraw_fee_rate); ?></p>
<label class="muted-color em09 mt10"><?php esc_html_e('收款方式', 'jio'); ?></label>
<select class="uc-card-pass__input" name="method" data-jio-withdraw-method>
<?php foreach ($withdraw_channels as $channel) : ?>
<option value="<?php echo esc_attr($channel); ?>"><?php echo esc_html($channel === 'wechat' ? __('微信收款码', 'aksrt') : __('支付宝收款码', 'aksrt')); ?></option>
<option value="<?php echo esc_attr($channel); ?>"><?php echo esc_html($channel === 'wechat' ? __('微信收款码', 'jio') : __('支付宝收款码', 'jio')); ?></option>
<?php endforeach; ?>
</select>
<label class="muted-color em09 mt10"><?php esc_html_e('收款账户信息', 'aksrt'); ?></label>
<textarea class="uc-card-pass__input" name="account" rows="3" data-aksrt-withdraw-account placeholder="<?php esc_attr_e('姓名 + 账户 / 卡号', 'aksrt'); ?>"></textarea>
<button type="submit" class="but jb-blue btn-block" data-aksrt-withdraw-submit><?php esc_html_e('提交申请', 'aksrt'); ?></button>
<label class="muted-color em09 mt10"><?php esc_html_e('收款账户信息', 'jio'); ?></label>
<textarea class="uc-card-pass__input" name="account" rows="3" data-jio-withdraw-account placeholder="<?php esc_attr_e('姓名 + 账户 / 卡号', 'jio'); ?>"></textarea>
<button type="submit" class="but jb-blue btn-block" data-jio-withdraw-submit><?php esc_html_e('提交申请', 'jio'); ?></button>
</form>
</div>
</div>