From d825e4fe597753031946ecc1bc2fd6e14dee6fb8 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 11:19:20 +0800 Subject: [PATCH 01/13] =?UTF-8?q?fix:=20=E5=85=B3=E6=B3=A8=E6=8C=89?= =?UTF-8?q?=E9=92=AEUI=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Community/components/EventCard/EventFollowButton.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/views/Community/components/EventCard/EventFollowButton.js b/src/views/Community/components/EventCard/EventFollowButton.js index 58447836..8dc57383 100644 --- a/src/views/Community/components/EventCard/EventFollowButton.js +++ b/src/views/Community/components/EventCard/EventFollowButton.js @@ -32,10 +32,10 @@ const EventFollowButton = ({ size={size} colorScheme="yellow" variant="ghost" - bg="whiteAlpha.500" + bg="rgba(113, 128, 150, 0.6)" boxShadow="sm" _hover={{ - bg: 'whiteAlpha.800', + bg: 'rgba(113, 128, 150, 0.8)', boxShadow: 'md' }} icon={ @@ -47,8 +47,7 @@ const EventFollowButton = ({ ) : ( ) } From afc92ee583045ec93e963c65862a29a701658e10 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 13:37:01 +0800 Subject: [PATCH 02/13] =?UTF-8?q?fix:=20h5=20=E5=8E=BB=E6=8E=89=E9=80=9A?= =?UTF-8?q?=E7=9F=A5=E5=BC=B9=E7=AA=97=E5=BC=95=E5=AF=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/contexts/NotificationContext.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/contexts/NotificationContext.js b/src/contexts/NotificationContext.js index 799fcf9d..73acc176 100644 --- a/src/contexts/NotificationContext.js +++ b/src/contexts/NotificationContext.js @@ -571,8 +571,8 @@ export const NotificationProvider = ({ children }) => { logger.info('NotificationContext', 'Auto-requesting browser permission on notification'); await requestBrowserPermission(); } - // 如果权限是denied(已拒绝),提供设置指引 - else if (browserPermission === 'denied') { + // 如果权限是denied(已拒绝),提供设置指引(仅 PC 端显示) + else if (browserPermission === 'denied' && !isMobile) { const toastId = 'browser-permission-denied-guide'; if (!toast.isActive(toastId)) { toast({ From 753727c1c089ae1e715902afd5433ad39a3bfd88 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 14:40:38 +0800 Subject: [PATCH 03/13] =?UTF-8?q?fix:=20=E4=BA=8B=E4=BB=B6=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=BC=B9=E7=AA=97UI=E8=B0=83=E6=95=B4=20=E9=87=8D?= =?UTF-8?q?=E8=A6=81=E6=80=A7h5=E4=B8=8D=E5=B1=95=E7=A4=BA=20=E4=BA=8B?= =?UTF-8?q?=E4=BB=B6=E5=88=97=E8=A1=A8=E5=8D=A1=E7=89=87=E9=97=B4=E8=B7=9D?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Community/components/DynamicNewsCard.js | 4 +++- .../Community/components/DynamicNewsDetail/CompactMetaBar.js | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/Community/components/DynamicNewsCard.js b/src/views/Community/components/DynamicNewsCard.js index 1ba97dbe..229973b1 100644 --- a/src/views/Community/components/DynamicNewsCard.js +++ b/src/views/Community/components/DynamicNewsCard.js @@ -610,7 +610,9 @@ const [currentMode, setCurrentMode] = useState('vertical'); - {/* 重要性徽章 - 与 EventHeaderInfo 样式一致,尺寸略小 */} + {/* 重要性徽章 - 与 EventHeaderInfo 样式一致,尺寸略小 - H5 隐藏 */} From a1aa6718e6b77be67a9f460764f06e2f1e2b78a9 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 15:08:14 +0800 Subject: [PATCH 04/13] =?UTF-8?q?fix:=20=E4=BA=8B=E4=BB=B6=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=BC=B9=E7=AA=97UI=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Community/components/DynamicNewsCard.js | 2 +- .../DynamicNewsCard/VerticalModeLayout.js | 27 +++-------- .../components/EventDetailModal.less | 36 ++++++++++++++ .../Community/components/EventDetailModal.tsx | 48 +++++++++++++++++++ src/views/Community/components/HotEvents.js | 33 ++++--------- 5 files changed, 99 insertions(+), 47 deletions(-) create mode 100644 src/views/Community/components/EventDetailModal.less create mode 100644 src/views/Community/components/EventDetailModal.tsx diff --git a/src/views/Community/components/DynamicNewsCard.js b/src/views/Community/components/DynamicNewsCard.js index 229973b1..67897c08 100644 --- a/src/views/Community/components/DynamicNewsCard.js +++ b/src/views/Community/components/DynamicNewsCard.js @@ -543,7 +543,7 @@ const [currentMode, setCurrentMode] = useState('vertical'); {/* 左侧:标题 + 模式切换按钮 */} - + 实时要闻·动态追踪 diff --git a/src/views/Community/components/DynamicNewsCard/VerticalModeLayout.js b/src/views/Community/components/DynamicNewsCard/VerticalModeLayout.js index 3101718d..abe9723e 100644 --- a/src/views/Community/components/DynamicNewsCard/VerticalModeLayout.js +++ b/src/views/Community/components/DynamicNewsCard/VerticalModeLayout.js @@ -9,18 +9,12 @@ import { Center, Text, useBreakpointValue, - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalCloseButton, useDisclosure } from '@chakra-ui/react'; import { InfoIcon } from '@chakra-ui/icons'; import HorizontalDynamicNewsEventCard from '../EventCard/HorizontalDynamicNewsEventCard'; import EventDetailScrollPanel from './EventDetailScrollPanel'; -import DynamicNewsDetailPanel from '../DynamicNewsDetail/DynamicNewsDetailPanel'; +import EventDetailModal from '../EventDetailModal'; /** * 纵向分栏模式布局 @@ -165,20 +159,11 @@ const VerticalModeLayout = React.memo(({ {/* 移动端详情弹窗 */} {isMobile && ( - - - - - {mobileSelectedEvent?.title || '事件详情'} - - - - {mobileSelectedEvent && ( - - )} - - - + )} ); diff --git a/src/views/Community/components/EventDetailModal.less b/src/views/Community/components/EventDetailModal.less new file mode 100644 index 00000000..c448bed8 --- /dev/null +++ b/src/views/Community/components/EventDetailModal.less @@ -0,0 +1,36 @@ +.event-detail-modal { + top: 20% !important; + margin: 0 auto !important; + padding-bottom: 0 !important; + + .ant-modal-content { + border-radius: 24px !important; + background: transparent; + } + + // 标题样式 - 深色文字(白色背景) + .ant-modal-title { + color: #1A202C; + } + + // 关闭按钮样式 - 深色(白色背景) + .ant-modal-close { + color: #4A5568; + + &:hover { + color: #1A202C; + } + } +} + +// 自底向上滑入动画 +@keyframes slideUp { + from { + transform: translateY(100%); + opacity: 0; + } + to { + transform: translateY(0); + opacity: 1; + } +} diff --git a/src/views/Community/components/EventDetailModal.tsx b/src/views/Community/components/EventDetailModal.tsx new file mode 100644 index 00000000..2122a937 --- /dev/null +++ b/src/views/Community/components/EventDetailModal.tsx @@ -0,0 +1,48 @@ +import React from 'react'; +import { useSelector } from 'react-redux'; +import { Modal } from 'antd'; +import { selectIsMobile } from '@store/slices/deviceSlice'; +import DynamicNewsDetailPanel from './DynamicNewsDetail/DynamicNewsDetailPanel'; +import './EventDetailModal.less'; + +interface EventDetailModalProps { + /** 是否打开弹窗 */ + open: boolean; + /** 关闭弹窗回调 */ + onClose: () => void; + /** 事件对象 */ + event: any; // TODO: 后续可替换为具体的 Event 类型 +} + +/** + * 事件详情弹窗组件 + */ +const EventDetailModal: React.FC = ({ + open, + onClose, + event, +}) => { + const isMobile = useSelector(selectIsMobile); + + return ( + + {event && } + + ); +}; + +export default EventDetailModal; diff --git a/src/views/Community/components/HotEvents.js b/src/views/Community/components/HotEvents.js index 8d7411d8..cd403793 100644 --- a/src/views/Community/components/HotEvents.js +++ b/src/views/Community/components/HotEvents.js @@ -2,19 +2,11 @@ import React, { useState } from 'react'; import { Card, Badge, Tag, Empty, Carousel, Tooltip } from 'antd'; import { ArrowUpOutlined, ArrowDownOutlined, LeftOutlined, RightOutlined } from '@ant-design/icons'; -import { - Modal, - ModalOverlay, - ModalContent, - ModalHeader, - ModalBody, - ModalCloseButton, - useDisclosure -} from '@chakra-ui/react'; +import { useDisclosure } from '@chakra-ui/react'; +import EventDetailModal from './EventDetailModal'; import dayjs from 'dayjs'; import './HotEvents.css'; import defaultEventImage from '../../../assets/img/default-event.jpg'; -import DynamicNewsDetailPanel from './DynamicNewsDetail'; // 自定义箭头组件 const CustomArrow = ({ className, style, onClick, direction }) => { @@ -196,21 +188,12 @@ const HotEvents = ({ events, onPageChange, onEventClick }) => { )} - {/* 事件详情弹窗 - 使用 Chakra UI Modal(与平铺模式一致) */} - {isModalOpen ? ( - - - - - {modalEvent?.title || '事件详情'} - - - - {modalEvent && } - - - - ): null} + {/* 事件详情弹窗 */} + ); }; From 101d042b0e07539d97ffc15bc3b4395bd6585102 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 15:31:07 +0800 Subject: [PATCH 05/13] =?UTF-8?q?fix:=E8=B0=83=E6=95=B4=E5=AE=A2=E6=9C=8DU?= =?UTF-8?q?I?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/BytedeskWidget.jsx | 53 +++++++++++++++++++ src/styles/bytedesk-override.css | 34 ++++++++++++ 2 files changed, 87 insertions(+) diff --git a/src/bytedesk-integration/components/BytedeskWidget.jsx b/src/bytedesk-integration/components/BytedeskWidget.jsx index 07b7dbc2..58127331 100644 --- a/src/bytedesk-integration/components/BytedeskWidget.jsx +++ b/src/bytedesk-integration/components/BytedeskWidget.jsx @@ -63,6 +63,59 @@ const BytedeskWidget = ({ bytedesk.init(); widgetRef.current = bytedesk; + // ⚡ H5 端样式适配:使用 MutationObserver 立即应用样式(避免闪烁) + const isMobile = window.innerWidth <= 768; + + const applyBytedeskStyles = () => { + const allElements = document.querySelectorAll('body > div'); + allElements.forEach(el => { + const style = window.getComputedStyle(el); + // 检查是否是右下角固定定位的元素(Bytedesk 按钮) + if (style.position === 'fixed' && style.right && style.bottom) { + const rightVal = parseInt(style.right); + const bottomVal = parseInt(style.bottom); + if (rightVal >= 0 && rightVal < 100 && bottomVal >= 0 && bottomVal < 100) { + // H5 端设置按钮尺寸为 48x48(只执行一次) + if (isMobile && !el.dataset.bytedeskStyled) { + el.dataset.bytedeskStyled = 'true'; + const button = el.querySelector('button'); + if (button) { + button.style.width = '48px'; + button.style.height = '48px'; + button.style.minWidth = '48px'; + button.style.minHeight = '48px'; + } + } + // 提示框 3 秒后隐藏(查找白色气泡框) + const children = el.querySelectorAll('div'); + children.forEach(child => { + if (child.dataset.bytedeskTooltip) return; // 已处理过 + const childStyle = window.getComputedStyle(child); + // 白色背景的提示框 + if (childStyle.backgroundColor === 'rgb(255, 255, 255)') { + child.dataset.bytedeskTooltip = 'true'; + setTimeout(() => { + child.style.transition = 'opacity 0.3s'; + child.style.opacity = '0'; + setTimeout(() => child.remove(), 300); + }, 3000); + } + }); + } + } + }); + }; + + // 立即执行一次 + applyBytedeskStyles(); + + // 监听 DOM 变化,新元素出现时立即应用样式 + const observer = new MutationObserver(applyBytedeskStyles); + observer.observe(document.body, { childList: true, subtree: true }); + + // 5 秒后停止监听(避免性能问题) + setTimeout(() => observer.disconnect(), 5000); + // ⚡ 屏蔽 STOMP WebSocket 错误日志(不影响功能) const originalConsoleError = console.error; console.error = function(...args) { diff --git a/src/styles/bytedesk-override.css b/src/styles/bytedesk-override.css index 8cd81c2c..2e705635 100644 --- a/src/styles/bytedesk-override.css +++ b/src/styles/bytedesk-override.css @@ -36,3 +36,37 @@ iframe[src*="/visitor/"] { [class*="bytedesk-badge"] { z-index: 1000000 !important; } + +/* ========== H5 端客服组件整体缩小 ========== */ +@media (max-width: 768px) { + /* 整个客服容器缩小(包括按钮和提示框) */ + [class*="bytedesk"], + [id*="bytedesk"], + [class*="BytedeskWeb"] { + transform: scale(0.7) !important; + transform-origin: bottom right !important; + } +} + +/* ========== 提示框 3 秒后自动消失 ========== */ +/* 提示框("在线客服 点击咨询"气泡)- 扩展选择器 */ +[class*="bytedesk-bubble"], +[class*="bytedesk-tooltip"], +[class*="BytedeskWeb"] [class*="bubble"], +[class*="BytedeskWeb"] [class*="tooltip"], +[class*="bytedesk"] > div:not(button):not(iframe), +[class*="BytedeskWeb"] > div:not(button):not(iframe), +[id*="bytedesk"] > div:not(button):not(iframe) { + animation: bytedeskFadeOut 0.3s ease-out 3s forwards !important; +} + +@keyframes bytedeskFadeOut { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + visibility: hidden; + } +} From 93f43054fdc8406eaca9e37e5e158db7c97915fa Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 15:35:48 +0800 Subject: [PATCH 06/13] =?UTF-8?q?fix=EF=BC=9A=E4=BA=8B=E4=BB=B6=E8=AF=A6?= =?UTF-8?q?=E6=83=85=E5=BC=B9=E7=AA=97UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/Community/components/EventDetailModal.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Community/components/EventDetailModal.tsx b/src/views/Community/components/EventDetailModal.tsx index 2122a937..7b61af97 100644 --- a/src/views/Community/components/EventDetailModal.tsx +++ b/src/views/Community/components/EventDetailModal.tsx @@ -36,7 +36,7 @@ const EventDetailModal: React.FC = ({ styles={{ mask: { background: 'transparent' }, content: { borderRadius: 24, padding: 0, maxWidth: 1400, background: 'transparent', margin: '0 auto' }, - header: { background: '#FFFFFF', borderBottom: '1px solid #E2E8F0', padding: '16px 24px', borderRadius: '24px 24px 0 0' }, + header: { background: '#FFFFFF', borderBottom: '1px solid #E2E8F0', padding: '16px 24px', borderRadius: '24px 24px 0 0', margin: 0 }, body: { padding: 0 }, }} > From 5b0e420770d4de421dd52bd0f5114b283a722aff Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 16:20:15 +0800 Subject: [PATCH 07/13] =?UTF-8?q?fix:=20=E5=88=86=E6=97=B6=E5=9B=BEUI?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicNewsDetail/StockListItem.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/views/Community/components/DynamicNewsDetail/StockListItem.js b/src/views/Community/components/DynamicNewsDetail/StockListItem.js index c6de6078..003a3837 100644 --- a/src/views/Community/components/DynamicNewsDetail/StockListItem.js +++ b/src/views/Community/components/DynamicNewsDetail/StockListItem.js @@ -130,7 +130,7 @@ const StockListItem = ({ {/* 单行紧凑布局:名称+涨跌幅 | 分时图 | K线图 | 关联描述 */} {/* 左侧:股票信息区 */} - + {/* 股票代码 + 名称 + 涨跌幅 */} - {/* 分时图 - 更紧凑 */} + {/* 分时图 - 自适应 */} { e.stopPropagation(); setIsTimelineModalOpen(true); }} cursor="pointer" - flexShrink={0} align="stretch" spacing={0} - h="fit-content" _hover={{ borderColor: '#3B82F6', boxShadow: '0 0 10px rgba(59, 130, 246, 0.3)', @@ -228,7 +228,7 @@ const StockListItem = ({ > 📈 分时 - + - {/* K线图 - 更紧凑 */} + {/* K线图 - 自适应 */} { e.stopPropagation(); setIsKLineModalOpen(true); }} cursor="pointer" - flexShrink={0} align="stretch" spacing={0} - h="fit-content" _hover={{ borderColor: '#A855F7', boxShadow: '0 0 10px rgba(168, 85, 247, 0.3)', @@ -270,7 +270,7 @@ const StockListItem = ({ > 📊 日线 - + Date: Thu, 27 Nov 2025 16:40:35 +0800 Subject: [PATCH 08/13] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4AI=E5=90=88?= =?UTF-8?q?=E6=88=90UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicNewsDetail/StockListItem.js | 53 +++++++++++-------- 1 file changed, 31 insertions(+), 22 deletions(-) diff --git a/src/views/Community/components/DynamicNewsDetail/StockListItem.js b/src/views/Community/components/DynamicNewsDetail/StockListItem.js index 003a3837..9144e55e 100644 --- a/src/views/Community/components/DynamicNewsDetail/StockListItem.js +++ b/src/views/Community/components/DynamicNewsDetail/StockListItem.js @@ -16,13 +16,14 @@ import { useColorModeValue, } from '@chakra-ui/react'; import { StarIcon } from '@chakra-ui/icons'; +import { Tag } from 'antd'; +import { RobotOutlined } from '@ant-design/icons'; import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart'; import MiniKLineChart from './MiniKLineChart'; -import TimelineChartModal from '../../../../components/StockChart/TimelineChartModal'; -import KLineChartModal from '../../../../components/StockChart/KLineChartModal'; -import CitedContent from '../../../../components/Citation/CitedContent'; -import { getChangeColor } from '../../../../utils/colorUtils'; -import { PROFESSIONAL_COLORS } from '../../../../constants/professionalTheme'; +import TimelineChartModal from '@components/StockChart/TimelineChartModal'; +import KLineChartModal from '@components/StockChart/KLineChartModal'; +import { getChangeColor } from '@utils/colorUtils'; +import { PROFESSIONAL_COLORS } from '@constants/professionalTheme'; /** * 股票卡片组件 @@ -130,7 +131,7 @@ const StockListItem = ({ {/* 单行紧凑布局:名称+涨跌幅 | 分时图 | K线图 | 关联描述 */} {/* 左侧:股票信息区 */} - + {/* 股票代码 + 名称 + 涨跌幅 */} - - + {/* AI 标识 - 行内显示在文字前面 */} + } + color="purple" + style={{ + fontSize: 12, + padding: '2px 8px', + marginRight: 8, + verticalAlign: 'middle', + display: 'inline-flex', }} - /> + > + AI合成 + + {/* 直接渲染文字内容 */} + + {stock.relation_desc?.data?.map(item => item.sentences || item.query_part).filter(Boolean).join(',')} + @@ -339,8 +350,6 @@ const StockListItem = ({ setIsDescExpanded(!isDescExpanded); }} cursor="pointer" - px={3} - py={2} bg={PROFESSIONAL_COLORS.background.secondary} borderRadius="md" _hover={{ @@ -350,7 +359,7 @@ const StockListItem = ({ position="relative" > {/* 去掉"关联描述"标题 */} - + Date: Thu, 27 Nov 2025 16:55:25 +0800 Subject: [PATCH 09/13] =?UTF-8?q?fix:=20AI=E5=90=88=E6=88=90h5=E6=8D=A2?= =?UTF-8?q?=E8=A1=8C=EF=BC=8Cpc=E4=B8=80=E8=A1=8C=EF=BC=8C=E8=AF=84?= =?UTF-8?q?=E8=AE=BA=E6=A0=87=E9=A2=98=E4=B8=8A=E6=96=B9margin=E5=8E=BB?= =?UTF-8?q?=E6=8E=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/DynamicNewsDetail/DynamicNewsDetailPanel.js | 2 +- .../components/DynamicNewsDetail/StockListItem.js | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/views/Community/components/DynamicNewsDetail/DynamicNewsDetailPanel.js b/src/views/Community/components/DynamicNewsDetail/DynamicNewsDetailPanel.js index 3a945d8b..16399acd 100644 --- a/src/views/Community/components/DynamicNewsDetail/DynamicNewsDetailPanel.js +++ b/src/views/Community/components/DynamicNewsDetail/DynamicNewsDetailPanel.js @@ -418,7 +418,7 @@ const DynamicNewsDetailPanel = ({ event, showHeader = true }) => { {/* 讨论区(评论区) - 所有登录用户可用 */} - + diff --git a/src/views/Community/components/DynamicNewsDetail/StockListItem.js b/src/views/Community/components/DynamicNewsDetail/StockListItem.js index 9144e55e..fa789387 100644 --- a/src/views/Community/components/DynamicNewsDetail/StockListItem.js +++ b/src/views/Community/components/DynamicNewsDetail/StockListItem.js @@ -2,6 +2,7 @@ // 股票卡片组件(融合表格功能的卡片样式) import React, { useState } from 'react'; +import { useSelector } from 'react-redux'; import { Box, Flex, @@ -18,6 +19,7 @@ import { import { StarIcon } from '@chakra-ui/icons'; import { Tag } from 'antd'; import { RobotOutlined } from '@ant-design/icons'; +import { selectIsMobile } from '@store/slices/deviceSlice'; import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart'; import MiniKLineChart from './MiniKLineChart'; import TimelineChartModal from '@components/StockChart/TimelineChartModal'; @@ -45,6 +47,7 @@ const StockListItem = ({ isInWatchlist = false, onWatchlistToggle }) => { + const isMobile = useSelector(selectIsMobile); const cardBg = PROFESSIONAL_COLORS.background.card; const borderColor = PROFESSIONAL_COLORS.border.default; const codeColor = '#3B82F6'; @@ -129,7 +132,7 @@ const StockListItem = ({ transition="all 0.2s" > {/* 单行紧凑布局:名称+涨跌幅 | 分时图 | K线图 | 关联描述 */} - + {/* 左侧:股票信息区 */} {/* 股票代码 + 名称 + 涨跌幅 */} @@ -282,7 +285,7 @@ const StockListItem = ({ {/* 关联描述 - 升级和降级处理 */} {stock.relation_desc && ( - + {stock.relation_desc?.data ? ( // 升级:带引用来源的版本 - 添加折叠功能 Date: Thu, 27 Nov 2025 17:03:35 +0800 Subject: [PATCH 10/13] =?UTF-8?q?fix:=20=E6=96=87=E6=A1=88=E8=B0=83?= =?UTF-8?q?=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicNewsDetail/RelatedConceptsSection/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/views/Community/components/DynamicNewsDetail/RelatedConceptsSection/index.js b/src/views/Community/components/DynamicNewsDetail/RelatedConceptsSection/index.js index 81cd1640..f0581be4 100644 --- a/src/views/Community/components/DynamicNewsDetail/RelatedConceptsSection/index.js +++ b/src/views/Community/components/DynamicNewsDetail/RelatedConceptsSection/index.js @@ -243,7 +243,7 @@ const RelatedConceptsSection = ({ } }} > - {isExpanded ? '收起' : '查看详细描述'} + {isExpanded ? '收起' : '查看详细'} {/* 第二行:交易日期信息 */} From 589e1c20f97ad62a28e6035f057003b43289693d Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 17:22:49 +0800 Subject: [PATCH 11/13] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E6=A6=82=E5=BF=B5=E5=8D=A1=E7=89=87UI?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicNewsDetail/CompactStockItem.js | 23 +++++++++++-------- .../SimpleConceptCard.js | 18 +++++++-------- 2 files changed, 22 insertions(+), 19 deletions(-) diff --git a/src/views/Community/components/DynamicNewsDetail/CompactStockItem.js b/src/views/Community/components/DynamicNewsDetail/CompactStockItem.js index 2eb1ea34..b7c35204 100644 --- a/src/views/Community/components/DynamicNewsDetail/CompactStockItem.js +++ b/src/views/Community/components/DynamicNewsDetail/CompactStockItem.js @@ -2,13 +2,15 @@ // 精简模式股票卡片组件(浮动卡片样式) import React from 'react'; +import { useSelector } from 'react-redux'; import { Box, Text, Tooltip, useColorModeValue, } from '@chakra-ui/react'; -import { getChangeColor, getChangeBackgroundGradient, getChangeBorderColor } from '../../../../utils/colorUtils'; +import { selectIsMobile } from '@store/slices/deviceSlice'; +import { getChangeColor, getChangeBackgroundGradient, getChangeBorderColor } from '@utils/colorUtils'; /** * 精简模式股票卡片组件 @@ -17,6 +19,7 @@ import { getChangeColor, getChangeBackgroundGradient, getChangeBorderColor } fro * @param {Object} props.quote - 股票行情数据(可选) */ const CompactStockItem = ({ stock, quote = null }) => { + const isMobile = useSelector(selectIsMobile); const nameColor = useColorModeValue('gray.700', 'gray.300'); const handleViewDetail = () => { @@ -45,10 +48,10 @@ const CompactStockItem = ({ stock, quote = null }) => { > { }} transition="all 0.3s ease-in-out" display="inline-block" - minW="150px" + minW="100px" > {/* 股票代码 */} {stock.stock_code} @@ -84,7 +87,7 @@ const CompactStockItem = ({ stock, quote = null }) => { {/* 涨跌幅 - 超大号显示 */} { {/* 股票名称(小字) */} { return ( { {/* 第二行:相关度 + 涨跌幅 */} - + {/* 相关度标签 */} - + 相关度: {relevanceScore}% @@ -87,8 +87,8 @@ const SimpleConceptCard = ({ concept, onClick, getRelevanceColor }) => { {changePct !== null && ( From 34338373cd30bd2c53e8f31f864d97da50e91204 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 27 Nov 2025 18:27:44 +0800 Subject: [PATCH 12/13] =?UTF-8?q?fix:=20UI=E8=B0=83=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/Citation/CitedContent.js | 44 +++++------- .../components/HistoricalEvents.js | 36 +++++----- .../components/TransmissionChainAnalysis.js | 71 ++++++++++++++----- 3 files changed, 92 insertions(+), 59 deletions(-) diff --git a/src/components/Citation/CitedContent.js b/src/components/Citation/CitedContent.js index 0f1426ef..2e36591a 100644 --- a/src/components/Citation/CitedContent.js +++ b/src/components/Citation/CitedContent.js @@ -82,29 +82,9 @@ const CitedContent = ({ ...containerStyle }} > - {/* AI 标识 - 固定在右上角 */} - {showAIBadge && ( - } - color="purple" - style={{ - position: 'absolute', - top: 12, - right: 12, - margin: 0, - zIndex: 10, - fontSize: 12, - padding: '2px 8px' - }} - className="ai-badge-responsive" - > - AI合成 - - )} - {/* 标题栏 */} {title && ( -
+
{title} @@ -112,10 +92,24 @@ const CitedContent = ({ )} {/* 带引用的文本内容 */} -
+
+ {/* AI 标识 - 行内显示在文字前面 */} + {showAIBadge && ( + } + color="purple" + style={{ + fontSize: 12, + padding: '2px 8px', + marginRight: 8, + verticalAlign: 'middle', + display: 'inline-flex', + }} + className="ai-badge-responsive" + > + AI合成 + + )} {/* 前缀标签(如果有) */} {prefix && ( - + {/* 顶部区域:左侧(标题+时间) + 右侧(按钮) */} {/* 左侧:标题 + 时间信息(允许折行) */} - + {/* 标题 */} { @@ -290,27 +292,28 @@ const HistoricalEvents = ({ {/* 时间 + Badges(允许折行) */} - + {formatDate(getEventDate(event))} - + ({getRelativeTime(getEventDate(event))}) {event.importance && ( - + 重要性: {event.importance} )} {event.avg_change_pct !== undefined && event.avg_change_pct !== null && ( 0 ? 'red' : event.avg_change_pct < 0 ? 'green' : 'gray'} - size="sm" + fontSize="xs" + px={2} > 涨幅: {event.avg_change_pct > 0 ? '+' : ''}{event.avg_change_pct.toFixed(2)}% )} {event.similarity !== undefined && event.similarity !== null && ( - + 相关度: {event.similarity} )} @@ -344,10 +347,9 @@ const HistoricalEvents = ({ data={content} title="" showAIBadge={true} - textColor={PROFESSIONAL_COLORS.text.primary} + textColor="#E2E8F0" containerStyle={{ - backgroundColor: useColorModeValue('#f7fafc', 'rgba(45, 55, 72, 0.6)'), - borderRadius: '8px', + backgroundColor: 'transparent', padding: '0', }} /> diff --git a/src/views/EventDetail/components/TransmissionChainAnalysis.js b/src/views/EventDetail/components/TransmissionChainAnalysis.js index ab6896a8..87c4b4a9 100644 --- a/src/views/EventDetail/components/TransmissionChainAnalysis.js +++ b/src/views/EventDetail/components/TransmissionChainAnalysis.js @@ -826,8 +826,8 @@ const TransmissionChainAnalysis = ({ eventId }) => { - - + + {selectedNode ? '节点详情' : '传导链分析'} {selectedNode && ( { )} - + {selectedNode ? ( @@ -1084,11 +1087,15 @@ const TransmissionChainAnalysis = ({ eventId }) => { prefix="机制:" prefixStyle={{ fontSize: 12, color: PROFESSIONAL_COLORS.text.secondary, fontWeight: 'bold' }} textColor={PROFESSIONAL_COLORS.text.primary} - containerStyle={{ marginTop: 8 }} + containerStyle={{ + marginTop: 8, + backgroundColor: 'transparent', + padding: 0, + }} showAIBadge={false} /> ) : parent.transmission_mechanism ? ( - + 机制: {parent.transmission_mechanism}(AI合成) ) : null} @@ -1105,23 +1112,42 @@ const TransmissionChainAnalysis = ({ eventId }) => { {/* 影响输出 */} {(() => { const targetsFromAPI = nodeDetail && nodeDetail.children && nodeDetail.children.length > 0; - + if (targetsFromAPI) { return ( - - 影响输出 ({nodeDetail.children.length}) + + 影响输出 ({nodeDetail.children.length})(AI合成) {nodeDetail.children.map((child, index) => ( - + {child.direction && ( @@ -1132,7 +1158,7 @@ const TransmissionChainAnalysis = ({ eventId }) => { )} - {child.name} + {child.name} {child.transmission_mechanism?.data ? ( { prefix="机制:" prefixStyle={{ fontSize: 12, color: PROFESSIONAL_COLORS.text.secondary, fontWeight: 'bold' }} textColor={PROFESSIONAL_COLORS.text.primary} - containerStyle={{ marginTop: 8 }} + containerStyle={{ + marginTop: 8, + backgroundColor: 'transparent', + padding: 0, + }} showAIBadge={false} /> ) : child.transmission_mechanism ? ( - + 机制: {child.transmission_mechanism}(AI合成) ) : null} @@ -1169,7 +1199,14 @@ const TransmissionChainAnalysis = ({ eventId }) => { - + From cf4fdf6a683b417d526e1b3c188ee7f512d5c98b Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Fri, 28 Nov 2025 07:14:52 +0800 Subject: [PATCH 13/13] =?UTF-8?q?feat:=20=E4=BC=A0=E5=AF=BC=E7=BB=83UI?= =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/TransmissionChainAnalysis.js | 245 ++++++++++-------- 1 file changed, 135 insertions(+), 110 deletions(-) diff --git a/src/views/EventDetail/components/TransmissionChainAnalysis.js b/src/views/EventDetail/components/TransmissionChainAnalysis.js index 87c4b4a9..cfe86023 100644 --- a/src/views/EventDetail/components/TransmissionChainAnalysis.js +++ b/src/views/EventDetail/components/TransmissionChainAnalysis.js @@ -1,18 +1,18 @@ import React, { useEffect, useState, useRef } from 'react'; -import { - Box, - Button, - Flex, - Spinner, - Alert, - AlertIcon, - Text, - Stat, - StatLabel, - StatNumber, - HStack, - VStack, - Tag, +import { + Box, + Button, + Flex, + Spinner, + Alert, + AlertIcon, + Text, + Stat, + StatLabel, + StatNumber, + HStack, + VStack, + Tag, Badge, List, ListItem, @@ -28,9 +28,11 @@ import { ModalCloseButton, Icon, useColorModeValue, - Tooltip + Tooltip, + Center } from '@chakra-ui/react'; import { InfoIcon, ViewIcon } from '@chakra-ui/icons'; +import { Share2, GitBranch, Inbox } from 'lucide-react'; import ReactECharts from 'echarts-for-react'; import { eventService } from '../../../services/eventService'; import CitedContent from '../../../components/Citation/CitedContent'; @@ -637,7 +639,7 @@ const TransmissionChainAnalysis = ({ eventId }) => { }; return ( - + {/* 统计信息条 */} { borderColor={PROFESSIONAL_COLORS.border.default} bg={PROFESSIONAL_COLORS.background.secondary} > - - - 总节点数 - {stats.totalNodes} + + + 总节点数 + {stats.totalNodes} - - 涉及行业 - {stats.involvedIndustries} + + 涉及行业 + {stats.involvedIndustries} - - 相关公司 - {stats.relatedCompanies} + + 相关公司 + {stats.relatedCompanies} - - 正向影响 - {stats.positiveImpact} + + 正向影响 + {stats.positiveImpact} - - 负向影响 - {stats.negativeImpact} + + 负向影响 + {stats.negativeImpact} - - 循环效应 - {stats.circularEffect} + + 循环效应 + {stats.circularEffect} - + {/* 自定义图例 */} - - - {Object.entries(NODE_STYLES).map(([type, style]) => ( - - - {NODE_TYPE_LABELS[type] || type} - - ))} - - + + {Object.entries(NODE_STYLES).map(([type, style]) => ( + + + {NODE_TYPE_LABELS[type] || type} + + ))} + {/* 视图切换按钮 */} - {loading && ( @@ -748,79 +751,101 @@ const TransmissionChainAnalysis = ({ eventId }) => { {!loading && !error && ( - {/* 提示信息 */} - - - - - 点击图表中的节点可以查看详细信息 - - - - {/* 图表容器 */} + {/* 图表容器 - 宽高比 2:1,H5 自适应 */} + + {/* 提示信息 - 固定在左上角 */} + + + 点击节点查看详情 + {chartReady && ( <> - {viewMode === 'graph' ? ( - { - // 减少不必要的重新渲染 - return JSON.stringify(prevProps.option) !== JSON.stringify(props.option); - }} - /> + {/* 空状态提示 */} + {(viewMode === 'graph' && (!graphData || !graphData.nodes || graphData.nodes.length === 0)) || + (viewMode === 'sankey' && (!sankeyData || !sankeyData.nodes || sankeyData.nodes.length === 0)) ? ( +
+ + + 暂无传导链数据 + +
) : ( - { - // 减少不必要的重新渲染 - return JSON.stringify(prevProps.option) !== JSON.stringify(props.option); - }} - /> + <> + {viewMode === 'graph' ? ( + { + // 减少不必要的重新渲染 + return JSON.stringify(prevProps.option) !== JSON.stringify(props.option); + }} + /> + ) : ( + { + // 减少不必要的重新渲染 + return JSON.stringify(prevProps.option) !== JSON.stringify(props.option); + }} + /> + )} + )} )} +
)} - + {/* 节点详情弹窗 */} {isModalOpen && (