From f578969ee6d0e58d85c415e66424ff4d17a04d2b Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Sun, 23 Nov 2025 14:25:38 +0800 Subject: [PATCH] update pay function --- src/views/Concept/ConceptTimelineModal.js | 570 +++++++++++++++++----- 1 file changed, 435 insertions(+), 135 deletions(-) diff --git a/src/views/Concept/ConceptTimelineModal.js b/src/views/Concept/ConceptTimelineModal.js index 95f561aa..c75021ed 100644 --- a/src/views/Concept/ConceptTimelineModal.js +++ b/src/views/Concept/ConceptTimelineModal.js @@ -46,6 +46,7 @@ import { FaHistory, FaNewspaper, FaFileAlt, + FaClock, } from 'react-icons/fa'; import { keyframes } from '@emotion/react'; @@ -58,6 +59,11 @@ const pulseAnimation = keyframes` 100% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; } `; +const shimmerAnimation = keyframes` + 0% { transform: translateX(-100%); } + 100% { transform: translateX(100%); } +`; + // API配置 - 与主文件保持一致 const API_BASE_URL = process.env.NODE_ENV === 'production' ? '/concept-api' @@ -213,24 +219,35 @@ const ConceptTimelineModal = ({ // 如果有价格数据,添加价格事件 if (hasPriceData) { + const changePercent = item.price.avg_change_pct; + const isSignificantRise = changePercent >= 3; // 涨幅 >= 3% 为重大利好 let bgColor = '#e2e8f0'; + let title = priceInfo.text; + if (priceInfo.color === 'red') { - bgColor = '#FC8181'; // 红色(上涨) + if (isSignificantRise) { + // 涨幅 >= 3%,使用醒目的橙红色 + 火焰图标 + bgColor = '#F56565'; // 更深的红色 + title = `🔥 ${priceInfo.text}`; + } else { + bgColor = '#FC8181'; // 普通红色(上涨) + } } else if (priceInfo.color === 'green') { bgColor = '#68D391'; // 绿色(下跌) } events.push({ id: `${item.date}-price`, - title: priceInfo.text, + title: title, date: item.date, start: item.date, backgroundColor: bgColor, - borderColor: bgColor, + borderColor: isSignificantRise ? '#C53030' : bgColor, // 深红色边框强调 extendedProps: { eventType: 'price', priceInfo, originalData: item, + isSignificantRise, // 标记重大涨幅 } }); } @@ -589,19 +606,46 @@ const ConceptTimelineModal = ({ - - - {conceptName} - 历史时间轴 - + + + + {conceptName} - 历史时间轴 + + 最近100天 - + 🔥 Max版功能 @@ -638,22 +682,81 @@ const ConceptTimelineModal = ({ ) : timelineData.length > 0 ? ( {/* 图例说明 */} - - - - 有新闻/研报 + + + + 📰 新闻 - - - 上涨 + + + 📊 研报 - - - 下跌 + + + 上涨 - - - 无数据 + + + 下跌 + + + 🔥 + 涨3%+ @@ -748,28 +851,32 @@ const ConceptTimelineModal = ({ displayEventTime={false} /> - - {/* 底部说明 */} - - - 时间轴起始点 - - ) : ( -
- - - - 暂无历史数据 - +
+ + + + + 暂无历史数据 + + + 该概念在最近100天内没有相关事件记录 + +
)} @@ -780,8 +887,24 @@ const ConceptTimelineModal = ({ - - @@ -798,28 +921,69 @@ const ConceptTimelineModal = ({ scrollBehavior="inside" > - - - - - - {formatDateDisplay(selectedDate)} + + + + + + + {formatDateDisplay(selectedDate)} + {selectedDateData.price && ( - - - - - {getPriceInfo(selectedDateData.price).text} + + + + {getPriceInfo(selectedDateData.price).icon && ( + + )} + + {getPriceInfo(selectedDateData.price).text} + {selectedDateData.price.stock_count && ( - - 📊 统计股票: {selectedDateData.price.stock_count} 只 - + + 📊 统计股票: + {selectedDateData.price.stock_count} 只 + )} )} @@ -829,20 +993,85 @@ const ConceptTimelineModal = ({ {selectedDateData.events && selectedDateData.events.length > 0 ? ( - + + {/* 统计卡片 */} + + + + + + {selectedDateData.events.filter(e => e.type === 'news').length} + + 条新闻 + + + + + + + {selectedDateData.events.filter(e => e.type === 'report').length} + + 篇研报 + + + + + {/* 事件列表 */} + {selectedDateData.events.map((event, eventIdx) => ( @@ -850,104 +1079,175 @@ const ConceptTimelineModal = ({ colorScheme={event.type === 'news' ? 'blue' : 'green'} variant="solid" fontSize="sm" + px={3} + py={1} + borderRadius="full" + boxShadow="sm" > {event.type === 'news' ? '📰 新闻' : '📊 研报'} - {event.source && ( - - {event.source} - - )} {event.publisher && ( - + {event.publisher} )} {event.rating && ( - - {event.rating} + + ⭐ {event.rating} )} {event.security_name && ( - - {event.security_name} + + 🏢 {event.security_name} )} - + {event.title} - + {event.content || '暂无内容'} - {event.time && ( - - 🕐 {formatDateTime(event.time)} - - )} + + {event.time && ( + + + + {formatDateTime(event.time)} + + + )} - + + ))} ) : ( -
- - - - 当日无新闻或研报 - - {selectedDateData.price && ( - - 仅有涨跌幅数据 +
+ + + + + 当日无新闻或研报 - )} + {selectedDateData.price && ( + + 仅有涨跌幅数据 + + )} +
)} - -