feat: 增加滑动参与感 - 进度条、实时气泡、热度标签
- 卡片上方显示滑动进度条和计数 (3/15)
- 轮询检测到当前卡片新增 like 时弹出"有人也想去这家!"气泡
- 卡片图片角落显示"🔥N 人想去"热度标签
- 后端 GET /api/room/[id] 新增 likeCounts 字段
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user