feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面

This commit is contained in:
zhanjunhao
2026-11-09 21:45:37 +08:00
parent 9fc5fd212d
commit 28e924e371
242 changed files with 9242 additions and 5043 deletions
+16 -57
View File
@@ -17,17 +17,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
For commercial licensing, please contact support@quantumnous.com
*/
import React, {
useEffect,
useLayoutEffect,
useRef,
useState,
useContext,
} from 'react';
import React, { useEffect, useState, useContext } from 'react';
import { useLocation } from 'react-router-dom';
import { Segmented, Tabs } from 'antd';
import { Modal, Toast } from '@/components/ui';
import UserCenterPageHeader from '../../components/common/UserCenterPageHeader';
import { useConsolePage } from '../../components/console/ConsoleContext';
import { useTranslation } from 'react-i18next';
import { UserContext } from '../../context/User';
import { StatusContext } from '../../context/Status';
@@ -60,51 +55,10 @@ import {
} from '../../helpers/paypalPayment';
const Recharge = ({ embedded = false }) => {
const consolePage = useConsolePage();
const { t } = useTranslation();
const { pathname } = useLocation();
const alignStandaloneContent = !embedded && pathname === '/recharge';
const contentRef = useRef(null);
useLayoutEffect(() => {
if (!alignStandaloneContent) return undefined;
const content = contentRef.current;
const topbar = document.querySelector('.ui-topbar');
if (!content || !topbar) return undefined;
const resizeObserver = new ResizeObserver(() => alignContent());
const alignContent = () => {
const label = topbar.querySelector(
'.ui-header-navigation a[href="/market"] > span',
);
if (window.innerWidth > 768 && label?.getClientRects().length) {
const inset = Math.max(
16,
label.getBoundingClientRect().left -
content.getBoundingClientRect().left,
);
content.style.setProperty('--rc-content-inset', `${inset}px`);
} else {
content.style.removeProperty('--rc-content-inset');
}
if (label) resizeObserver.observe(label);
const brand = topbar.querySelector('.ui-header-brand');
if (brand) resizeObserver.observe(brand);
};
// The navigation may finish loading or change language after this page mounts.
const mutationObserver = new MutationObserver(alignContent);
mutationObserver.observe(topbar, { childList: true, subtree: true });
resizeObserver.observe(topbar);
resizeObserver.observe(content);
window.addEventListener('resize', alignContent);
alignContent();
return () => {
resizeObserver.disconnect();
mutationObserver.disconnect();
window.removeEventListener('resize', alignContent);
content.style.removeProperty('--rc-content-inset');
};
}, [alignStandaloneContent]);
const [userState, userDispatch] = useContext(UserContext);
const [statusState] = useContext(StatusContext);
@@ -779,12 +733,12 @@ const Recharge = ({ embedded = false }) => {
return (
<div
className={`ui-recharge-page ${alignStandaloneContent ? 'rc-standalone' : ''} relative w-full min-h-screen pt-[64px] ${embedded ? '' : 'bg-[var(--surface-bg-base)]'}`}
className={`ui-recharge-page ${consolePage ? 'console-recharge' : `${alignStandaloneContent ? 'rc-standalone' : ''} relative w-full min-h-screen pt-[64px] ${embedded ? '' : 'bg-[var(--surface-bg-base)]'}`}`}
>
{/* 统一页面背景层 —— 走 bg-glow-* 主题变量。
* embedded(嵌入 UserCenter/topup)时由父 shell 提供背景,此处跳过避免双层叠加;
* 独立路由(/recharge、/console/topup)时自渲染 rich 背景 + 网格。 */}
{!embedded && <PageBackground variant='rich' grid />}
{!embedded && !consolePage && <PageBackground variant='rich' grid />}
{/* 支付确认弹窗 */}
<PaymentConfirmModal
@@ -851,13 +805,18 @@ const Recharge = ({ embedded = false }) => {
{/* 主内容区 */}
<div
ref={contentRef}
className='ui-recharge-content uc-page relative z-10 max-w-7xl mx-auto'
className={
consolePage
? 'ui-recharge-content console-content'
: 'ui-recharge-content uc-page relative z-10 max-w-7xl mx-auto'
}
>
<UserCenterPageHeader
title={t('在线充值')}
subtitle={t('管理账户余额,让每一次模型调用从容开始。')}
/>
{!consolePage && (
<UserCenterPageHeader
title={t('在线充值')}
subtitle={t('管理账户余额,让每一次模型调用从容开始。')}
/>
)}
<div className='rc-layout'>
<WalletCard
t={t}