From 2da71a3c037b4a6839c019c1bb9e5766e7662431 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Fri, 7 Nov 2025 19:29:19 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=9B=B8=E5=85=B3=E8=82=A1=E7=A5=A8?= =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=90=88=E8=A7=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DynamicNewsDetail/StockListItem.js | 120 +++++++++++------- 1 file changed, 71 insertions(+), 49 deletions(-) diff --git a/src/views/Community/components/DynamicNewsDetail/StockListItem.js b/src/views/Community/components/DynamicNewsDetail/StockListItem.js index 107594c9..03fb858a 100644 --- a/src/views/Community/components/DynamicNewsDetail/StockListItem.js +++ b/src/views/Community/components/DynamicNewsDetail/StockListItem.js @@ -12,12 +12,14 @@ import { IconButton, Collapse, Tooltip, + Badge, useColorModeValue, } from '@chakra-ui/react'; import { StarIcon } from '@chakra-ui/icons'; import MiniTimelineChart from '../StockDetailPanel/components/MiniTimelineChart'; import MiniKLineChart from './MiniKLineChart'; import StockChartModal from '../../../../components/StockChart/StockChartModal'; +import CitedContent from '../../../../components/Citation/CitedContent'; import { getChangeColor } from '../../../../utils/colorUtils'; /** @@ -104,7 +106,7 @@ const StockListItem = ({ borderRadius="lg" p={3} position="relative" - overflow="hidden" + overflow="visible" _before={{ content: '""', position: 'absolute', @@ -113,6 +115,8 @@ const StockListItem = ({ right: 0, height: '3px', bgGradient: 'linear(to-r, blue.400, purple.500, pink.500)', + borderTopLeftRadius: 'lg', + borderTopRightRadius: 'lg', }} _hover={{ boxShadow: 'lg', @@ -241,55 +245,73 @@ const StockListItem = ({ /> - {/* 关联描述(单行显示,点击展开)- 占据更多空间 */} - {relationText && relationText !== '--' && ( - - { - e.stopPropagation(); - setIsDescExpanded(!isDescExpanded); - }} - cursor="pointer" - px={3} - py={2} - bg={useColorModeValue('gray.50', 'gray.700')} - borderRadius="md" - _hover={{ - bg: useColorModeValue('gray.100', 'gray.600'), - }} - transition="background 0.2s" - > - {/* 去掉"关联描述"标题 */} - - + {stock.relation_desc?.data ? ( + // 升级:带引用来源的版本 + + ) : ( + // 降级:纯文本版本(保留展开/收起功能) + + { + e.stopPropagation(); + setIsDescExpanded(!isDescExpanded); + }} + cursor="pointer" + px={3} + py={2} + bg={useColorModeValue('gray.50', 'gray.700')} + borderRadius="md" + _hover={{ + bg: useColorModeValue('gray.100', 'gray.600'), + }} + transition="background 0.2s" + position="relative" > - {relationText} - - - {isDescExpanded && ( - - ⚠️ AI生成,仅供参考 - - )} - - + {/* 去掉"关联描述"标题 */} + + + {relationText} + + + + {/* 提示信息 */} + {isDescExpanded && ( + + ⚠️ AI生成,仅供参考 + + )} + + + )} + )}