diff --git a/src/components/EventDetailPanel/CollapsibleHeader.js b/src/components/EventDetailPanel/CollapsibleHeader.js index 77799a64..6f9de85b 100644 --- a/src/components/EventDetailPanel/CollapsibleHeader.js +++ b/src/components/EventDetailPanel/CollapsibleHeader.js @@ -10,9 +10,9 @@ import { Badge, IconButton, Button, - useColorModeValue, } from '@chakra-ui/react'; import { ChevronDownIcon, ChevronUpIcon } from '@chakra-ui/icons'; +import { PROFESSIONAL_COLORS } from '@constants/professionalTheme'; /** * 可折叠模块标题组件 @@ -38,9 +38,10 @@ const CollapsibleHeader = ({ onModeToggle = null, isLocked = false }) => { - const sectionBg = useColorModeValue('gray.50', 'gray.750'); - const hoverBg = useColorModeValue('gray.100', 'gray.700'); - const headingColor = useColorModeValue('gray.700', 'gray.200'); + // 深色主题 - 标题区块背景稍亮 + const sectionBg = '#3D4A5C'; + const hoverBg = '#4A5568'; + const headingColor = '#F7FAFC'; // 获取按钮文案 const getButtonText = () => { diff --git a/src/components/EventDetailPanel/CollapsibleSection.js b/src/components/EventDetailPanel/CollapsibleSection.js index 289e2b80..394b8623 100644 --- a/src/components/EventDetailPanel/CollapsibleSection.js +++ b/src/components/EventDetailPanel/CollapsibleSection.js @@ -5,10 +5,8 @@ import React, { useState } from 'react'; import { Box, Collapse, - useColorModeValue, } from '@chakra-ui/react'; import CollapsibleHeader from './CollapsibleHeader'; -import { PROFESSIONAL_COLORS } from '@constants/professionalTheme'; /** * 通用可折叠区块组件 @@ -38,7 +36,8 @@ const CollapsibleSection = ({ showModeToggle = false, defaultMode = 'detailed' }) => { - const sectionBg = PROFESSIONAL_COLORS.background.secondary; + // 深色主题 - 折叠区块背景稍亮 + const sectionBg = '#354259'; // 模式状态:'detailed' | 'simple' const [displayMode, setDisplayMode] = useState(defaultMode); diff --git a/src/components/EventDetailPanel/DynamicNewsDetailPanel.js b/src/components/EventDetailPanel/DynamicNewsDetailPanel.js index a2d16d1b..6d92d16b 100644 --- a/src/components/EventDetailPanel/DynamicNewsDetailPanel.js +++ b/src/components/EventDetailPanel/DynamicNewsDetailPanel.js @@ -86,9 +86,10 @@ const sectionReducer = (state, action) => { const DynamicNewsDetailPanel = ({ event, showHeader = true }) => { const dispatch = useDispatch(); const { user } = useAuth(); - const cardBg = PROFESSIONAL_COLORS.background.card; - const borderColor = PROFESSIONAL_COLORS.border.default; - const textColor = PROFESSIONAL_COLORS.text.secondary; + // 深色主题 - 与弹窗背景一致 + const cardBg = '#2D3748'; + const borderColor = 'rgba(255, 255, 255, 0.08)'; + const textColor = '#CBD5E0'; // 使用 useWatchlist Hook 管理自选股 const { diff --git a/src/views/Community/components/DynamicNews/layouts/MainlineTimelineView.js b/src/views/Community/components/DynamicNews/layouts/MainlineTimelineView.js index 9c8c75b5..6ebd6a23 100644 --- a/src/views/Community/components/DynamicNews/layouts/MainlineTimelineView.js +++ b/src/views/Community/components/DynamicNews/layouts/MainlineTimelineView.js @@ -130,12 +130,12 @@ const TimelineEventItem = React.memo(({ event, isSelected, onEventClick }) => { {/* 第二行:标题 */} {event.title} diff --git a/src/views/Community/components/EventDetailModal/EventDetailModal.less b/src/views/Community/components/EventDetailModal/EventDetailModal.less index e2378b3f..c25258ad 100644 --- a/src/views/Community/components/EventDetailModal/EventDetailModal.less +++ b/src/views/Community/components/EventDetailModal/EventDetailModal.less @@ -1,7 +1,72 @@ -// 事件详情抽屉样式(从底部弹出) -// 注意:大部分样式已在 TSX 的 styles 属性中配置,这里只保留必要的覆盖 -.event-detail-drawer { - // 标题样式 +// 事件详情抽屉样式(从底部弹出)- 深色毛玻璃风格 +// 整体比背景亮一些,形成层次感 + +// 深色主题变量 - 提亮以区分背景 +@glass-bg: #2D3748; +@glass-header-bg: #3D4A5C; +@glass-border: rgba(255, 255, 255, 0.12); +@glass-text: #F7FAFC; +@glass-text-secondary: #CBD5E0; +@glass-card-bg: #354259; +@glass-section-bg: #3D4A5C; + +// 深色抽屉样式 +.event-detail-drawer-dark { + // 整个抽屉容器 + &.ant-drawer { + // 内容包装器 - 移除白边 + .ant-drawer-content-wrapper { + box-shadow: 0 -8px 32px rgba(0, 0, 0, 0.4) !important; + border: none !important; + } + + // 内容容器 + .ant-drawer-content { + background: @glass-bg !important; + border: none !important; + border-radius: 16px 16px 0 0 !important; + } + + // 头部容器 + .ant-drawer-header { + background: @glass-header-bg !important; + border-bottom: 1px solid @glass-border !important; + padding: 16px 24px !important; + border-radius: 16px 16px 0 0 !important; + } + + // 标题样式 + .ant-drawer-title { + color: @glass-text !important; + font-size: 16px !important; + font-weight: 600 !important; + line-height: 1.4 !important; + } + + // 关闭按钮区域 + .ant-drawer-extra { + .anticon-close { + color: @glass-text !important; + font-size: 18px; + transition: all 0.2s ease; + + &:hover { + color: #fff; + transform: scale(1.1); + } + } + } + + // 内容区域 + .ant-drawer-body { + background: @glass-bg !important; + padding: 0 !important; + } + } +} + +// 原有基础样式保留(非深色模式) +.event-detail-drawer:not(.event-detail-drawer-dark) { .ant-drawer-title { color: #1A202C; } diff --git a/src/views/Community/components/EventDetailModal/EventDetailModal.tsx b/src/views/Community/components/EventDetailModal/EventDetailModal.tsx index fe1e6b71..dd1a60ec 100644 --- a/src/views/Community/components/EventDetailModal/EventDetailModal.tsx +++ b/src/views/Community/components/EventDetailModal/EventDetailModal.tsx @@ -15,8 +15,17 @@ interface EventDetailModalProps { event: any; // TODO: 后续可替换为具体的 Event 类型 } +// 深色主题颜色 - 比背景亮,形成层次感(使用实色确保覆盖) +const GLASS_THEME = { + bg: '#2D3748', + headerBg: '#3D4A5C', + borderColor: 'rgba(255, 255, 255, 0.12)', + textColor: '#F7FAFC', + secondaryText: '#CBD5E0', +}; + /** - * 事件详情抽屉组件(从底部弹出) + * 事件详情抽屉组件(从底部弹出)- 深色毛玻璃风格 */ const EventDetailModal: React.FC = ({ open, @@ -34,23 +43,36 @@ const EventDetailModal: React.FC = ({ width={isMobile ? '100%' : '70vw'} title={event?.title || '事件详情'} destroyOnHidden - rootClassName="event-detail-drawer" + rootClassName="event-detail-drawer event-detail-drawer-dark" closeIcon={null} extra={ } styles={{ wrapper: isMobile ? {} : { maxWidth: 1400, margin: '0 auto', + }, + mask: { + background: 'rgba(0, 0, 0, 0.5)', + }, + content: { + borderRadius: '16px 16px 0 0', + background: GLASS_THEME.bg, + border: 'none', + }, + header: { + background: GLASS_THEME.headerBg, + borderBottom: `1px solid ${GLASS_THEME.borderColor}`, borderRadius: '16px 16px 0 0', }, - content: { borderRadius: '16px 16px 0 0' }, - header: { background: '#FFFFFF', borderBottom: '1px solid #E2E8F0', padding: '16px 24px' }, - body: { padding: 0, background: '#FFFFFF' }, + body: { + padding: 0, + background: GLASS_THEME.bg, + }, }} > {event && }