update pay function

This commit is contained in:
2025-11-23 23:44:36 +08:00
parent 4054e2e106
commit 8c372bbc89
2 changed files with 11 additions and 3 deletions

Binary file not shown.

View File

@@ -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;