From d6d5885c1010a1e61c79ed72d8325f17c59264a3 Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 25 Dec 2025 18:48:38 +0800 Subject: [PATCH] =?UTF-8?q?feat(ValueForum):=20=E4=BC=98=E5=8C=96=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E5=B8=83=E5=B1=80=E5=92=8C=E5=8A=A0=E8=BD=BD=E7=8A=B6?= =?UTF-8?q?=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 添加响应式左右 padding - 使用 PageLoader 统一加载样式 - 修复预测市场数据格式处理 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/views/ValueForum/index.js | 37 +++++++++++------------------------ 1 file changed, 11 insertions(+), 26 deletions(-) diff --git a/src/views/ValueForum/index.js b/src/views/ValueForum/index.js index 12ceb034..e7521adc 100644 --- a/src/views/ValueForum/index.js +++ b/src/views/ValueForum/index.js @@ -16,7 +16,6 @@ import { InputGroup, InputLeftElement, Select, - Spinner, Center, useDisclosure, Flex, @@ -38,6 +37,7 @@ import PredictionTopicCard from './components/PredictionTopicCard'; import CreatePostModal from './components/CreatePostModal'; import CreatePredictionModal from './components/CreatePredictionModal'; import PredictionGuideModal from './components/PredictionGuideModal'; +import PageLoader from '@components/Loading/PageLoader'; const MotionBox = motion(Box); @@ -97,10 +97,15 @@ const ValueForum = () => { setLoading(true); const response = await getTopics({ status: 'active', sort_by: sortBy }); if (response.success) { - setPredictionTopics(response.data); + // 支持两种返回格式:直接数组或带分页的对象 + const topicsData = Array.isArray(response.data) + ? response.data + : (response.data?.topics || []); + setPredictionTopics(topicsData); } } catch (error) { console.error('获取预测话题失败:', error); + setPredictionTopics([]); } finally { setLoading(false); } @@ -153,8 +158,8 @@ const ValueForum = () => { pt="80px" pb="20" > - {/* padding 由 MainLayout 统一设置 */} - + {/* 内容区域 */} + {/* 顶部横幅 */} { {/* 普通帖子标签页 */} {loading && page === 1 ? ( -
- - - 加载中... - -
+ ) : posts.length === 0 ? (
@@ -420,17 +415,7 @@ const ValueForum = () => { {/* 预测市场标签页 */} {loading ? ( -
- - - 加载中... - -
+ ) : predictionTopics.length === 0 ? (