feat: 新增 Taro 模板双端运行与独立 Web 预览

This commit is contained in:
que01 committed 2026-10-08 15:28:26 +08:00
1 parent f4061a24bd
commit 7e8fc01fba
48 files changed
+11576 -12

No files matched your search

+28
View File
@@ -0,0 +1,28 @@
import { View, Text, Button } from "@tarojs/components";
import Taro from "@tarojs/taro";
import type { RuntimeWorkspace } from "@personal-brand/types";
import { presentation, object, text } from "../runtime/content";
import { brandSlug } from "../runtime/api";
import { navigate } from "../runtime/navigation";
export function Success({ workspace }: { workspace: RuntimeWorkspace }) {
const p = presentation(workspace, "success");
const result = object(Taro.getStorageSync<unknown>(`latestInquiry:${brandSlug()}`));
if (!text(result.id))
return (
<View className="runtime-state">
尚未提交咨询<Button onClick={() => navigate("inquiry")}>填写需求</Button>
</View>
);
return (
<View className="success-page">
<Text className="success-symbol">✓</Text>
<Text className="eyebrow">{p.eyebrow}</Text>
<Text className="form-title">{p.title || "已收到你的需求"}</Text>
<Text className="form-subtitle">{p.intro}</Text>
<Button className="submit-button" onClick={() => navigate("records")}>
{p.recordsAction || "查看咨询记录"}
</Button>
<Button onClick={() => navigate("home")}>{p.homeAction || "返回首页"}</Button>
</View>
);
}