feat: 自行开发设计 ui样式优化 超管端-控制台 相关的页面
This commit is contained in:
@@ -18,7 +18,7 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
|
||||
import React, { useState, useEffect, useMemo } from 'react';
|
||||
import { Empty as AntEmpty, Tag as AntTag } from 'antd';
|
||||
import { Button as AntButton, Empty as AntEmpty, Tag as AntTag } from 'antd';
|
||||
import {
|
||||
Typography,
|
||||
Input,
|
||||
@@ -129,7 +129,7 @@ const HistoryPanel = ({ t, refreshTrigger }) => {
|
||||
width: 240,
|
||||
render: (text) => (
|
||||
<Text
|
||||
copyable={{ content: text }}
|
||||
copyable={{ text: text }}
|
||||
className='rc-history-mono'
|
||||
ellipsis={{ showTooltip: true }}
|
||||
>
|
||||
@@ -177,13 +177,14 @@ const HistoryPanel = ({ t, refreshTrigger }) => {
|
||||
render: (_, record) => {
|
||||
if (record.status !== 'pending') return null;
|
||||
return (
|
||||
<Button
|
||||
<AntButton
|
||||
size='small'
|
||||
theme='outline'
|
||||
type='link'
|
||||
className='rc-history-complete-action'
|
||||
onClick={() => confirmAdminComplete(record.trade_no)}
|
||||
>
|
||||
{t('补单')}
|
||||
</Button>
|
||||
</AntButton>
|
||||
);
|
||||
},
|
||||
});
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -43,10 +43,18 @@
|
||||
--rc-empty-bg: #f7f9fb;
|
||||
--rc-empty-border: #e3e9f0;
|
||||
}
|
||||
.ui-recharge-page.rc-standalone {
|
||||
padding-top: calc(
|
||||
var(--console-header-offset, 72px) - var(--content-top-offset, 0px)
|
||||
);
|
||||
}
|
||||
.ui-recharge-page.rc-standalone .ui-recharge-content {
|
||||
max-width: none;
|
||||
margin-inline: 0;
|
||||
padding-inline: var(--rc-content-inset, var(--uc-page-pad-x, 36px));
|
||||
padding-inline-start: calc(
|
||||
var(--sidebar-current-width, 216px) + var(--uc-page-pad-x, 36px)
|
||||
);
|
||||
padding-inline-end: var(--uc-page-pad-x, 36px);
|
||||
}
|
||||
@media (max-width: 768px) {
|
||||
.ui-recharge-page.rc-standalone .ui-recharge-content {
|
||||
@@ -800,6 +808,11 @@ html.dark .ui-recharge-page {
|
||||
.rc-history-table .ant-tag {
|
||||
margin-inline-end: 0;
|
||||
}
|
||||
.rc-history-complete-action.ant-btn {
|
||||
height: auto;
|
||||
padding: 0 4px;
|
||||
font-size: 13px;
|
||||
}
|
||||
.rc-history-money {
|
||||
color: var(--rc-amount);
|
||||
font-weight: 600;
|
||||
|
||||
Reference in New Issue
Block a user