update pay ui
This commit is contained in:
@@ -752,6 +752,15 @@ const ConceptCenter = () => {
|
||||
return `https://valuefrontier.cn/company?scode=${seccode}`;
|
||||
};
|
||||
|
||||
// 获取最新爆发日期(从 outbreak_dates 数组中取最新的)
|
||||
const getLatestOutbreakDate = (concept) => {
|
||||
const dates = concept.outbreak_dates;
|
||||
if (!dates || dates.length === 0) return null;
|
||||
// 排序获取最新日期
|
||||
const sortedDates = [...dates].sort((a, b) => new Date(b) - new Date(a));
|
||||
return sortedDates[0];
|
||||
};
|
||||
|
||||
// 格式化添加日期显示
|
||||
const formatAddedDate = (concept) => {
|
||||
// 优先使用 created_at 或 added_date 字段
|
||||
@@ -1066,15 +1075,33 @@ const ConceptCenter = () => {
|
||||
<Divider borderColor="whiteAlpha.100" my={{ base: 1, md: 0 }} />
|
||||
|
||||
<Flex width="100%" justify="space-between" align="center">
|
||||
{/* 添加日期 - 深色主题适配 */}
|
||||
{concept.created_at || concept.added_date || concept.happened_times?.[0] ? (
|
||||
{/* 日期显示 - 根据排序方式显示爆发日期或添加日期 */}
|
||||
{(() => {
|
||||
const latestOutbreak = getLatestOutbreakDate(concept);
|
||||
const addedDate = concept.created_at || concept.added_date || concept.happened_times?.[0];
|
||||
|
||||
// 优先显示爆发日期(如果存在)
|
||||
if (latestOutbreak) {
|
||||
return (
|
||||
<HStack spacing={2}>
|
||||
<Icon as={BsLightningFill} boxSize={3} color="orange.400" />
|
||||
<Text fontSize="xs" color="orange.300" fontWeight="medium">
|
||||
爆发于 {new Date(latestOutbreak).toLocaleDateString('zh-CN')}
|
||||
</Text>
|
||||
</HStack>
|
||||
);
|
||||
} else if (addedDate) {
|
||||
return (
|
||||
<HStack spacing={2}>
|
||||
<Icon as={CalendarIcon} boxSize={3} color="cyan.400" />
|
||||
<Text fontSize="xs" color="whiteAlpha.600" fontWeight="medium">
|
||||
添加于 {new Date(concept.created_at || concept.added_date || concept.happened_times?.[0]).toLocaleDateString('zh-CN')}
|
||||
添加于 {new Date(addedDate).toLocaleDateString('zh-CN')}
|
||||
</Text>
|
||||
</HStack>
|
||||
) : <Box />}
|
||||
);
|
||||
}
|
||||
return <Box />;
|
||||
})()}
|
||||
|
||||
<Button
|
||||
size={{ base: 'xs', md: 'sm' }}
|
||||
@@ -1216,15 +1243,32 @@ const ConceptCenter = () => {
|
||||
</HStack>
|
||||
)}
|
||||
|
||||
{/* 添加日期 - 深色主题 */}
|
||||
{(concept.created_at || concept.added_date || concept.happened_times?.[0]) && (
|
||||
{/* 日期显示 - 优先显示爆发日期 */}
|
||||
{(() => {
|
||||
const latestOutbreak = getLatestOutbreakDate(concept);
|
||||
const addedDate = concept.created_at || concept.added_date || concept.happened_times?.[0];
|
||||
|
||||
if (latestOutbreak) {
|
||||
return (
|
||||
<HStack spacing={1}>
|
||||
<Icon as={BsLightningFill} boxSize={4} color="orange.400" />
|
||||
<Text fontSize="sm" color="orange.300" fontWeight="medium">
|
||||
爆发于 {new Date(latestOutbreak).toLocaleDateString('zh-CN')}
|
||||
</Text>
|
||||
</HStack>
|
||||
);
|
||||
} else if (addedDate) {
|
||||
return (
|
||||
<HStack spacing={1}>
|
||||
<Icon as={CalendarIcon} boxSize={4} color="cyan.400" />
|
||||
<Text fontSize="sm" color="whiteAlpha.600">
|
||||
添加于 {new Date(concept.created_at || concept.added_date || concept.happened_times?.[0]).toLocaleDateString('zh-CN')}
|
||||
添加于 {new Date(addedDate).toLocaleDateString('zh-CN')}
|
||||
</Text>
|
||||
</HStack>
|
||||
)}
|
||||
);
|
||||
}
|
||||
return null;
|
||||
})()}
|
||||
</HStack>
|
||||
</VStack>
|
||||
</Box>
|
||||
|
||||
Reference in New Issue
Block a user