merge: 合入总仓库 weiyuan(bfdfb339) web/ 新功能,保留 ui-optimization 的 UI 重构
来源:luoguang/monkey-ai weiyuan@bfdfb339 的 web/(经 sync/main-weiyuan-web-bfdfb339 同步)
同步基准:总仓库 a2ca13cb = 本仓库初始导入 d8f3aee2
冲突处理原则:保留 ui-optimization 的 UI(样式/结构/组件),嫁接 weiyuan 的功能逻辑。
- i18n:按键三方合并;ours 的「令牌→密钥」改名键上移植 theirs 的术语修订
- task-logs / OrgLogs:ours 已手工移植同一功能(6ad95e2),保留 ours
- 删除:OrgCreate(theirs 下线 /org/create)、旧 image 组件与 VideoRegenerateModal(theirs 体验中心重写)、
OrgAvatarSection / PricingBentoPage / CommissionConsole(ours 重构中已移除)
- 测试:users-pagination 的 i18next mock 补 t();theirs 新增文件补 license header
This commit is contained in:
@@ -306,7 +306,7 @@ const Invoice = () => {
|
||||
title: t('支付方式'),
|
||||
dataIndex: 'payment_method',
|
||||
width: 100,
|
||||
render: (v) => (v ? paymentMethodMap[v] || v : '-'),
|
||||
render: (v) => (v ? t(paymentMethodMap[v] || v) : '-'),
|
||||
},
|
||||
{
|
||||
title: t('支付金额'),
|
||||
@@ -618,8 +618,10 @@ const Invoice = () => {
|
||||
>
|
||||
<span>{formatTime(topup.complete_time)}</span>
|
||||
<span>
|
||||
{paymentMethodMap[topup.payment_method] ||
|
||||
topup.payment_method}
|
||||
{t(
|
||||
paymentMethodMap[topup.payment_method] ||
|
||||
topup.payment_method,
|
||||
)}
|
||||
</span>
|
||||
<span className='font-medium'>
|
||||
¥{Number(topup.money).toFixed(2)}
|
||||
|
||||
@@ -19,6 +19,10 @@ For commercial licensing, please contact support@quantumnous.com
|
||||
|
||||
import React, { useMemo, useContext } from 'react';
|
||||
import { Link, useLocation } from 'react-router-dom';
|
||||
import {
|
||||
isMiniProgramPaymentPath,
|
||||
isMiniProgramWebView,
|
||||
} from '../../helpers/miniProgram';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import {
|
||||
LayoutGrid,
|
||||
@@ -166,10 +170,15 @@ const UserCenterSidebar = () => {
|
||||
if (!sidebarConfig.enabled) {
|
||||
return [];
|
||||
}
|
||||
const inMiniProgram = isMiniProgramWebView();
|
||||
return allItems.filter(
|
||||
(item) =>
|
||||
sidebarConfig[item.configKey] !== false &&
|
||||
isGroupAllowed(sidebarConfig.moduleGroups?.[item.configKey], userGroup),
|
||||
isGroupAllowed(
|
||||
sidebarConfig.moduleGroups?.[item.configKey],
|
||||
userGroup,
|
||||
) &&
|
||||
!(inMiniProgram && isMiniProgramPaymentPath(item.itemKey)),
|
||||
);
|
||||
}, [allItems, sidebarConfig, userGroup]);
|
||||
|
||||
|
||||
@@ -239,8 +239,10 @@ const UserDashboard = () => {
|
||||
<Tag size='small'>{membershipInfo.plan_name}</Tag>
|
||||
<span className='uc-member-benefits-meta'>
|
||||
<Clock size={12} />
|
||||
{dashboardData.t('剩余')} {membershipInfo.remaining_days}{' '}
|
||||
{dashboardData.t('天')}
|
||||
{dashboardData.t('剩余 {{n}} 天', {
|
||||
n: membershipInfo.remaining_days,
|
||||
count: membershipInfo.remaining_days,
|
||||
})}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
|
||||
@@ -51,6 +51,10 @@ import ServiceDashboard from '../ServiceDashboard';
|
||||
import WeyAiDownload from '../WeyAiDownload';
|
||||
import KeyManagement from '../KeyManagement';
|
||||
import { normalizeSidebarModulesAdmin } from '../../constants/sidebarModules';
|
||||
import {
|
||||
isMiniProgramPaymentPath,
|
||||
isMiniProgramWebView,
|
||||
} from '../../helpers/miniProgram';
|
||||
|
||||
// 移动端底部导航组件
|
||||
const MobileBottomNav = ({ sidebarConfig }) => {
|
||||
@@ -109,9 +113,12 @@ const MobileBottomNav = ({ sidebarConfig }) => {
|
||||
},
|
||||
];
|
||||
|
||||
const inMiniProgram = isMiniProgramWebView();
|
||||
const visibleNavItems = navItems.filter(
|
||||
(item) =>
|
||||
sidebarConfig?.enabled !== false && sidebarConfig?.[item.key] !== false,
|
||||
sidebarConfig?.enabled !== false &&
|
||||
sidebarConfig?.[item.key] !== false &&
|
||||
!(inMiniProgram && isMiniProgramPaymentPath(item.path)),
|
||||
);
|
||||
|
||||
if (visibleNavItems.length === 0) {
|
||||
@@ -177,11 +184,20 @@ const UserCenter = ({ keyManagementMode = false }) => {
|
||||
invite: 'invite',
|
||||
settings: 'settings',
|
||||
};
|
||||
// 小程序里付费页面会被 App.jsx 送回 /user-center,所以默认页不能落在它们上面,否则来回跳转。
|
||||
const inMiniProgram = isMiniProgramWebView();
|
||||
const firstVisiblePath =
|
||||
userCenterConfig.enabled === false
|
||||
? null
|
||||
: routePathMap[
|
||||
userCenterRoutes.find((key) => userCenterConfig[key] !== false)
|
||||
userCenterRoutes.find(
|
||||
(key) =>
|
||||
userCenterConfig[key] !== false &&
|
||||
!(
|
||||
inMiniProgram &&
|
||||
isMiniProgramPaymentPath(`/user-center/${routePathMap[key]}`)
|
||||
),
|
||||
)
|
||||
] || null;
|
||||
const firstVisibleRoute = firstVisiblePath
|
||||
? `/user-center/${firstVisiblePath}`
|
||||
|
||||
Reference in New Issue
Block a user