diff --git a/inc/helpers/aksrt-header-userbox.php b/inc/helpers/aksrt-header-userbox.php index f556868e..1213e503 100644 --- a/inc/helpers/aksrt-header-userbox.php +++ b/inc/helpers/aksrt-header-userbox.php @@ -137,6 +137,8 @@ if (!function_exists('aksrt_header_user_wallet_mini')) : $center = function_exists('aksrt_get_user_center_url') ? aksrt_get_user_center_url('credits') : '#'; $box = ''; + $balance_icon = aksrt_icon_markup('zibsvg-money-color-2', 'em14'); + $points_icon = aksrt_icon_markup('zibsvg-points-color', 'em14'); if ($balance_on) { $box .= '' @@ -144,7 +146,7 @@ if (!function_exists('aksrt_header_user_wallet_mini')) : . '' . '
' . esc_html(aksrt_cut_count((float) aksrt_user_balance_decimal($user_id))) - . '
'; + . '' . $balance_icon . ''; } if ($points_on) { @@ -154,7 +156,7 @@ if (!function_exists('aksrt_header_user_wallet_mini')) : . '' . '
' . esc_html(aksrt_cut_count(aksrt_user_points($user_id))) - . '
'; + . '' . $points_icon . ''; } return '
' . $box . '
'; diff --git a/tests/navigation/legacy-navigation-contract.test.cjs b/tests/navigation/legacy-navigation-contract.test.cjs index 255bcd2f..c64745bb 100644 --- a/tests/navigation/legacy-navigation-contract.test.cjs +++ b/tests/navigation/legacy-navigation-contract.test.cjs @@ -246,13 +246,18 @@ test('the account popover rows match the reference user box structure', () => { assert.match(header, /admin\.php\?page=aksrt_pay/); assert.match(header, /支付中心/); - // Wallet tiles: balance first, muted-box geometry, FA5 icons. + // Wallet tiles: balance first, muted-box geometry, reference sprite icons. assert.match(header, /class="flex ab jsb col-ml6"/); assert.match(header, /muted-box padding-6 flex1 radius4/); assert.match(header, /font-bold c-blue-2/); assert.match(header, /font-bold c-yellow/); - assert.match(header, /fa fas fa-money-bill-wave em14 c-blue-2/); - assert.match(header, /fa fas fa-coins em14 c-yellow/); + assert.match(header, /aksrt_icon_markup\('zibsvg-money-color-2', 'em14'\)/); + assert.match(header, /aksrt_icon_markup\('zibsvg-points-color', 'em14'\)/); + // The value icons are the reference theme's multi-tone SVGs, not FA5 glyphs; + // the tile arrow stays on fa-angle-right exactly as the reference renders it. + assert.doesNotMatch(header, /fa fas fa-money-bill-wave/); + assert.doesNotMatch(header, /fa fas fa-coins/); + assert.match(header, /fa fas fa-angle-right em12/); // Message icon uses the reference markup. assert.match(header, /msg-news-icon abs-right/); diff --git a/tests/widget-system/user-center-sidebar-icons-contract.test.cjs b/tests/widget-system/user-center-sidebar-icons-contract.test.cjs index a668748f..4f773aa2 100644 --- a/tests/widget-system/user-center-sidebar-icons-contract.test.cjs +++ b/tests/widget-system/user-center-sidebar-icons-contract.test.cjs @@ -115,3 +115,18 @@ test('所用 sprite key 均在前端 sprite 中定义', () => { assert.match(sprite, new RegExp(`aksrt_svgs\\['${key}'\\]\\s*=`), `sprite key missing: ${key}`); } }); + +test('导航栏用户浮层的余额/积分磁贴与侧栏使用同一组 sprite key', () => { + const nav = read(sidebarDir + 'sidebar-commerce.php'); + const wallet = read('inc/helpers/aksrt-header-userbox.php'); + + assert.match(wallet, /aksrt_icon_markup\('zibsvg-money-color-2', 'em14'\)/); + assert.match(wallet, /aksrt_icon_markup\('zibsvg-points-color', 'em14'\)/); + assert.match(nav, /aksrt_icon_markup\('zibsvg-money-color-2'\)/); + assert.match(nav, /aksrt_icon_markup\('zibsvg-points-color'\)/); + + // 磁贴箭头沿用参考主题的 fa-angle-right,不做多余替换。 + assert.match(wallet, /fa fas fa-angle-right em12/); + assert.doesNotMatch(wallet, /fa fas fa-money-bill-wave/); + assert.doesNotMatch(wallet, /fa fas fa-coins/); +});