feat: 优化股票卡片显示

d670b0a feat: 历史股票增加相关度数据
     02c03ab feat: 修改列表默认状态
     8bdc2aa feat: 处理mock数据
This commit is contained in:
zdl
2025-11-07 20:04:54 +08:00
parent 4860cac3ca
commit f01eff6eb7

View File

@@ -126,7 +126,7 @@ const StockListItem = ({
> >
{/* 单行紧凑布局:名称+涨跌幅 | 分时图 | K线图 | 关联描述 */} {/* 单行紧凑布局:名称+涨跌幅 | 分时图 | K线图 | 关联描述 */}
<HStack spacing={3} align="stretch"> <HStack spacing={3} align="stretch">
{/* 左侧:股票名称 + 涨跌幅(垂直排列) - 收窄 */} {/* 左侧:股票代码 + 名称 + 涨跌幅(垂直排列) - 收窄 */}
<VStack <VStack
align="stretch" align="stretch"
spacing={1} spacing={1}
@@ -143,17 +143,29 @@ const StockListItem = ({
color="white" color="white"
fontSize="xs" fontSize="xs"
> >
<Text <VStack spacing={0} align="stretch">
fontSize="sm" <Text
fontWeight="bold" fontSize="xs"
color={codeColor} color={codeColor}
noOfLines={1} noOfLines={1}
cursor="pointer" cursor="pointer"
onClick={handleViewDetail} onClick={handleViewDetail}
_hover={{ textDecoration: 'underline' }} _hover={{ textDecoration: 'underline' }}
> >
{stock.stock_name} {stock.stock_code}
</Text> </Text>
<Text
fontSize="sm"
fontWeight="bold"
color={nameColor}
noOfLines={1}
cursor="pointer"
onClick={handleViewDetail}
_hover={{ textDecoration: 'underline' }}
>
{stock.stock_name}
</Text>
</VStack>
</Tooltip> </Tooltip>
<HStack spacing={1} align="center"> <HStack spacing={1} align="center">
<Text <Text
@@ -180,6 +192,8 @@ const StockListItem = ({
{/* 分时图 - 固定宽度 */} {/* 分时图 - 固定宽度 */}
<Box <Box
w="160px" w="160px"
maxH="50px"
h="auto"
borderWidth="1px" borderWidth="1px"
borderColor={useColorModeValue('blue.100', 'blue.700')} borderColor={useColorModeValue('blue.100', 'blue.700')}
borderRadius="md" borderRadius="md"
@@ -191,6 +205,7 @@ const StockListItem = ({
}} }}
cursor="pointer" cursor="pointer"
flexShrink={0} flexShrink={0}
alignSelf="center"
_hover={{ _hover={{
borderColor: useColorModeValue('blue.300', 'blue.500'), borderColor: useColorModeValue('blue.300', 'blue.500'),
boxShadow: 'sm' boxShadow: 'sm'
@@ -214,6 +229,8 @@ const StockListItem = ({
{/* K线图 - 固定宽度 */} {/* K线图 - 固定宽度 */}
<Box <Box
w="160px" w="160px"
maxH="50px"
h="auto"
borderWidth="1px" borderWidth="1px"
borderColor={useColorModeValue('purple.100', 'purple.700')} borderColor={useColorModeValue('purple.100', 'purple.700')}
borderRadius="md" borderRadius="md"
@@ -225,6 +242,7 @@ const StockListItem = ({
}} }}
cursor="pointer" cursor="pointer"
flexShrink={0} flexShrink={0}
alignSelf="center"
_hover={{ _hover={{
borderColor: useColorModeValue('purple.300', 'purple.500'), borderColor: useColorModeValue('purple.300', 'purple.500'),
boxShadow: 'sm' boxShadow: 'sm'