106 lines
4.0 KiB
TypeScript
106 lines
4.0 KiB
TypeScript
import type { SceneType } from "@/types";
|
|
|
|
export interface SceneConfig {
|
|
key: SceneType;
|
|
label: string;
|
|
emoji: string;
|
|
verb: string;
|
|
poiTypes: string;
|
|
defaultImage: string;
|
|
hotTags: readonly string[];
|
|
priceOptions: readonly { label: string; value: string }[];
|
|
tagLabel: string;
|
|
tagPlaceholder: string;
|
|
loadingText: string;
|
|
emptyError: string;
|
|
subtitle: string;
|
|
inviteText: string;
|
|
shareTitle: string;
|
|
shareText: string;
|
|
qrSubtitle: string;
|
|
}
|
|
|
|
const SCENE_CONFIGS: Record<SceneType, SceneConfig> = {
|
|
eat: {
|
|
key: "eat",
|
|
label: "餐厅",
|
|
emoji: "🍜",
|
|
verb: "吃",
|
|
poiTypes: "050000",
|
|
defaultImage:
|
|
"https://images.unsplash.com/photo-1517248135467-4c7edcad34c4?w=800&q=80",
|
|
hotTags: ["火锅", "日料", "烧烤", "西餐", "川菜", "粤菜", "小吃快餐"],
|
|
priceOptions: [
|
|
{ label: "不限", value: "any" },
|
|
{ label: "¥50以下", value: "under50" },
|
|
{ label: "¥50-100", value: "50to100" },
|
|
{ label: "¥100+", value: "over100" },
|
|
],
|
|
tagLabel: "口味",
|
|
tagPlaceholder: "想吃什么?(留空则不限)",
|
|
loadingText: "正在搜索周边餐厅...",
|
|
emptyError: "附近没有找到餐厅,试试扩大搜索范围或换个口味",
|
|
subtitle: "和朋友一起滑卡片,再也不用纠结吃什么",
|
|
inviteText: "有人邀请你一起选餐厅",
|
|
shareTitle: "别说随便啦,来滑卡片决定吃什么!",
|
|
shareText: "我建好房间了,快点开链接一起选餐厅,滑中同一家就去吃!",
|
|
qrSubtitle: "让朋友扫码加入房间,一起滑卡片选餐厅",
|
|
},
|
|
drinks: {
|
|
key: "drinks",
|
|
label: "咖啡/奶茶",
|
|
emoji: "🧋",
|
|
verb: "喝",
|
|
poiTypes: "050301|050302|050303|050400",
|
|
defaultImage:
|
|
"https://images.unsplash.com/photo-1556679343-c7306c1976bc?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: "让朋友扫码加入房间,一起滑卡片选饮品店",
|
|
},
|
|
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", "drinks", "dessert"];
|
|
|
|
export function getSceneConfig(scene: string): SceneConfig {
|
|
return SCENE_CONFIGS[scene as SceneType] ?? SCENE_CONFIGS.eat;
|
|
}
|