diff --git a/src/views/Profile/components/ForumCenter/components/CommunityFeedCard.js b/src/views/Profile/components/ForumCenter/components/CommunityFeedCard.js new file mode 100644 index 00000000..bae63725 --- /dev/null +++ b/src/views/Profile/components/ForumCenter/components/CommunityFeedCard.js @@ -0,0 +1,121 @@ +// 社区动态卡片 +import React, { useState } from 'react'; +import { Box, Text, VStack, HStack, Icon, Button } from '@chakra-ui/react'; +import { Newspaper, Flame, MessageCircle } from 'lucide-react'; + +const CommunityFeedCard = ({ + myPosts = [ + { id: 1, title: '关于新能源车下半场的思考', date: '2025/12/18', replies: 32, isHot: true }, + { id: 2, title: '半导体行业深度分析', date: '2025/12/15', replies: 18, isHot: false }, + ], + participatedPosts = [ + { id: 3, title: 'AI产业链投资机会分析', date: '2025/12/17', replies: 45, isHot: true }, + { id: 4, title: '消费板块复苏节奏讨论', date: '2025/12/14', replies: 12, isHot: false }, + ], + onPostClick, +}) => { + const [activeTab, setActiveTab] = useState('my'); // 'my' | 'participated' + + const currentPosts = activeTab === 'my' ? myPosts : participatedPosts; + + return ( + + {/* 标题栏 */} + + + + 社区动态 + + + + {/* 内容区 */} + + + {/* Tab 切换 */} + + + + + + {/* 帖子列表 */} + + {currentPosts.map((post) => ( + onPostClick?.(post)} + > + + {post.title} + + + {post.date} + · + + {post.isHot ? ( + + ) : ( + + )} + + {post.replies}回复 + + + + + ))} + + + + + ); +}; + +export default CommunityFeedCard; diff --git a/src/views/Profile/components/ForumCenter/components/PredictionCard.js b/src/views/Profile/components/ForumCenter/components/PredictionCard.js new file mode 100644 index 00000000..f82f8a22 --- /dev/null +++ b/src/views/Profile/components/ForumCenter/components/PredictionCard.js @@ -0,0 +1,169 @@ +// 我的预测卡片 +import React from 'react'; +import { Box, Text, VStack, HStack, Button, Icon } from '@chakra-ui/react'; +import { Zap, History, TrendingUp, TrendingDown } from 'lucide-react'; + +const PredictionCard = ({ + question = '大A 2025年收盘价?', + myBet = { type: '看涨', points: 500 }, + winRate = 58, + odds = 1.8, + onBullish, + onBearish, + onViewHistory, +}) => { + return ( + + {/* 标题栏 */} + + + + 我的预测 + + + + {/* 内容区 */} + + + {/* 预测问题 - 带渐变背景 */} + + {/* 装饰性弧线 */} + + + + {question} + + + {/* 看涨/看跌按钮 */} + + + + + + + {/* 底部信息 */} + + + + 我的下注: + + {myBet.type} + + + {myBet.points}积分 + + + + + + + + + 当前胜率: + + {winRate}% + + + + 赔率: + + {odds} + + + + + + + + + + ); +}; + +export default PredictionCard; diff --git a/src/views/Profile/components/ForumCenter/components/index.js b/src/views/Profile/components/ForumCenter/components/index.js new file mode 100644 index 00000000..fdc5e756 --- /dev/null +++ b/src/views/Profile/components/ForumCenter/components/index.js @@ -0,0 +1,3 @@ +// 价值论坛子组件导出 +export { default as PredictionCard } from './PredictionCard'; +export { default as CommunityFeedCard } from './CommunityFeedCard'; diff --git a/src/views/Profile/components/ForumCenter/index.js b/src/views/Profile/components/ForumCenter/index.js new file mode 100644 index 00000000..03861567 --- /dev/null +++ b/src/views/Profile/components/ForumCenter/index.js @@ -0,0 +1,49 @@ +// 价值论坛 / 互动中心组件 (Forum Center) +import React from 'react'; +import { Box, Text, HStack, SimpleGrid, Icon } from '@chakra-ui/react'; +import { MessageCircle } from 'lucide-react'; +import GlassCard from '@components/GlassCard'; +import { PredictionCard, CommunityFeedCard } from './components'; + +const ForumCenter = () => { + return ( + + {/* 标题栏 */} + + + + 价值论坛 / 互动中心 + + + + + {/* 两列布局:预测卡片 + 社区动态 */} + + + + + + ); +}; + +export default ForumCenter;