From 7b5ac2ef158836dc7d167586dce482ae2bb86709 Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Wed, 17 Dec 2025 19:20:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0Company=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E7=9A=84UI=E4=B8=BAFUI=E9=A3=8E=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StockSummaryCard/MetricCard.tsx | 116 +++++++++--- .../StockSummaryCard/StockHeaderCard.tsx | 175 +++++++++++++++--- .../StockSummaryCard/atoms/CardTitle.tsx | 84 +++++++-- .../StockSummaryCard/atoms/DarkGoldCard.tsx | 99 ++++++++-- .../StockSummaryCard/atoms/MetricValue.tsx | 86 +++++++-- 5 files changed, 475 insertions(+), 85 deletions(-) diff --git a/src/views/Company/components/MarketDataView/components/StockSummaryCard/MetricCard.tsx b/src/views/Company/components/MarketDataView/components/StockSummaryCard/MetricCard.tsx index 8be9af42..75844caf 100644 --- a/src/views/Company/components/MarketDataView/components/StockSummaryCard/MetricCard.tsx +++ b/src/views/Company/components/MarketDataView/components/StockSummaryCard/MetricCard.tsx @@ -1,4 +1,4 @@ -// 指标卡片组件 +// 指标卡片组件 - FUI 科幻风格 import React from 'react'; import { Box, VStack } from '@chakra-ui/react'; import { DarkGoldCard, CardTitle, MetricValue } from './atoms'; @@ -17,7 +17,13 @@ export interface MetricCardProps { } /** - * 指标卡片组件 - 用于展示单个指标数据 + * 指标卡片组件 - FUI 科幻风格 + * + * 特点: + * - Glassmorphism 卡片 + * - 角落装饰 + * - 发光数值 + * - 环境光效果 */ const MetricCard: React.FC = ({ title, @@ -29,28 +35,94 @@ const MetricCard: React.FC = ({ mainColor, mainSuffix, subText, -}) => ( - - +}) => { + // 根据数值颜色生成环境光 + const getAmbientColor = (color: string) => { + if (color.includes('red') || color === '#EF4444' || color === darkGoldTheme.priceUp) { + return 'rgba(239, 68, 68, 0.15)'; + } + if (color.includes('green') || color === '#22C55E' || color === darkGoldTheme.priceDown) { + return 'rgba(34, 197, 94, 0.15)'; + } + return 'rgba(212, 175, 55, 0.1)'; + }; - - + {/* James Turrell 环境光效果 */} + - - - {subText} - - -); + {/* 数据脉冲动画装饰 */} + + + {/* 卡片标题 */} + + + + + {/* 主数值区域 */} + + + + + {/* 辅助信息 */} + + {subText} + + + {/* 底部渐变线 */} + + + ); +}; export default MetricCard; diff --git a/src/views/Company/components/MarketDataView/components/StockSummaryCard/StockHeaderCard.tsx b/src/views/Company/components/MarketDataView/components/StockSummaryCard/StockHeaderCard.tsx index 8d7a339f..c290c7cb 100644 --- a/src/views/Company/components/MarketDataView/components/StockSummaryCard/StockHeaderCard.tsx +++ b/src/views/Company/components/MarketDataView/components/StockSummaryCard/StockHeaderCard.tsx @@ -1,7 +1,7 @@ -// 股票信息卡片组件(4列布局版本) +// 股票信息卡片组件(4列布局版本)- FUI 科幻风格 import React from 'react'; -import { Box, HStack, Text, Icon } from '@chakra-ui/react'; -import { TrendingUp, TrendingDown } from 'lucide-react'; +import { Box, HStack, VStack, Text, Icon, Badge } from '@chakra-ui/react'; +import { TrendingUp, TrendingDown, Activity } from 'lucide-react'; import { DarkGoldCard } from './atoms'; import { getTrendDescription, getPriceColor } from './utils'; import { darkGoldTheme } from '../../constants'; @@ -14,7 +14,13 @@ export interface StockHeaderCardProps { } /** - * 股票信息卡片 - 4 列布局中的第一个卡片 + * 股票信息卡片 - FUI 科幻风格 + * + * 设计特点: + * - Glassmorphism 毛玻璃效果 + * - 价格发光效果 + * - James Turrell 环境光 + * - 角落装饰 */ const StockHeaderCard: React.FC = ({ stockName, @@ -26,63 +32,176 @@ const StockHeaderCard: React.FC = ({ const priceColor = getPriceColor(changePercent); const trendDesc = getTrendDescription(changePercent); + // 根据涨跌生成发光颜色 + const glowColor = isUp + ? 'rgba(239, 68, 68, 0.4)' + : 'rgba(34, 197, 94, 0.4)'; + return ( - - {/* 背景装饰线 */} + + {/* 背景装饰线 - 增强版 */} + {/* James Turrell 环境光效果 */} + + + {/* 数据扫描线动画 */} + + {/* 股票名称和代码 */} - + + {/* 状态指示器 */} + {stockName} - - ({stockCode}) - + + {stockCode} + {/* 价格和涨跌幅 */} - - + {/* 价格发光效果 */} + + + {price.toFixed(2)} + + + {price.toFixed(2)} + + + + {/* 涨跌幅徽章 - FUI 风格 */} + - {price.toFixed(2)} - - - + {isUp ? '+' : ''}{changePercent.toFixed(2)}% - + - {/* 走势简述 */} - - 走势简述: - - {trendDesc} + {/* 走势简述 - FUI 标签风格 */} + + + + 走势: + + {trendDesc} + - + + + {/* 底部数据线 */} + ); }; diff --git a/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/CardTitle.tsx b/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/CardTitle.tsx index 1cd5d2cd..47b5f351 100644 --- a/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/CardTitle.tsx +++ b/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/CardTitle.tsx @@ -1,6 +1,6 @@ -// 卡片标题原子组件 +// 卡片标题原子组件 - FUI 科幻风格 import React from 'react'; -import { Flex, HStack, Box, Text } from '@chakra-ui/react'; +import { Flex, HStack, Box, Text, Badge } from '@chakra-ui/react'; import { darkGoldTheme } from '../../../constants'; interface CardTitleProps { @@ -11,7 +11,13 @@ interface CardTitleProps { } /** - * 卡片标题组件 - 显示图标+标题+副标题 + * 卡片标题组件 - FUI 风格 + * + * 特点: + * - 图标发光效果 + * - 标题发光文字 + * - 副标题徽章样式 + * - 装饰性分割线 */ const CardTitle: React.FC = ({ title, @@ -19,17 +25,73 @@ const CardTitle: React.FC = ({ leftIcon, rightIcon, }) => ( - - - {leftIcon} - + + + {/* 图标容器 - 发光效果 */} + *': { + filter: 'drop-shadow(0 0 4px rgba(212, 175, 55, 0.6))', + }, + }} + > + {leftIcon} + + + {/* 标题 - 发光文字 */} + {title} - - ({subtitle}) - + + {/* 副标题 - 徽章风格 */} + + {subtitle} + - {rightIcon && {rightIcon}} + + {/* 右侧图标 - 发光效果 */} + {rightIcon && ( + *': { + filter: 'drop-shadow(0 0 4px rgba(212, 175, 55, 0.4))', + }, + }} + > + {rightIcon} + + )} + + {/* 底部装饰线 */} + ); diff --git a/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/DarkGoldCard.tsx b/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/DarkGoldCard.tsx index e7992070..9cb7dec8 100644 --- a/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/DarkGoldCard.tsx +++ b/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/DarkGoldCard.tsx @@ -1,4 +1,4 @@ -// 黑金主题卡片容器原子组件 +// 黑金主题卡片容器原子组件 - FUI 科幻风格 import React from 'react'; import { Box, BoxProps } from '@chakra-ui/react'; import { darkGoldTheme } from '../../../constants'; @@ -6,36 +6,113 @@ import { darkGoldTheme } from '../../../constants'; interface DarkGoldCardProps extends BoxProps { children: React.ReactNode; hoverable?: boolean; + /** 是否显示角落装饰 */ + cornerDecor?: boolean; + /** 是否显示发光效果 */ + glowing?: boolean; } /** - * 黑金主题卡片容器 + * 黑金主题卡片容器 - FUI 风格 + * + * 特点: + * - Glassmorphism 毛玻璃效果 + * - 悬停发光动画 + * - 可选角落装饰 */ const DarkGoldCard: React.FC = ({ children, hoverable = true, + cornerDecor = false, + glowing = false, ...props }) => ( - {children} + {/* 角落装饰 */} + {cornerDecor && ( + <> + + + + + + )} + + {/* 顶部光线 */} + + + {/* 内容 */} + + {children} + ); diff --git a/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/MetricValue.tsx b/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/MetricValue.tsx index 987fa4e4..656be2b5 100644 --- a/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/MetricValue.tsx +++ b/src/views/Company/components/MarketDataView/components/StockSummaryCard/atoms/MetricValue.tsx @@ -1,6 +1,6 @@ -// 核心数值展示原子组件 +// 核心数值展示原子组件 - FUI 科幻风格 import React from 'react'; -import { HStack, Text } from '@chakra-ui/react'; +import { Box, HStack, Text } from '@chakra-ui/react'; import { darkGoldTheme } from '../../../constants'; interface MetricValueProps { @@ -9,6 +9,8 @@ interface MetricValueProps { color: string; suffix?: string; size?: 'sm' | 'md' | 'lg'; + /** 是否启用发光效果 */ + glowing?: boolean; } const sizeMap = { @@ -18,7 +20,12 @@ const sizeMap = { }; /** - * 核心数值展示组件 - 显示标签+数值 + * 核心数值展示组件 - FUI 风格 + * + * 特点: + * - 发光数值效果 + * - 等宽字体显示 + * - 悬停增强效果 */ const MetricValue: React.FC = ({ label, @@ -26,24 +33,77 @@ const MetricValue: React.FC = ({ color, suffix, size = 'lg', + glowing = true, }) => { const sizes = sizeMap[size]; + // 生成发光颜色(从传入的颜色中提取或使用默认) + const getGlowColor = (c: string) => { + if (c.includes('red') || c === '#EF4444' || c === darkGoldTheme.priceUp) { + return 'rgba(239, 68, 68, 0.5)'; + } + if (c.includes('green') || c === '#22C55E' || c === darkGoldTheme.priceDown) { + return 'rgba(34, 197, 94, 0.5)'; + } + return 'rgba(212, 175, 55, 0.5)'; + }; + + const glowColor = getGlowColor(color); + return ( - + {/* 标签 - 添加微妙动画 */} + {label} - - {value} - + + {/* 数值 - FUI 发光效果 */} + + {/* 发光层 */} + {glowing && ( + + )} + {/* 主数值 */} + + {value} + + + + {/* 后缀 */} {suffix && ( - + {suffix} )}