update pay ui

This commit is contained in:
2025-12-03 13:43:55 +08:00
parent 9a6230e51e
commit 51ed56726c
5 changed files with 51 additions and 116 deletions

View File

@@ -14,12 +14,9 @@ import {
Center,
Wrap,
WrapItem,
Icon,
Progress,
useColorModeValue,
useToast,
} from '@chakra-ui/react';
import { FaChartLine } from 'react-icons/fa';
import { getImportanceConfig } from '../../../../constants/importanceLevels';
import { eventService } from '../../../../services/eventService';
import { useEventStocks } from '../StockDetailPanel/hooks/useEventStocks';
@@ -338,76 +335,6 @@ const DynamicNewsDetailPanel = ({ event, showHeader = true }) => {
{/* 事件描述 */}
<EventDescriptionSection description={event.description} />
{/* 超预期得分显示 - 参考历史事件对比的样式 */}
{expectationScore != null && expectationScore > 0 && (
<Box
p={3}
bg={useColorModeValue(
expectationScore >= 60 ? 'red.50' : expectationScore >= 40 ? 'orange.50' : 'yellow.50',
expectationScore >= 60 ? 'red.900' : expectationScore >= 40 ? 'orange.900' : 'yellow.900'
)}
borderColor={useColorModeValue(
expectationScore >= 60 ? 'red.200' : expectationScore >= 40 ? 'orange.200' : 'yellow.200',
expectationScore >= 60 ? 'red.700' : expectationScore >= 40 ? 'orange.700' : 'yellow.700'
)}
borderWidth="1px"
borderRadius="md"
>
<HStack spacing={3} justify="space-between">
<HStack spacing={2}>
<Icon
as={FaChartLine}
color={useColorModeValue(
expectationScore >= 60 ? 'red.600' : expectationScore >= 40 ? 'orange.600' : 'yellow.600',
expectationScore >= 60 ? 'red.300' : expectationScore >= 40 ? 'orange.300' : 'yellow.300'
)}
boxSize="18px"
/>
<Text
fontSize="sm"
fontWeight="bold"
color={useColorModeValue(
expectationScore >= 60 ? 'red.700' : expectationScore >= 40 ? 'orange.700' : 'yellow.800',
expectationScore >= 60 ? 'red.200' : expectationScore >= 40 ? 'orange.200' : 'yellow.200'
)}
>
超预期得分
</Text>
</HStack>
<HStack spacing={3} flex={1} maxW="200px">
<Progress
value={expectationScore}
max={100}
size="sm"
flex={1}
colorScheme={expectationScore >= 60 ? 'red' : expectationScore >= 40 ? 'orange' : 'yellow'}
borderRadius="full"
bg={useColorModeValue('gray.200', 'gray.600')}
/>
<Text
fontSize="lg"
fontWeight="bold"
color={useColorModeValue(
expectationScore >= 60 ? 'red.600' : expectationScore >= 40 ? 'orange.600' : 'yellow.700',
expectationScore >= 60 ? 'red.300' : expectationScore >= 40 ? 'orange.300' : 'yellow.300'
)}
minW="40px"
textAlign="right"
>
{expectationScore}
</Text>
</HStack>
</HStack>
<Text
fontSize="xs"
color={useColorModeValue('gray.600', 'gray.400')}
mt={1}
>
基于历史事件判断当前事件的超预期情况满分100分
</Text>
</Box>
)}
{/* 相关股票(可折叠) - 懒加载 - 需要 PRO 权限 - 支持精简/详细模式 */}
<CollapsibleSection
title="相关股票"

View File

@@ -1,6 +1,5 @@
// src/views/EventDetail/components/HistoricalEvents.js
import React, { useState, useEffect } from 'react';
import { useNavigate } from 'react-router-dom';
import {
Box,
VStack,
@@ -21,7 +20,6 @@ import {
ModalHeader,
ModalCloseButton,
ModalBody,
Link,
Flex,
Collapse
} from '@chakra-ui/react';
@@ -42,8 +40,6 @@ const HistoricalEvents = ({
loading = false,
error = null
}) => {
const navigate = useNavigate();
// 状态管理
const [selectedEventForStocks, setSelectedEventForStocks] = useState(null);
const [stocksModalOpen, setStocksModalOpen] = useState(false);
@@ -117,10 +113,10 @@ const HistoricalEvents = ({
setSelectedEventForStocks(null);
};
// 处理卡片点击跳转到事件详情页
const handleCardClick = (event) => {
navigate(`/event-detail/${event.id}`);
};
// 历史事件卡片不需要点击跳转历史事件ID与主事件不同链接无效
// const handleCardClick = (event) => {
// navigate(`/event-detail/${event.id}`);
// };
// 获取重要性颜色
const getImportanceColor = (importance) => {
@@ -250,8 +246,6 @@ const HistoricalEvents = ({
borderRadius="lg"
position="relative"
overflow="visible"
cursor="pointer"
onClick={() => handleCardClick(event)}
_before={{
content: '""',
position: 'absolute',
@@ -263,10 +257,6 @@ const HistoricalEvents = ({
borderTopLeftRadius: 'lg',
borderTopRightRadius: 'lg',
}}
_hover={{
boxShadow: 'lg',
borderColor: 'blue.400',
}}
transition="all 0.2s"
>
<VStack align="stretch" spacing={3} p={4}>
@@ -280,12 +270,6 @@ const HistoricalEvents = ({
fontWeight="bold"
color={useColorModeValue('blue.500', 'blue.300')}
lineHeight="1.4"
cursor="pointer"
onClick={(e) => {
e.stopPropagation();
handleCardClick(event);
}}
_hover={{ textDecoration: 'underline' }}
>
{event.title || '未命名事件'}
</Text>