fix: 概念中心H5端卡片尺寸优化,一屏可显示更多内容
- H5端改为两列布局,间距从6改为3
- 卡片背景高度从180px减小到100px
- Logo尺寸从120px减小到60px
- 内容区域padding和间距响应式调整
- 描述文字H5端显示1行
- 时间轴按钮尺寸H5端缩小
This commit is contained in:
@@ -78,6 +78,7 @@ import {
|
|||||||
MenuList,
|
MenuList,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
Collapse,
|
Collapse,
|
||||||
|
useBreakpointValue,
|
||||||
} from '@chakra-ui/react';
|
} from '@chakra-ui/react';
|
||||||
import { SearchIcon, ViewIcon, CalendarIcon, ExternalLinkIcon, StarIcon, ChevronDownIcon, InfoIcon, CloseIcon, ChevronRightIcon } from '@chakra-ui/icons';
|
import { SearchIcon, ViewIcon, CalendarIcon, ExternalLinkIcon, StarIcon, ChevronDownIcon, InfoIcon, CloseIcon, ChevronRightIcon } from '@chakra-ui/icons';
|
||||||
import { FaThLarge, FaList, FaTags, FaChartLine, FaRobot, FaTable, FaHistory, FaBrain, FaLightbulb, FaRocket, FaShieldAlt, FaCalendarAlt, FaArrowUp, FaArrowDown, FaNewspaper, FaFileAlt, FaExpand, FaCompress, FaClock, FaLock } from 'react-icons/fa';
|
import { FaThLarge, FaList, FaTags, FaChartLine, FaRobot, FaTable, FaHistory, FaBrain, FaLightbulb, FaRocket, FaShieldAlt, FaCalendarAlt, FaArrowUp, FaArrowDown, FaNewspaper, FaFileAlt, FaExpand, FaCompress, FaClock, FaLock } from 'react-icons/fa';
|
||||||
@@ -672,6 +673,10 @@ const ConceptCenter = () => {
|
|||||||
const changePercent = concept.price_info?.avg_change_pct;
|
const changePercent = concept.price_info?.avg_change_pct;
|
||||||
const changeColor = getChangeColor(changePercent);
|
const changeColor = getChangeColor(changePercent);
|
||||||
const hasChange = changePercent !== null && changePercent !== undefined;
|
const hasChange = changePercent !== null && changePercent !== undefined;
|
||||||
|
// H5 端使用更紧凑的尺寸
|
||||||
|
const isMobile = useBreakpointValue({ base: true, md: false });
|
||||||
|
const coverHeight = useBreakpointValue({ base: '100px', md: '180px' });
|
||||||
|
const logoSize = useBreakpointValue({ base: '60px', md: '120px' });
|
||||||
|
|
||||||
// 生成随机涨幅数字背景
|
// 生成随机涨幅数字背景
|
||||||
const generateNumbersBackground = () => {
|
const generateNumbersBackground = () => {
|
||||||
@@ -705,7 +710,7 @@ const ConceptCenter = () => {
|
|||||||
boxShadow="0 4px 12px rgba(0, 0, 0, 0.1)"
|
boxShadow="0 4px 12px rgba(0, 0, 0, 0.1)"
|
||||||
>
|
>
|
||||||
{/* 毛玻璃涨幅数字背景 */}
|
{/* 毛玻璃涨幅数字背景 */}
|
||||||
<Box position="relative" height="180px" overflow="hidden">
|
<Box position="relative" height={coverHeight} overflow="hidden">
|
||||||
{/* 渐变背景层 */}
|
{/* 渐变背景层 */}
|
||||||
<Box
|
<Box
|
||||||
position="absolute"
|
position="absolute"
|
||||||
@@ -757,8 +762,8 @@ const ConceptCenter = () => {
|
|||||||
top="50%"
|
top="50%"
|
||||||
left="50%"
|
left="50%"
|
||||||
transform="translate(-50%, -50%)"
|
transform="translate(-50%, -50%)"
|
||||||
width="120px"
|
width={logoSize}
|
||||||
height="120px"
|
height={logoSize}
|
||||||
opacity={0.15}
|
opacity={0.15}
|
||||||
>
|
>
|
||||||
<Image
|
<Image
|
||||||
@@ -849,11 +854,11 @@ const ConceptCenter = () => {
|
|||||||
</Badge>
|
</Badge>
|
||||||
</Box>
|
</Box>
|
||||||
|
|
||||||
<CardBody p={4}>
|
<CardBody p={{ base: 3, md: 4 }}>
|
||||||
<VStack align="start" spacing={2}>
|
<VStack align="start" spacing={{ base: 1, md: 2 }}>
|
||||||
{/* 概念名称 */}
|
{/* 概念名称 */}
|
||||||
<Heading
|
<Heading
|
||||||
size="sm"
|
size={{ base: 'xs', md: 'sm' }}
|
||||||
color="gray.800"
|
color="gray.800"
|
||||||
noOfLines={1}
|
noOfLines={1}
|
||||||
bgGradient="linear(to-r, purple.600, pink.600)"
|
bgGradient="linear(to-r, purple.600, pink.600)"
|
||||||
@@ -863,15 +868,15 @@ const ConceptCenter = () => {
|
|||||||
{concept.concept}
|
{concept.concept}
|
||||||
</Heading>
|
</Heading>
|
||||||
|
|
||||||
{/* 描述信息 */}
|
{/* 描述信息 - H5端显示1行 */}
|
||||||
<Text color="gray.600" fontSize="xs" noOfLines={2} minH="32px">
|
<Text color="gray.600" fontSize="xs" noOfLines={isMobile ? 1 : 2} minH={{ base: '16px', md: '32px' }}>
|
||||||
{concept.description || '暂无描述信息'}
|
{concept.description || '暂无描述信息'}
|
||||||
</Text>
|
</Text>
|
||||||
|
|
||||||
{concept.stocks && concept.stocks.length > 0 && (
|
{concept.stocks && concept.stocks.length > 0 && (
|
||||||
<Box
|
<Box
|
||||||
width="100%"
|
width="100%"
|
||||||
p={3}
|
p={{ base: 2, md: 3 }}
|
||||||
bg="linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%)"
|
bg="linear-gradient(135deg, rgba(99, 102, 241, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%)"
|
||||||
borderRadius="lg"
|
borderRadius="lg"
|
||||||
cursor="pointer"
|
cursor="pointer"
|
||||||
@@ -886,7 +891,7 @@ const ConceptCenter = () => {
|
|||||||
>
|
>
|
||||||
<Flex align="center" justify="space-between">
|
<Flex align="center" justify="space-between">
|
||||||
<Box flex={1}>
|
<Box flex={1}>
|
||||||
<HStack spacing={2} mb={2}>
|
<HStack spacing={2} mb={{ base: 1, md: 2 }}>
|
||||||
<Icon as={FaChartLine} boxSize={3} color="purple.500" />
|
<Icon as={FaChartLine} boxSize={3} color="purple.500" />
|
||||||
<Text fontSize="xs" color="purple.700" fontWeight="bold">
|
<Text fontSize="xs" color="purple.700" fontWeight="bold">
|
||||||
热门个股
|
热门个股
|
||||||
@@ -942,20 +947,20 @@ const ConceptCenter = () => {
|
|||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Divider borderColor="purple.100" />
|
<Divider borderColor="purple.100" my={{ base: 1, md: 0 }} />
|
||||||
|
|
||||||
<Flex width="100%" justify="space-between" align="center">
|
<Flex width="100%" justify="space-between" align="center">
|
||||||
{formatAddedDate(concept)}
|
{formatAddedDate(concept)}
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
size="sm"
|
size={{ base: 'xs', md: 'sm' }}
|
||||||
leftIcon={<FaHistory />}
|
leftIcon={<FaHistory />}
|
||||||
bgGradient="linear(to-r, purple.500, pink.500)"
|
bgGradient="linear(to-r, purple.500, pink.500)"
|
||||||
color="white"
|
color="white"
|
||||||
variant="solid"
|
variant="solid"
|
||||||
onClick={(e) => handleViewContent(e, concept.concept, concept.concept_id)}
|
onClick={(e) => handleViewContent(e, concept.concept, concept.concept_id)}
|
||||||
borderRadius="full"
|
borderRadius="full"
|
||||||
px={4}
|
px={{ base: 2, md: 4 }}
|
||||||
fontWeight="medium"
|
fontWeight="medium"
|
||||||
boxShadow="0 4px 12px rgba(139, 92, 246, 0.3)"
|
boxShadow="0 4px 12px rgba(139, 92, 246, 0.3)"
|
||||||
_hover={{
|
_hover={{
|
||||||
@@ -1598,7 +1603,7 @@ const ConceptCenter = () => {
|
|||||||
)}
|
)}
|
||||||
|
|
||||||
{loading ? (
|
{loading ? (
|
||||||
<SimpleGrid columns={{ base: 1, md: 2, lg: 3 }} spacing={6}>
|
<SimpleGrid columns={{ base: 2, md: 2, lg: 3 }} spacing={{ base: 3, md: 6 }}>
|
||||||
{[...Array(12)].map((_, i) => (
|
{[...Array(12)].map((_, i) => (
|
||||||
<SkeletonCard key={i} />
|
<SkeletonCard key={i} />
|
||||||
))}
|
))}
|
||||||
@@ -1606,7 +1611,7 @@ const ConceptCenter = () => {
|
|||||||
) : concepts.length > 0 ? (
|
) : concepts.length > 0 ? (
|
||||||
<>
|
<>
|
||||||
{viewMode === 'grid' ? (
|
{viewMode === 'grid' ? (
|
||||||
<SimpleGrid columns={{ base: 1, md: 2, lg: 3 }} spacing={6} className="concept-grid">
|
<SimpleGrid columns={{ base: 2, md: 2, lg: 3 }} spacing={{ base: 3, md: 6 }} className="concept-grid">
|
||||||
{concepts.map((concept, index) => (
|
{concepts.map((concept, index) => (
|
||||||
<Box key={concept.concept_id} className="concept-item" role="group">
|
<Box key={concept.concept_id} className="concept-item" role="group">
|
||||||
<ConceptCard concept={concept} position={index} />
|
<ConceptCard concept={concept} position={index} />
|
||||||
|
|||||||
Reference in New Issue
Block a user