fix: improve promotion tabs and referral layout

This commit is contained in:
kate522 committed 2026-08-16 21:28:02 +08:00
1 parent 5b9f54f5ac
commit 853114a9f9
18 files changed
+127 -602

No files matched your search

+3 -13
View File
@@ -133,11 +133,6 @@ if (!function_exists('aksrt_get_user_center_tab_url')) {
*/
function aksrt_get_user_center_tab_url(string $tab): string {
$tab = sanitize_key($tab);
if ('invite' === $tab) {
$tab = 'promotion';
} elseif ('revenue' === $tab) {
$tab = 'promotion';
}
return aksrt_get_user_center_url($tab);
}
}
@@ -182,7 +177,7 @@ if (!function_exists('aksrt_capture_user_center_view')) {
'vip' => 'vip',
'orders' => 'orders',
'auth' => 'auth',
'promotion' => 'promotion',
'revenue' => 'revenue',
'settings' => 'settings',
'header' => 'header',
'sidebar' => 'sidebar',
@@ -207,7 +202,7 @@ if (!function_exists('aksrt_capture_user_center_panel')) {
* Capture a built-in or registered user-center panel body.
*/
function aksrt_capture_user_center_panel(string $tab_key, array $tab, array $context): string {
$built_in_tabs = ['profile', 'level', 'creator', 'posts', 'follow', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'promotion', 'settings'];
$built_in_tabs = ['profile', 'level', 'creator', 'posts', 'follow', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'revenue', 'settings'];
if (in_array($tab_key, $built_in_tabs, true)) {
return aksrt_capture_user_center_view($tab_key, $context);
}
@@ -316,10 +311,6 @@ if (!function_exists('aksrt_user_center_resolve_tabs')) {
}
if ('signin' === $active || 'assets' === $active) {
$active = 'credits';
} elseif ('invite' === $active) {
$active = 'promotion';
} elseif ('revenue' === $active) {
$active = 'promotion';
} elseif ('vip' === $active) {
// Prefer dedicated vip tab when registered; else credits (VIP shop).
$active = in_array('vip', $keys, true) ? 'vip' : 'credits';
@@ -358,8 +349,7 @@ if (!function_exists('aksrt_user_center_runtime_config')) {
'activeTab' => $active_tab,
'tabAliases' => [
'signin' => 'credits',
'invite' => 'promotion',
'revenue' => 'promotion',
'revenue' => 'revenue',
'assets' => 'credits',
// vip → vip when panel exists; SPA may still map missing keys via server resolve.
'vip' => 'vip',