From c120c1c65b844f63125661098e147eef6c066751 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Wed, 31 Dec 2025 18:33:51 +0800 Subject: [PATCH] =?UTF-8?q?feat(HotSectorsRanking):=20=E6=94=AF=E6=8C=81?= =?UTF-8?q?=E6=9D=BF=E5=9D=97/=E6=A6=82=E5=BF=B5=E7=B1=BB=E5=9E=8B?= =?UTF-8?q?=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增 type 属性区分 sector/concept - 添加默认概念数据 - 根据类型切换图标 (TrendingUp/Flame) 和颜色 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../components/atoms/HotSectorsRanking.js | 26 ++++++++++++++----- 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/src/views/Profile/components/MarketDashboard/components/atoms/HotSectorsRanking.js b/src/views/Profile/components/MarketDashboard/components/atoms/HotSectorsRanking.js index 2b78f7b0..71870817 100644 --- a/src/views/Profile/components/MarketDashboard/components/atoms/HotSectorsRanking.js +++ b/src/views/Profile/components/MarketDashboard/components/atoms/HotSectorsRanking.js @@ -1,11 +1,11 @@ -// 热门板块排行组件 - 紧凑版(与 WatchlistPanel 风格保持一致) +// 热门板块/概念排行组件 - 紧凑版(与 WatchlistPanel 风格保持一致) import React from 'react'; import { Box, Text, VStack, HStack, Icon } from '@chakra-ui/react'; -import { TrendingUp } from 'lucide-react'; +import { TrendingUp, Flame } from 'lucide-react'; import MiniTrendLine from './MiniTrendLine'; -const HotSectorsRanking = ({ sectors = [], title = '热门板块', onSectorClick }) => { - // 默认数据 +const HotSectorsRanking = ({ sectors = [], title = '热门板块', type = 'sector', onSectorClick }) => { + // 默认板块数据 const defaultSectors = [ { rank: 1, name: '人工智能', change: 3.2, trend: [100, 102, 101, 104, 103, 106] }, { rank: 2, name: '新能源车', change: 1.8, trend: [100, 99, 101, 102, 101, 103] }, @@ -14,14 +14,28 @@ const HotSectorsRanking = ({ sectors = [], title = '热门板块', onSectorClick { rank: 5, name: '芯片半导体', change: 0.4, trend: [100, 100, 100, 101, 100, 101] }, ]; - const data = sectors.length > 0 ? sectors : defaultSectors; + // 默认概念数据 + const defaultConcepts = [ + { rank: 1, name: '锂电池', change: 4.5, trend: [100, 103, 105, 104, 108, 110] }, + { rank: 2, name: '人工智能', change: 3.8, trend: [100, 102, 104, 103, 106, 108] }, + { rank: 3, name: '机器人', change: 2.9, trend: [100, 101, 103, 102, 104, 106] }, + { rank: 4, name: '国企改革', change: 2.1, trend: [100, 101, 102, 101, 103, 104] }, + { rank: 5, name: '新能源', change: 1.6, trend: [100, 100, 101, 102, 101, 103] }, + ]; + + const defaultData = type === 'concept' ? defaultConcepts : defaultSectors; + const data = sectors.length > 0 ? sectors : defaultData; + + // 根据类型选择图标和颜色 + const IconComponent = type === 'concept' ? Flame : TrendingUp; + const iconColor = type === 'concept' ? 'rgba(139, 92, 246, 0.9)' : 'rgba(34, 197, 94, 0.9)'; return ( {/* 标题 - 与 WatchlistPanel 风格一致 */} - + {title}