diff --git a/__pycache__/app.cpython-310.pyc b/__pycache__/app.cpython-310.pyc new file mode 100644 index 00000000..88dd3f9a Binary files /dev/null and b/__pycache__/app.cpython-310.pyc differ diff --git a/src/views/ValueForum/PredictionTopicDetail.js b/src/views/ValueForum/PredictionTopicDetail.js index 45f241fb..2f079324 100644 --- a/src/views/ValueForum/PredictionTopicDetail.js +++ b/src/views/ValueForum/PredictionTopicDetail.js @@ -140,9 +140,17 @@ const PredictionTopicDetail = () => { return null; } - // 获取选项数据 - const yesData = topic.positions?.yes || { total_shares: 0, current_price: 500, lord_id: null }; - const noData = topic.positions?.no || { total_shares: 0, current_price: 500, lord_id: null }; + // 获取选项数据(从后端扁平结构映射到前端使用的嵌套结构) + const yesData = { + total_shares: topic.yes_total_shares || 0, + current_price: topic.yes_price || 500, + lord_id: topic.yes_lord_id || null, + }; + const noData = { + total_shares: topic.no_total_shares || 0, + current_price: topic.no_price || 500, + lord_id: topic.no_lord_id || null, + }; // 计算总份额 const totalShares = yesData.total_shares + noData.total_shares;