feat: upgrade widgets and affiliate commission flow

This commit is contained in:
kate522 committed 2026-08-16 18:29:31 +08:00
1 parent 22c0c9df9c
commit 698a9beb74
33 files changed
+709 -227

No files matched your search

+7 -7
View File
@@ -133,8 +133,8 @@ 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 || 'promotion' === $tab) {
$tab = 'revenue';
if ('invite' === $tab) {
$tab = 'promotion';
}
return aksrt_get_user_center_url($tab);
}
@@ -180,6 +180,7 @@ if (!function_exists('aksrt_capture_user_center_view')) {
'vip' => 'vip',
'orders' => 'orders',
'auth' => 'auth',
'promotion' => 'promotion',
'revenue' => 'revenue',
'settings' => 'settings',
'header' => 'header',
@@ -205,7 +206,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', 'revenue', 'settings'];
$built_in_tabs = ['profile', 'level', 'creator', 'posts', 'follow', 'comments', 'favorites', 'credits', 'vip', 'orders', 'auth', 'promotion', 'revenue', 'settings'];
if (in_array($tab_key, $built_in_tabs, true)) {
return aksrt_capture_user_center_view($tab_key, $context);
}
@@ -314,8 +315,8 @@ if (!function_exists('aksrt_user_center_resolve_tabs')) {
}
if ('signin' === $active || 'assets' === $active) {
$active = 'credits';
} elseif ('invite' === $active || 'promotion' === $active) {
$active = 'revenue';
} elseif ('invite' === $active) {
$active = 'promotion';
} elseif ('vip' === $active) {
// Prefer dedicated vip tab when registered; else credits (VIP shop).
$active = in_array('vip', $keys, true) ? 'vip' : 'credits';
@@ -354,8 +355,7 @@ if (!function_exists('aksrt_user_center_runtime_config')) {
'activeTab' => $active_tab,
'tabAliases' => [
'signin' => 'credits',
'invite' => 'revenue',
'promotion' => 'revenue',
'invite' => 'promotion',
'assets' => 'credits',
// vip → vip when panel exists; SPA may still map missing keys via server resolve.
'vip' => 'vip',