update pay function
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user