feat: 新增「喝什么」场景,支持奶茶/咖啡/酒吧等饮品店搜索
引入场景系统(SceneType),首页增加「吃什么」「喝什么」切换 Tab, 不同场景使用不同的高德 POI 类型、热门标签、价格区间和全链路文案。 场景信息存储在房间数据中,邀请/分享/匹配结果等页面自动适配。
This commit is contained in:
@@ -7,6 +7,7 @@ import SwipeDeck from "@/components/SwipeDeck";
|
||||
import LeaveConfirmModal from "@/components/LeaveConfirmModal";
|
||||
import { useRoomPolling } from "@/hooks/useRoomPolling";
|
||||
import { getUserId } from "@/lib/userId";
|
||||
import { getSceneConfig } from "@/lib/sceneConfig";
|
||||
|
||||
export default function RoomPage() {
|
||||
const params = useParams<{ id: string }>();
|
||||
@@ -21,7 +22,7 @@ export default function RoomPage() {
|
||||
|
||||
const {
|
||||
userCount, match, matchType, matchLikes, runnerUps, likeCounts, swipeCounts,
|
||||
restaurants, notFound, mutate, creatorId, locked, users, userProfiles,
|
||||
restaurants, notFound, mutate, creatorId, locked, users, userProfiles, scene,
|
||||
} = useRoomPolling(roomId);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -107,11 +108,13 @@ export default function RoomPage() {
|
||||
const initialIndex = swipeCounts[userId] ?? 0;
|
||||
const ready = joined && userId && restaurants.length > 0;
|
||||
|
||||
const sceneConfig = getSceneConfig(scene);
|
||||
|
||||
if (!ready) {
|
||||
return (
|
||||
<div className="flex h-dvh flex-col items-center justify-center gap-3 bg-background">
|
||||
<div className="h-6 w-6 animate-spin rounded-full border-2 border-zinc-300 border-t-emerald-500" />
|
||||
<p className="text-sm text-zinc-400">正在加载餐厅数据...</p>
|
||||
<p className="text-sm text-zinc-400">正在加载数据...</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -129,6 +132,7 @@ export default function RoomPage() {
|
||||
swipeCounts={swipeCounts}
|
||||
totalCards={restaurants.length}
|
||||
userProfiles={userProfiles}
|
||||
scene={scene}
|
||||
/>
|
||||
<SwipeDeck
|
||||
restaurants={restaurants}
|
||||
@@ -145,6 +149,7 @@ export default function RoomPage() {
|
||||
userProfiles={userProfiles}
|
||||
onReset={handleReset}
|
||||
onNarrow={handleNarrow}
|
||||
scene={scene}
|
||||
/>
|
||||
<LeaveConfirmModal
|
||||
open={showLeaveConfirm}
|
||||
|
||||
Reference in New Issue
Block a user