feat: 增加滑动参与感 - 进度条、实时气泡、热度标签

- 卡片上方显示滑动进度条和计数 (3/15)
- 轮询检测到当前卡片新增 like 时弹出"有人也想去这家!"气泡
- 卡片图片角落显示"🔥N 人想去"热度标签
- 后端 GET /api/room/[id] 新增 likeCounts 字段
This commit is contained in:
2026-02-24 17:36:04 +08:00
parent a72f7ed884
commit fb49e21eb2
7 changed files with 94 additions and 11 deletions
+8
View File
@@ -37,12 +37,20 @@ export async function GET(
matchLikes = best.likes;
}
const likeCounts: Record<string, number> = {};
for (const [rid, users] of Object.entries(data.likes)) {
if (users.length > 0) {
likeCounts[rid] = users.length;
}
}
return NextResponse.json({
roomId: id,
userCount: data.users.length,
match,
matchType,
matchLikes,
likeCounts,
restaurants: data.restaurants,
});
} catch (e) {