fix: pk comment

This commit is contained in:
zzc
2026-06-15 23:37:33 +08:00
parent b79e1e8204
commit 7a332ba44d
3 changed files with 743 additions and 3 deletions

View File

@@ -258,10 +258,29 @@ const goToPkStation = () => {
};
const goToPkDetail = (item) => {
if (!item?.topicId) return;
const focusItemId = item.selfChooseItemId || item.left.id;
if (!item?.id) return;
const cacheKey = `pk_detail_cache_${item.id}`;
uni.setStorageSync(cacheKey, {
id: item.id,
topicId: item.topicId,
topicTitle: item.topicTitle,
leftItemId: item.left.id,
leftItemName: item.left.name,
leftItemAvatar: item.left.avatar,
rightItemId: item.right.id,
rightItemName: item.right.name,
rightItemAvatar: item.right.avatar,
voteCount: item.voteCount,
leftVoteCount: item.leftVoteCount,
rightVoteCount: item.rightVoteCount,
selfChooseItemId: item.selfChooseItemId,
selfChooseSide: item.selfChooseSide,
leftPercent: item.leftPercent,
rightPercent: item.rightPercent,
votedAt: item.votedAt,
});
uni.navigateTo({
url: `/pages/rating/pk?topicId=${item.topicId}&itemId=${focusItemId}`,
url: `/pages/pk/detail?pkId=${item.id}&cacheKey=${cacheKey}`,
});
};