From fbb2c229640a454c9dbaebe46aa652b91ed93ce9 Mon Sep 17 00:00:00 2001 From: kurihada Date: Thu, 26 Feb 2026 23:04:25 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=9C=BA=E6=99=AF=E7=BB=86=E5=88=86?= =?UTF-8?q?=E4=B8=BA=E9=A4=90=E5=8E=85/=E5=92=96=E5=95=A1=E5=A5=B6?= =?UTF-8?q?=E8=8C=B6/=E7=94=9C=E5=93=81=20+=20=E9=99=84=E8=BF=91=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=E4=BC=98=E5=85=88=20+=20=E7=BE=8E=E9=A3=9F=E5=A4=9A?= =?UTF-8?q?=E9=80=89=E6=A0=87=E7=AD=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app/api/room/create/route.ts | 2 +- src/app/invite/[id]/page.tsx | 4 +- src/app/panic/page.tsx | 44 +++++++++---------- src/components/RestaurantShareCard.tsx | 3 +- src/lib/sceneConfig.ts | 58 +++++++++++++++++++------- src/types/index.ts | 2 +- 6 files changed, 71 insertions(+), 42 deletions(-) diff --git a/src/app/api/room/create/route.ts b/src/app/api/room/create/route.ts index dd4e8b5..78ead33 100644 --- a/src/app/api/room/create/route.ts +++ b/src/app/api/room/create/route.ts @@ -115,7 +115,7 @@ export const POST = apiHandler(async (req) => { scene = "eat" as SceneType, } = body; - const sceneConfig = getSceneConfig(scene === "drink" ? "drink" : "eat"); + const sceneConfig = getSceneConfig(scene); const numLat = Number(lat); const numLng = Number(lng); diff --git a/src/app/invite/[id]/page.tsx b/src/app/invite/[id]/page.tsx index 15bed4c..a7ae3e2 100644 --- a/src/app/invite/[id]/page.tsx +++ b/src/app/invite/[id]/page.tsx @@ -4,12 +4,10 @@ import { useEffect, useState } from "react"; import { useParams, useRouter } from "next/navigation"; import { motion } from "framer-motion"; import { - Utensils, Users, Heart, Sparkles, ChevronRight, - Coffee, } from "lucide-react"; import { getUserId } from "@/lib/userId"; import { joinRoom } from "@/lib/room"; @@ -108,7 +106,7 @@ export default function InvitePage() { transition={{ duration: 0.5 }} >
- {scene === "drink" ? : } + {sceneConfig.emoji}

diff --git a/src/app/panic/page.tsx b/src/app/panic/page.tsx index 7d9dcac..a3ea0e8 100644 --- a/src/app/panic/page.tsx +++ b/src/app/panic/page.tsx @@ -206,7 +206,7 @@ export default function PanicPage() {

- ⚡ 极速救场 + 极速救场

10秒内出结果 @@ -256,30 +256,32 @@ export default function PanicPage() { - {SCENES.map((s) => { - const cfg = getSceneConfig(s); - const active = scene === s; - return ( - - ); - })} +

+ {SCENES.map((s) => { + const cfg = getSceneConfig(s); + const active = scene === s; + return ( + + ); + })} +
= { eat: { key: "eat", - label: "吃什么", + label: "餐厅", emoji: "🍜", + verb: "吃", poiTypes: "050000", defaultImage: "https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=800&q=80", - hotTags: ["火锅", "日料", "烧烤", "西餐", "川菜", "咖啡甜品", "小吃快餐"], + hotTags: ["火锅", "日料", "烧烤", "西餐", "川菜", "粤菜", "小吃快餐"], priceOptions: [ { label: "不限", value: "any" }, { label: "¥50以下", value: "under50" }, { label: "¥50-100", value: "50to100" }, { label: "¥100+", value: "over100" }, ], - tagLabel: "美食", + tagLabel: "口味", tagPlaceholder: "想吃什么?(留空则不限)", - loadingText: "正在搜索周边美食...", - emptyError: "附近没有找到餐厅,试试扩大搜索范围或换个菜系", + loadingText: "正在搜索周边餐厅...", + emptyError: "附近没有找到餐厅,试试扩大搜索范围或换个口味", subtitle: "和朋友一起滑卡片,再也不用纠结吃什么", inviteText: "有人邀请你一起选餐厅", shareTitle: "别说随便啦,来滑卡片决定吃什么!", shareText: "我建好房间了,快点开链接一起选餐厅,滑中同一家就去吃!", qrSubtitle: "让朋友扫码加入房间,一起滑卡片选餐厅", }, - drink: { - key: "drink", - label: "喝什么", + drinks: { + key: "drinks", + label: "咖啡/奶茶", emoji: "🧋", + verb: "喝", poiTypes: "050301|050302|050303|050400", defaultImage: "https://images.unsplash.com/photo-1556679343-c7306c1976bc?w=800&q=80", - hotTags: ["奶茶", "咖啡", "酒吧", "果茶", "甜品", "茶馆", "鸡尾酒"], + hotTags: ["咖啡", "奶茶", "拿铁", "美式", "水果茶", "冷萃", "芋泥"], priceOptions: [ { label: "不限", value: "any" }, { label: "¥20以下", value: "under20" }, { label: "¥20-50", value: "20to50" }, { label: "¥50+", value: "over50" }, ], - tagLabel: "饮品", + tagLabel: "类型", tagPlaceholder: "想喝什么?(留空则不限)", loadingText: "正在搜索周边饮品店...", - emptyError: "附近没有找到饮品店,试试扩大搜索范围或换个类型", + emptyError: "附近没有找到饮品店,试试扩大搜索范围", subtitle: "和朋友一起滑卡片,再也不用纠结喝什么", inviteText: "有人邀请你一起选饮品店", shareTitle: "别说随便啦,来滑卡片决定喝什么!", shareText: "我建好房间了,快点开链接一起选店,滑中同一家就去喝!", - qrSubtitle: "让朋友扫码加入房间,一起滑卡片选店", + qrSubtitle: "让朋友扫码加入房间,一起滑卡片选饮品店", + }, + dessert: { + key: "dessert", + label: "甜品", + emoji: "🍰", + verb: "吃", + poiTypes: "050403|050404|050400", + defaultImage: + "https://images.unsplash.com/photo-1488477181946-6428a0291777?w=800&q=80", + hotTags: ["蛋糕", "冰淇淋", "芋圆", "麻薯", "草莓", "班戟"], + priceOptions: [ + { label: "不限", value: "any" }, + { label: "¥20以下", value: "under20" }, + { label: "¥20-50", value: "20to50" }, + { label: "¥50+", value: "over50" }, + ], + tagLabel: "类型", + tagPlaceholder: "想吃什么甜品?(留空则不限)", + loadingText: "正在搜索周边甜品店...", + emptyError: "附近没有找到甜品店,试试扩大搜索范围", + subtitle: "和朋友一起滑卡片,选一家甜蜜蜜的甜品店", + inviteText: "有人邀请你一起选甜品店", + shareTitle: "别说随便啦,来滑卡片决定吃什么甜品!", + shareText: "我建好房间了,快点开链接一起选甜品店,滑中同一家就去吃!", + qrSubtitle: "让朋友扫码加入房间,一起滑卡片选甜品店", }, }; -export const SCENES: SceneType[] = ["eat", "drink"]; +export const SCENES: SceneType[] = ["eat", "drinks", "dessert"]; -export function getSceneConfig(scene: SceneType): SceneConfig { - return SCENE_CONFIGS[scene]; +export function getSceneConfig(scene: string): SceneConfig { + return SCENE_CONFIGS[scene as SceneType] ?? SCENE_CONFIGS.eat; } diff --git a/src/types/index.ts b/src/types/index.ts index afeb8a2..85c78c4 100644 --- a/src/types/index.ts +++ b/src/types/index.ts @@ -1,4 +1,4 @@ -export type SceneType = "eat" | "drink"; +export type SceneType = "eat" | "drinks" | "dessert"; export interface Restaurant { id: string;