feat: 新增「喝什么」场景,支持奶茶/咖啡/酒吧等饮品店搜索
引入场景系统(SceneType),首页增加「吃什么」「喝什么」切换 Tab, 不同场景使用不同的高德 POI 类型、热门标签、价格区间和全链路文案。 场景信息存储在房间数据中,邀请/分享/匹配结果等页面自动适配。
This commit is contained in:
@@ -4,12 +4,15 @@ import { useCallback, useRef } from "react";
|
||||
import { motion, AnimatePresence } from "framer-motion";
|
||||
import { QRCodeSVG } from "qrcode.react";
|
||||
import { X, Copy, Share2, QrCode } from "lucide-react";
|
||||
import type { SceneType } from "@/types";
|
||||
import { getSceneConfig } from "@/lib/sceneConfig";
|
||||
|
||||
interface QrInviteModalProps {
|
||||
open: boolean;
|
||||
onClose: () => void;
|
||||
roomId: string;
|
||||
onToast: (msg: string) => void;
|
||||
scene?: SceneType;
|
||||
}
|
||||
|
||||
export default function QrInviteModal({
|
||||
@@ -17,7 +20,9 @@ export default function QrInviteModal({
|
||||
onClose,
|
||||
roomId,
|
||||
onToast,
|
||||
scene = "eat",
|
||||
}: QrInviteModalProps) {
|
||||
const sceneConfig = getSceneConfig(scene);
|
||||
const inviteUrl =
|
||||
typeof window !== "undefined"
|
||||
? `${window.location.origin}/invite/${roomId}`
|
||||
@@ -39,8 +44,8 @@ export default function QrInviteModal({
|
||||
|
||||
const handleShare = useCallback(async () => {
|
||||
const shareData = {
|
||||
title: "别说随便啦,来滑卡片决定吃什么!",
|
||||
text: "我建好房间了,快点开链接一起选餐厅,滑中同一家就去吃!",
|
||||
title: sceneConfig.shareTitle,
|
||||
text: sceneConfig.shareText,
|
||||
url: inviteUrl,
|
||||
};
|
||||
|
||||
@@ -54,7 +59,7 @@ export default function QrInviteModal({
|
||||
}
|
||||
|
||||
handleCopy();
|
||||
}, [inviteUrl, handleCopy]);
|
||||
}, [inviteUrl, handleCopy, sceneConfig]);
|
||||
|
||||
return (
|
||||
<AnimatePresence>
|
||||
@@ -88,7 +93,7 @@ export default function QrInviteModal({
|
||||
<h2 className="text-lg font-bold">邀请饭搭子</h2>
|
||||
</div>
|
||||
<p className="mt-1 text-xs text-zinc-400">
|
||||
让朋友扫码加入房间,一起滑卡片选餐厅
|
||||
{sceneConfig.qrSubtitle}
|
||||
</p>
|
||||
|
||||
<div className="mt-5 rounded-2xl border-2 border-dashed border-emerald-200 bg-emerald-50/30 p-4">
|
||||
|
||||
Reference in New Issue
Block a user