feat(user-center): Zibll-like assets charge, transfer, and dual cards
Complete wallet/points assets surface: sidebar mini dual cards, dual asset row, balance charge packages REST + modal, transfer search/pay, points-to-balance exchange, and payment success credit for recharge orders.
This commit is contained in:
1 parent
8e0f9d989d
commit
0529ab5fb9
9 files changed
+1409
-127
No files matched your search
@@ -1,44 +1,71 @@
|
||||
<?php
|
||||
/**
|
||||
* User center sidebar: rights / commerce shortcuts.
|
||||
*
|
||||
* Expects extracted $context vars.
|
||||
* User center sidebar: Zibll dual asset mini cards + commerce shortcuts.
|
||||
*
|
||||
* @package AKSRT
|
||||
*/
|
||||
|
||||
defined('ABSPATH') || exit;
|
||||
|
||||
if (empty($orders_url) && empty($show_vip) && empty($show_credit_tabs) && empty($balance_enabled)) {
|
||||
$show_wallet = !empty($balance_enabled);
|
||||
$show_credits = !empty($show_credit_tabs) || !empty($credits_enabled);
|
||||
$wallet = (float) ($wallet_balance ?? 0.0);
|
||||
$points = (float) ($credit_balance ?? 0.0);
|
||||
$currency = (string) ($currency_name ?? __('积分', 'aksrt'));
|
||||
|
||||
if ($show_wallet || $show_credits) :
|
||||
$assets_url = function_exists('aksrt_get_user_center_tab_url')
|
||||
? aksrt_get_user_center_tab_url('credits')
|
||||
: '#';
|
||||
?>
|
||||
<div class="uc-sidebar__section">
|
||||
<div class="uc-sidebar__title"><?php esc_html_e('我的资产', 'aksrt'); ?></div>
|
||||
<div class="uc-asset-mini flex ab jsb col-ml6">
|
||||
<?php if ($show_wallet) : ?>
|
||||
<a class="uc-asset-mini__card flex1" href="<?php echo esc_url($assets_url); ?>">
|
||||
<div class="uc-asset-mini__label muted-2-color em09"><?php esc_html_e('余额', 'aksrt'); ?><i class="ml6 fa fa-angle-right em12" aria-hidden="true"></i></div>
|
||||
<div class="flex jsb ac">
|
||||
<span class="font-bold c-blue-2"><?php echo esc_html(class_exists('AKSRT_Balance') ? AKSRT_Balance::format($wallet) : number_format_i18n($wallet, 2)); ?></span>
|
||||
<i class="fas fa-wallet em14 c-blue-2" aria-hidden="true"></i>
|
||||
</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($show_credits) : ?>
|
||||
<a class="uc-asset-mini__card flex1" href="<?php echo esc_url($assets_url); ?>">
|
||||
<div class="uc-asset-mini__label muted-2-color em09"><?php echo esc_html($currency); ?><i class="ml6 fa fa-angle-right em12" aria-hidden="true"></i></div>
|
||||
<div class="flex jsb ac">
|
||||
<span class="font-bold c-yellow"><?php echo esc_html(function_exists('aksrt_format_credits') ? aksrt_format_credits((int) $points) : (string) (int) $points); ?></span>
|
||||
<i class="fas fa-coins em14 c-yellow" aria-hidden="true"></i>
|
||||
</div>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
endif;
|
||||
|
||||
if (empty($orders_url) && empty($show_vip) && empty($show_credit_tabs) && empty($balance_enabled) && empty($affiliate_enabled)) {
|
||||
return;
|
||||
}
|
||||
?>
|
||||
<div class="uc-sidebar__section">
|
||||
<div class="uc-sidebar__title"><?php esc_html_e('权益与消费', 'aksrt'); ?></div>
|
||||
<div class="uc-sidebar__buttons">
|
||||
<?php
|
||||
$revenue_url = function_exists('aksrt_get_revenue_page_url') ? aksrt_get_revenue_page_url() : '';
|
||||
?>
|
||||
<?php if ($orders_url) : ?>
|
||||
<?php $revenue_url = function_exists('aksrt_get_revenue_page_url') ? aksrt_get_revenue_page_url() : ''; ?>
|
||||
<?php if (!empty($orders_url)) : ?>
|
||||
<a href="<?php echo esc_url($orders_url); ?>" class="uc-sidebar__btn">
|
||||
<i class="fas fa-receipt" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('我的订单', 'aksrt'); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($show_vip) : ?>
|
||||
<a class="uc-sidebar__btn<?php echo $active_tab === 'credits' ? ' is-active' : ''; ?>" href="<?php echo esc_url(aksrt_get_user_center_tab_url('credits')); ?>" data-tab="credits">
|
||||
<?php if (!empty($show_vip)) : ?>
|
||||
<a class="uc-sidebar__btn<?php echo (!empty($active_tab) && $active_tab === 'credits') ? ' is-active' : ''; ?>" href="<?php echo esc_url(aksrt_get_user_center_tab_url('credits')); ?>" data-tab="credits">
|
||||
<i class="fas fa-crown" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('VIP 会员', 'aksrt'); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if ($show_credit_tabs) : ?>
|
||||
<a class="uc-sidebar__btn<?php echo $active_tab === 'credits' ? ' is-active' : ''; ?>" href="<?php echo esc_url(aksrt_get_user_center_tab_url('credits')); ?>" data-tab="credits">
|
||||
<i class="fas fa-coins" aria-hidden="true"></i>
|
||||
<span><?php echo esc_html($currency_name); ?></span>
|
||||
</a>
|
||||
<?php endif; ?>
|
||||
<?php if (!empty($affiliate_enabled) && $revenue_url) : ?>
|
||||
<a href="<?php echo esc_url($revenue_url); ?>" class="uc-sidebar__btn">
|
||||
<?php if (!empty($affiliate_enabled) && $revenue_url) : ?>
|
||||
<a href="<?php echo esc_url($revenue_url); ?>" class="uc-sidebar__btn">
|
||||
<i class="fas fa-share-alt" aria-hidden="true"></i>
|
||||
<span><?php esc_html_e('推广返佣', 'aksrt'); ?></span>
|
||||
</a>
|
||||
|
||||
Reference in new issue
Block a user