From bc844bb4dc298d17f084a804c00df85657c035e5 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Mon, 22 Dec 2025 16:51:08 +0800 Subject: [PATCH] =?UTF-8?q?feat(ForumCenter):=20=E6=96=B0=E5=A2=9E?= =?UTF-8?q?=E4=BB=B7=E5=80=BC=E8=AE=BA=E5=9D=9B/=E4=BA=92=E5=8A=A8?= =?UTF-8?q?=E4=B8=AD=E5=BF=83=E7=BB=84=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 我的预测卡片(看涨/看跌投票) - 社区动态卡片(我发布的/我参与的) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../components/CommunityFeedCard.js | 121 +++++++++++++ .../ForumCenter/components/PredictionCard.js | 169 ++++++++++++++++++ .../ForumCenter/components/index.js | 3 + .../Profile/components/ForumCenter/index.js | 49 +++++ 4 files changed, 342 insertions(+) create mode 100644 src/views/Profile/components/ForumCenter/components/CommunityFeedCard.js create mode 100644 src/views/Profile/components/ForumCenter/components/PredictionCard.js create mode 100644 src/views/Profile/components/ForumCenter/components/index.js create mode 100644 src/views/Profile/components/ForumCenter/index.js 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;