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] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=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 && (