From 67c7fa49e8ac4b0e958fb2492f3428ebee73cc89 Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Fri, 7 Nov 2025 09:45:42 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BA=8B=E4=BB=B6=E4=B8=AD=E5=BF=83UI=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Community/components/DynamicNewsCard.js | 8 +- .../DynamicNewsDetail/EventHeaderInfo.js | 37 +- .../DynamicNewsDetail/RelatedStocksSection.js | 6 +- .../DynamicNewsDetail/StockListItem.js | 321 +++++++++++------- src/views/Community/index.js | 2 +- 5 files changed, 234 insertions(+), 140 deletions(-) diff --git a/src/views/Community/components/DynamicNewsCard.js b/src/views/Community/components/DynamicNewsCard.js index e6149235..e4ca1150 100644 --- a/src/views/Community/components/DynamicNewsCard.js +++ b/src/views/Community/components/DynamicNewsCard.js @@ -456,7 +456,7 @@ const [currentMode, setCurrentMode] = useState('vertical'); top={isFixedMode ? `${TOTAL_NAV_HEIGHT}px` : 'auto'} left={isFixedMode ? 0 : 'auto'} right={isFixedMode ? 0 : 'auto'} - maxW={isFixedMode ? 'container.xl' : '100%'} + maxW={isFixedMode ? '1600px' : '100%'} mx={isFixedMode ? 'auto' : 0} px={isFixedMode ? { base: 3, md: 4 } : undefined} zIndex={isFixedMode ? 999 : 1} @@ -502,7 +502,7 @@ const [currentMode, setCurrentMode] = useState('vertical'); left={isFixedMode ? 0 : 'auto'} right={isFixedMode ? 0 : 'auto'} bottom={isFixedMode ? `${FOOTER_HEIGHT}px` : 'auto'} - maxW={isFixedMode ? 'container.xl' : '100%'} + maxW={isFixedMode ? '1600px' : '100%'} mx={isFixedMode ? 'auto' : 0} h={isFixedMode ? `calc(100vh - ${TOTAL_NAV_HEIGHT + headerHeight + FOOTER_HEIGHT}px)` : 'auto'} px={isFixedMode ? { base: 3, md: 4 } : undefined} @@ -579,9 +579,9 @@ const [currentMode, setCurrentMode] = useState('vertical'); {/* 四排模式详情弹窗 - 未打开时不渲染 */} {isModalOpen && ( - + - + {modalEvent?.title || '事件详情'} diff --git a/src/views/Community/components/DynamicNewsDetail/EventHeaderInfo.js b/src/views/Community/components/DynamicNewsDetail/EventHeaderInfo.js index aa2cee36..f1bc1e67 100644 --- a/src/views/Community/components/DynamicNewsDetail/EventHeaderInfo.js +++ b/src/views/Community/components/DynamicNewsDetail/EventHeaderInfo.js @@ -8,6 +8,8 @@ import { HStack, Heading, Text, + Badge, + Icon, useColorModeValue, } from '@chakra-ui/react'; import { ViewIcon } from '@chakra-ui/icons'; @@ -100,7 +102,7 @@ const EventHeaderInfo = ({ event, importance, isFollowing, followerCount, onTogg - {/* 第三行:涨跌幅指标 + 重要性文本 */} + {/* 第三行:涨跌幅指标 + 重要性徽章 */} - {/* 重要性文本 */} - - - 重要性:{getImportanceText()} - - + + 重要性:{getImportanceText()} + ); diff --git a/src/views/Community/components/DynamicNewsDetail/RelatedStocksSection.js b/src/views/Community/components/DynamicNewsDetail/RelatedStocksSection.js index e660ce49..cab8d27c 100644 --- a/src/views/Community/components/DynamicNewsDetail/RelatedStocksSection.js +++ b/src/views/Community/components/DynamicNewsDetail/RelatedStocksSection.js @@ -3,7 +3,7 @@ import React from 'react'; import { - SimpleGrid, + VStack, } from '@chakra-ui/react'; import StockListItem from './StockListItem'; @@ -29,7 +29,7 @@ const RelatedStocksSection = ({ } return ( - + {stocks.map((stock, index) => ( ))} - + ); }; diff --git a/src/views/Community/components/DynamicNewsDetail/StockListItem.js b/src/views/Community/components/DynamicNewsDetail/StockListItem.js index 1a3ea80d..73cf5551 100644 --- a/src/views/Community/components/DynamicNewsDetail/StockListItem.js +++ b/src/views/Community/components/DynamicNewsDetail/StockListItem.js @@ -10,6 +10,11 @@ import { Button, IconButton, Collapse, + Stat, + StatLabel, + StatNumber, + StatHelpText, + StatArrow, useColorModeValue, } from '@chakra-ui/react'; import { StarIcon } from '@chakra-ui/icons'; @@ -101,46 +106,56 @@ const StockListItem = ({ <> - - {/* 顶部:股票代码 + 名称 + 操作按钮(上下两行布局) */} - - {/* 第一行:股票代码 + 涨跌幅 + 操作按钮 */} - - {/* 左侧:代码 + 涨跌幅 */} - - + {/* 左侧:基础信息区(股票代码、名称、涨跌幅) */} + + {/* 股票代码和名称 */} + + + - {stock.stock_code} - - - {formatChange(change)} - - - - {/* 右侧:操作按钮 */} - + + {stock.stock_code} + + {onWatchlistToggle && ( )} - - - - {/* 第二行:公司名称 + 分时图 + K线图 */} - - {/* 左侧:公司名称 */} {stock.stock_name} + - {/* 右侧:分时图 + K线图 */} - e.stopPropagation()}> - {/* 分时图 */} - - setIsModalOpen(true)} - /> - + {/* 涨跌幅 - 使用 Stat 组件 */} + + + 涨跌幅 + + + {formatChange(change)} + + {change !== null && change !== undefined && !isNaN(change) && ( + + = 0 ? 'increase' : 'decrease'} /> + {Math.abs(change).toFixed(2)}% + + )} + + - {/* K线图 */} - - setIsModalOpen(true)} - /> - - - - - - {/* 分隔线 */} - - - {/* 关联描述 */} - {relationText && relationText !== '--' && ( - - - 关联描述: + {/* 中间:图表区(分时图 + K线图) */} + e.stopPropagation()} minW={0}> + {/* 分时图 */} + + + 📈 分时走势 + + setIsModalOpen(true)} + /> + + + {/* K线图 */} + + + 📊 K线走势 + + setIsModalOpen(true)} + /> + + + + {/* 右侧:操作按钮 */} + + + + + + {/* 关联描述(折叠区域) */} + {relationText && relationText !== '--' && ( + + + + 关联描述 - - { - if (needTruncate) { - e.stopPropagation(); - setIsDescExpanded(!isDescExpanded); - } - }} - _hover={needTruncate ? { opacity: 0.8 } : {}} - > - {relationText} - - {needTruncate && ( )} - - {/* 合规提示 */} + + - ⚠️ 以上关联描述由AI生成,仅供参考,不构成投资建议 + {relationText} - - )} - + + + {/* 合规提示 */} + + ⚠️ 以上关联描述由AI生成,仅供参考,不构成投资建议 + + + )} {/* 股票详情弹窗 - 未打开时不渲染 */} diff --git a/src/views/Community/index.js b/src/views/Community/index.js index ed95f77b..03636b66 100644 --- a/src/views/Community/index.js +++ b/src/views/Community/index.js @@ -152,7 +152,7 @@ const Community = () => { return ( {/* 主内容区域 */} - + {/* 热点事件区域 */}