Skip to content

PRINTFILM: AI short-video marketing and AI short-drama creation platform

feat: 微信群二维码可后台更换,并补获客模板与配音链路

yi941e8a0bbb5c
diff --git a/README.md b/README.md
index 0a9f785..e6395b1 100644
--- a/README.md
+++ b/README.md
@@ -35,6 +35,7 @@
- [9. 日常运维](#9-日常运维)
- [10. 常见问题与排查](#10-常见问题与排查)
- [11. 附录](#11-附录)
+- [社区](#社区)
- [贡献](#贡献)
- [开源许可](#开源许可)
@@ -680,6 +681,18 @@ curl http://localhost:8000/api/health
---
+## 社区
+
+扫码加入 **printfilm 用户群**(学习短剧 / 部署答疑 / 模板交流):
+
+<p align="center">
+ <img src="docs/images/wechat-group-qr.png" alt="PRINTFILM 微信用户群二维码" width="260" />
+</p>
+
+> 微信群邀请码约 **7 天**有效。线上可在管理后台 **系统设置 → 站点工具** 上传更换;开源 README 请同步更新 `docs/images/wechat-group-qr.png`。若扫码失败也可开 [Issue](https://github.com/yi1108/printfilm/issues) 告知。
+
+---
+
## 贡献
欢迎 Issue 与 Pull Request。提交前请对照 [docs/STANDARDS.md](docs/STANDARDS.md):
diff --git a/admin/src/api/client.ts b/admin/src/api/client.ts
index a7e435a..584a5fe 100644
--- a/admin/src/api/client.ts
+++ b/admin/src/api/client.ts
@@ -24,7 +24,7 @@ export async function api<T>(
options: RequestInit = {},
): Promise<T> {
const headers = new Headers(options.headers);
- if (!headers.has("Content-Type") && options.body) {
+ if (!headers.has("Content-Type") && options.body && !(options.body instanceof FormData)) {
headers.set("Content-Type", "application/json");
}
const token = getToken();
@@ -654,6 +654,7 @@ export type AdminModelSettings = {
public_base_url: string;
ffmpeg_path: string;
ffprobe_path: string;
+ wechat_group_qr_url: string;
source: string;
updated_at?: string | null;
readiness: ModelCapabilityReadiness[];
diff --git a/admin/src/components/settings/SiteSettingsPanel.tsx b/admin/src/components/settings/SiteSettingsPanel.tsx
index a594ae6..aff666f 100644
--- a/admin/src/components/settings/SiteSettingsPanel.tsx
+++ b/admin/src/components/settings/SiteSettingsPanel.tsx
@@ -1,3 +1,5 @@
+import { useRef, useState } from "react";
+import { toast } from "sonner";
import {
LabeledControl,
SettingsLoading,
@@ -5,11 +7,25 @@ import {
SettingsStatusBar,
SettingsTabShell,
} from "@/components/settings/SettingsPanel";
+import { Button } from "@/components/ui/button";
+import { api, type AdminModelSettings } from "@/api/client";
import { useAdminModelSettings } from "@/hooks/useAdminModelSettings";
-// 站点 URL 与本地工具路径
+/** 把相对 /static 路径拼成可预览地址(走当前管理端同源代理) */
+function previewSrc(url: string | undefined | null): string {
+ const raw = (url || "").trim();
+ if (!raw) return "";
+ if (raw.startsWith("http://") || raw.startsWith("https://") || raw.startsWith("data:")) {
+ return raw;
+ }
+ return raw;
+}
+
+/** 站点 URL、媒体工具与微信群二维码 */
export function SiteSettingsPanel() {
- const { form, loading, saving, patchField, save } = useAdminModelSettings();
+ const { form, loading, saving, patchField, save, load } = useAdminModelSettings();
+ const fileRef = useRef<HTMLInputElement>(null);
+ const [uploading, setUploading] = useState(false);
async function handleSave() {
if (!form) return;
@@ -18,11 +34,33 @@ export function SiteSettingsPanel() {
public_base_url: form.public_base_url,
ffmpeg_path: form.ffmpeg_path,
ffprobe_path: form.ffprobe_path,
+ wechat_group_qr_url: form.wechat_group_qr_url,
},
"站点配置已保存",
);
}
+ // 上传并立刻写入 settings.wechat_group_qr_url
+ async function onPickFile(file: File | null) {
+ if (!file) return;
+ setUploading(true);
+ try {
+ const body = new FormData();
+ body.append("file", file);
+ await api<{ wechat_group_qr_url: string; settings: AdminModelSettings }>(
+ "/api/admin/settings/site/wechat-group-qr",
+ { method: "POST", body },
+ );
+ await load();
+ toast.success("微信群二维码已更新");
+ } catch (err) {
+ toast.error(err instanceof Error ? err.message : "上传失败");
+ } finally {
+ setUploading(false);
+ if (fileRef.current) fileRef.current.value = "";
+ }
+ }
+
if (loading || !form) {
return <SettingsLoading />;
}
@@ -30,9 +68,12 @@ export function SiteSettingsPanel() {
const hasPublic = Boolean(form.public_base_url?.trim());
const hasFfmpeg = Boolean(form.ffmpeg_path?.trim());
const hasFfprobe = Boolean(form.ffprobe_path?.trim());
+ const qrUrl = (form.wechat_group_qr_url || "").trim();
+ const hasQr = Boolean(qrUrl);
+ const qrPreview = previewSrc(qrUrl);
return (
- <SettingsTabShell onSave={() => void handleSave()} saving={saving}>
+ <SettingsTabShell onSave={() => void handleSave()} saving={saving || uploading}>
<SettingsStatusBar
title="站点工具状态"
items={[
@@ -57,6 +98,13 @@ export function SiteSettingsPanel() {
readyText: form.ffprobe_path || "已配置",
pendingText: "使用默认 PATH",
},
+ {
+ id: "wechat",
+ label: "微信群二维码",
+ ready: hasQr,
+ readyText: "已配置",
+ pendingText: "未上传",
+ },
]}
/>
@@ -108,6 +156,74 @@ export function SiteSettingsPanel() {
</LabeledControl>
</div>
</SettingsPanel>
+
+ <SettingsPanel
+ className="settings-panel--compact settings-field-span-full"
+ title="3. 微信用户群二维码"
+ description="官网右下角「加群」浮钮;微信邀请码约 7 天有效,过期后在此更换"
+ >
+ <div className="settings-field-grid">
+ <LabeledControl
+ label="当前二维码"
+ hint="支持 JPG / PNG / WebP,不超过 5MB"
+ className="settings-field-span-full"
+ >
+ <div className="flex flex-col gap-3 sm:flex-row sm:items-start">
+ <div className="flex h-[180px] w-[180px] shrink-0 items-center justify-center overflow-hidden rounded-xl border border-border bg-muted/40">
+ {qrPreview ? (
+ <img
+ src={qrPreview}
+ alt="微信群二维码预览"
+ className="max-h-full max-w-full object-contain"
+ />
+ ) : (
+ <span className="px-3 text-center text-xs text-muted-foreground">暂无图片</span>
+ )}
+ </div>
+ <div className="flex min-w-0 flex-1 flex-col gap-2">
+ <input
+ ref={fileRef}
+ type="file"
+ accept="image/png,image/jpeg,image/webp,.png,.jpg,.jpeg,.webp"
+ className="hidden"
+ onChange={(e) => void onPickFile(e.target.files?.[0] ?? null)}
+ />
+ <div className="flex flex-wrap gap-2">
+ <Button
+ type="button"
+ size="sm"
+ disabled={uploading}
+ onClick={() => fileRef.current?.click()}
+ >
+ {uploading ? "上传中…" : "上传新二维码"}
+ </Button>
+ <Button
+ type="button"
+ size="sm"
+ variant="outline"
+ disabled={uploading || !hasQr}
+ onClick={() => patchField("wechat_group_qr_url", "")}
+ >
+ 清空地址
+ </Button>
+ </div>
+ <LabeledControl label="图片 URL(可手改)" className="settings-field-span-full">
+ <input
+ className="settings-input"
+ placeholder="/static/site/wechat_group_qr.png"
+ value={form.wechat_group_qr_url || ""}
+ onChange={(e) => patchField("wechat_group_qr_url", e.target.value)}
+ />
+ </LabeledControl>
+ <p className="settings-panel-footnote">
+ 上传会立即生效并写入配置;手改 URL 后需点右上角「保存」。前台通过{" "}
+ <code>/api/site-config</code> 拉取。
+ </p>
+ </div>
+ </div>
+ </LabeledControl>
+ </div>
+ </SettingsPanel>
</div>
</SettingsTabShell>
);
diff --git a/admin/src/lib/tokenfreeRecommendedModels.ts b/admin/src/lib/tokenfreeRecommendedModels.ts
index 3c84ddc..69709ef 100644
--- a/admin/src/lib/tokenfreeRecommendedModels.ts
+++ b/admin/src/lib/tokenfreeRecommendedModels.ts
@@ -7,7 +7,14 @@ export const RECOMMENDED_MODEL_IDS: Record<ModelCapability, string[]> = {
text: ["kimi-k2.6"],
image: ["gpt-image-2-5"],
video: ["seedance-2-5", "seedance-2-0", "seedance-2-0-mini"],
- audio: ["qwen-tts-2025-05-22"],
+ audio: [
+ "qwen-tts-2025-05-22",
+ "qwen3-tts-flash",
+ "gemini-3.1-flash-tts",
+ "gemini-2.5-pro-preview-tts",
+ "elevenlabs-tts",
+ "elevenlabs/text-to-speech-multilingual-v2",
+ ],
};
const CAPABILITY_ORDER: ModelCapability[] = ["text", "image", "video", "audio"];
diff --git a/backend/app/api/admin/settings.py b/backend/app/api/admin/settings.py
index a5ebb84..cb392ae 100644
--- a/backend/app/api/admin/settings.py
+++ b/backend/app/api/admin/settings.py
@@ -1,7 +1,9 @@
# Admin model / provider settings API
import logging
+import time
+from pathlib import Path
-from fastapi import APIRouter, Depends, HTTPException
+from fastapi import APIRouter, Depends, File, HTTPException, UploadFile
from pydantic import BaseModel, Field
from sqlalchemy.ext.asyncio import AsyncSession
@@ -9,7 +11,13 @@ from app.database import get_db
from app.deps import get_current_admin
from app.models import User
from app.schemas_routing import AdminRoutingSettingsOut, AdminRoutingSettingsPatch, AdminRoutingSettingsSaveOut
-from app.schemas_settings import AdminModelSettingsOut, AdminModelSettingsPatch, AdminModelSettingsSaveOut, AdminModelSettingsImportEnvOut
+from app.schemas_settings import (
+ AdminModelSettingsImportEnvOut,
+ AdminModelSettingsOut,
+ AdminModelSettingsPatch,
+ AdminModelSettingsSaveOut,
+)
+from app.services import storage
from app.services.model_settings import (
get_admin_model_settings,
get_admin_routing_settings,
@@ -22,6 +30,14 @@ from app.services.upstream_model_catalog import list_upstream_models
router = APIRouter()
logger = logging.getLogger(__name__)
+_SITE_QR_MAX_BYTES = 5 * 1024 * 1024
+_SITE_QR_TYPES = {
+ "image/jpeg": ".jpg",
+ "image/jpg": ".jpg",
+ "image/png": ".png",
+ "image/webp": ".webp",
+}
+
class AdminUpstreamModelsRequest(BaseModel):
"""按渠道凭证拉取上游 /models 目录。"""
@@ -139,3 +155,60 @@ async def admin_tokenfree_account_quota(
except RuntimeError as exc:
logger.warning("tokenfree quota query failed: %s", exc)
raise HTTPException(status_code=502, detail="TokenFree 额度查询失败") from exc
+
+
+class WechatGroupQrUploadOut(BaseModel):
+ """微信群二维码上传结果。"""
+
+ ok: bool = True
+ wechat_group_qr_url: str
+ settings: AdminModelSettingsOut
+
+
[email protected]("/settings/site/wechat-group-qr", response_model=WechatGroupQrUploadOut)
+async def admin_upload_wechat_group_qr(
+ file: UploadFile = File(...),
+ _admin: User = Depends(get_current_admin),
+ db: AsyncSession = Depends(get_db),
+) -> WechatGroupQrUploadOut:
+ """上传并替换官网微信用户群二维码(落盘 /static/site,写入 settings)。"""
+ content_type = (file.content_type or "").lower()
+ ext = _SITE_QR_TYPES.get(content_type)
+ if not ext:
+ suffix = Path(file.filename or "").suffix.lower()
+ if suffix in {".jpg", ".jpeg", ".png", ".webp"}:
+ ext = ".jpg" if suffix == ".jpeg" else suffix
+ else:
+ raise HTTPException(status_code=400, detail="仅支持 JPG / PNG / WebP")
+
+ raw = await file.read()
+ if not raw:
+ raise HTTPException(status_code=400, detail="空文件")
+ if len(raw) > _SITE_QR_MAX_BYTES:
+ raise HTTPException(status_code=400, detail="图片不能超过 5MB")
+
+ site_dir = storage.STATIC_ROOT / "site"
+ site_dir.mkdir(parents=True, exist_ok=True)
+ # 固定文件名覆盖,避免旧码残留;query 防 CDN 缓存
+ dest = site_dir / f"wechat_group_qr{ext}"
+ for stale in site_dir.glob("wechat_group_qr.*"):
+ if stale.resolve() != dest.resolve():
+ try:
+ stale.unlink()
+ except OSError:
+ logger.warning("failed to remove old wechat qr %s", stale)
+ dest.write_bytes(raw)
+ published = storage.publish_local(dest, sync=True)
+ # 相对路径加版本;完整 OSS URL 也追加,便于刷缓存
+ sep = "&" if "?" in published else "?"
+ url = f"{published}{sep}v={int(time.time())}"
+
+ try:
+ settings_out, _applied = await patch_admin_model_settings(
+ db,
+ AdminModelSettingsPatch(wechat_group_qr_url=url),
+ )
+ except ValueError as exc:
+ raise HTTPException(status_code=400, detail=str(exc)) from exc
+
+ return WechatGroupQrUploadOut(wechat_group_qr_url=url, settings=settings_out)
diff --git a/backend/app/api/site.py b/backend/app/api/site.py
new file mode 100644
index 0000000..028caab
--- /dev/null
+++ b/backend/app/api/site.py
@@ -0,0 +1,23 @@
+"""Public site-facing config (no auth)."""
+
+from __future__ import annotations
+
+from fastapi import APIRouter
+from pydantic import BaseModel, Field
+
+from app.config import get_settings
+
+router = APIRouter(tags=["site"])
+
+
+class SiteConfigOut(BaseModel):
+ """Safe public marketing / contact knobs for the user frontend."""
+
+ wechat_group_qr_url: str = Field(default="", description="微信用户群二维码 URL")
+
+
[email protected]("/site-config", response_model=SiteConfigOut)
+async def get_site_config() -> SiteConfigOut:
+ """返回前台可公开读取的站点配置(微信群二维码等)。"""
+ url = str(get_settings().wechat_group_qr_url or "").strip()
+ return SiteConfigOut(wechat_group_qr_url=url)
diff --git a/backend/app/config.py b/backend/app/config.py
index 4ebcb0b..d307c28 100644
--- a/backend/app/config.py
+++ b/backend/app/config.py
@@ -157,6 +157,8 @@ class Settings(BaseSettings):
public_base_url: str = "http://127.0.0.1:8000"
ffmpeg_path: str = "ffmpeg"
ffprobe_path: str = "ffprobe"
+ # 官网右下角微信用户群二维码(相对 /static 或完整 URL;后台可更换)
+ wechat_group_qr_url: str = "/static/site/wechat_group_qr.png"
tos_endpoint: str = ""
tos_bucket: str = ""
diff --git a/backend/app/main.py b/backend/app/main.py
index 6ba2b99..a0e5072 100644
--- a/backend/app/main.py
+++ b/backend/app/main.py
@@ -9,6 +9,7 @@ from sqlalchemy import select, text
from app.api import auth, billing, projects, tasks, templates, tools
from app.api import api_keys as user_api_keys
+from app.api import site as site_api
from app.api.v1 import router as v1_router
from app.api.admin import router as admin_router
from app.api.drama import router as drama_router
@@ -79,6 +80,7 @@ static_dir.mkdir(parents=True, exist_ok=True)
(static_dir / "templates").mkdir(exist_ok=True)
(static_dir / "mock").mkdir(exist_ok=True)
(static_dir / "generated").mkdir(exist_ok=True)
+(static_dir / "site").mkdir(exist_ok=True)
app.mount("/static", StaticFiles(directory=str(static_dir)), name="static")
app.include_router(auth.router, prefix="/api")
@@ -91,6 +93,7 @@ app.include_router(user_api_keys.router, prefix="/api")
app.include_router(v1_router, prefix="/api")
app.include_router(drama_router, prefix="/api")
app.include_router(admin_router, prefix="/api")
+app.include_router(site_api.router, prefix="/api")
@app.on_event("startup")
diff --git a/backend/app/schemas_settings.py b/backend/app/schemas_settings.py
index a231017..9f85a7c 100644
--- a/backend/app/schemas_settings.py
+++ b/backend/app/schemas_settings.py
@@ -137,6 +137,7 @@ class AdminModelSettingsOut(BaseModel):
public_base_url: str = ""
ffmpeg_path: str = "ffmpeg"
ffprobe_path: str = "ffprobe"
+ wechat_group_qr_url: str = ""
source: str = "env"
updated_at: datetime | None = None
@@ -254,6 +255,7 @@ class AdminModelSettingsPatch(BaseModel):
public_base_url: str | None = None
ffmpeg_path: str | None = None
ffprobe_path: str | None = None
+ wechat_group_qr_url: str | None = None
class AdminModelSettingsSaveOut(BaseModel):
@@ -364,6 +366,7 @@ def model_config_field_names() -> tuple[str, ...]:
"public_base_url",
"ffmpeg_path",
"ffprobe_path",
+ "wechat_group_qr_url",
)
diff --git a/backend/app/services/ark.py b/backend/app/services/ark.py
index b95b31a..8e6beec 100644
--- a/backend/app/services/ark.py
+++ b/backend/app/services/ark.py
@@ -27,10 +27,17 @@ from app.services.logical_model_router import (
)
from app.services.tokenfree_audio import (
TOKENFREE_DEFAULT_TTS_MODEL,
+ build_omni_tts_chat_body,
+ extract_chat_audio_bytes,
+ extract_sse_audio_bytes,
+ iter_tokenfree_tts_models,
resolve_tokenfree_tts_model,
- tokenfree_speech_honors_speaker,
tokenfree_speech_voice,
+ tokenfree_tts_chat_model,
+ tokenfree_tts_uses_chat_audio,
+ tokenfree_tts_uses_omni_stream,
uses_tokenfree_audio,
+ wrap_pcm_s16le_wav,
)
from app.services.tokenfree_image import (
build_tokenfree_image_body,
@@ -228,6 +235,17 @@ _SEEDREAM_CG_STYLE = (
)
+def storyboard_name_policy(allow_source_names: bool) -> str:
+ """旁白是否保留用户文案中的店名/产品名;画面始终不烧录 logo。"""
+ if allow_source_names:
+ return (
+ "用户文案里出现的店名、地址、产品名、人名必须在旁白与 title 原样保留,"
+ "禁止改成某店/某品牌;文案没有的名称一律不许编。"
+ "img_prompt 仍禁止烧录真实 logo、商标图形或屏幕可读文字。"
+ )
+ return "禁止真实商标/公司名/人名(改用泛称)。"
+
+
@dataclass
class ShotPlan:
shot: int
@@ -516,6 +534,8 @@ class ArkGateway:
extra_requirements: str = "",
consistency_mode: str = "character",
output_ratio: str = "16:9",
+ shot_range_override: tuple[int, int] | None = None,
+ allow_source_names: bool = False,
) -> StoryboardResult:
if self.mock:
return await asyncio.to_thread(
@@ -526,6 +546,7 @@ class ArkGateway:
duration_min,
duration_max,
pipeline_mode,
+ shot_range_override,
)
user_constraints = ""
@@ -588,10 +609,15 @@ class ArkGateway:
"每镜 img_prompt 只写本镜场景与构图(景物、动作、光影),不要重复粘贴大段画风/人物锁定原文;"
"出现人物时用短句点出与 character_bible 一致的关键特征即可。"
)
- # shot_cap 单镜 duration 上限(秒);shot_lo/shot_hi 按文案字数动态拆镜数
+ # shot_cap 单镜 duration 上限(秒);shot_lo/shot_hi 按文案字数或模板锁定
shot_cap = min(duration_max, max_shot_duration)
- shot_lo, shot_hi = segplan.suggested_kepu_shot_range(source_text, pipeline_mode=pipeline_mode)
+ if shot_range_override:
+ shot_lo, shot_hi = shot_range_override
+ else:
+ shot_lo, shot_hi = segplan.suggested_kepu_shot_range(source_text, pipeline_mode=pipeline_mode)
shot_range = f"{shot_lo}-{shot_hi}"
+ # name_rule 获客模板保留用户文案中的店名;其它模板改用泛称以免商标入画
+ name_rule = storyboard_name_policy(allow_source_names)
# segment_rules 科普逐段脚本生产约束(对齐漫剧 cue,无 @asset)
segment_rules = (
"【segments 生产规范】"
@@ -604,7 +630,7 @@ class ArkGateway:
"旁白 duration 严格跟字数,最多多 1 秒呼吸,禁止把短句拉满到镜长上限或拖腔注水;"
"单段 duration 3-12 秒,镜内各段之和约等于本镜 duration,且不超过 "
f"{shot_cap} 秒。"
- "禁止真实商标/公司名/人名(改用泛称)。"
+ f"{name_rule}"
"character_bible 与 bgm_lock 全片唯一,各镜不得改人设或漂移 BGM 氛围。"
)
if pipeline_mode == "image_text":
@@ -633,7 +659,7 @@ class ArkGateway:
"segments(数组,精确到每一段:每项含 duration 秒、kind=visual|narration、text;"
"visual 写景别与画面动作,narration 写口播)、"
f"img_prompt({orient} {ratio} 构图画面提示词,留出边缘给文字叠层,主体居中,"
- "禁止要求画面内写字;禁止出现真实商标/公司名/人名,用泛称)、"
+ f"禁止要求画面内写字;{name_rule})、"
"video_prompt(可留空或写轻微推拉)、camera(如:缓慢推近/轻拉远)、bgm(情绪,全片尽量同一氛围)。"
"另输出顶层 bgm_lock(全片统一 BGM 氛围一句)。"
f"{segment_rules}"
@@ -1678,15 +1704,17 @@ class ArkGateway:
*,
model: str | None = None,
) -> bool:
- """OpenAI 兼容 /audio/speech(TokenFree New API 与方舟同路径)。"""
+ """TokenFree 上 Qwen-TTS 的 /audio/speech 未实现,改走 Omni/Gemini chat。"""
base = (self.settings.ark_base_url or "").rstrip("/")
key = (self.settings.ark_api_key or "").strip()
if not base or not key:
return False
model_id = (model or self._resolved_audio_model()).strip()
if uses_tokenfree_audio(base_url=base):
- model_id = resolve_tokenfree_tts_model(model_id)
- voice = tokenfree_speech_voice(voice)
+ model_id = tokenfree_tts_chat_model(resolve_tokenfree_tts_model(model_id))
+ voice = tokenfree_speech_voice(voice, model_id)
+ if tokenfree_tts_uses_chat_audio(model_id):
+ return await self._tts_openai_chat_audio(text, voice, dest, model=model_id)
async with httpx.AsyncClient(timeout=120.0) as client:
resp = await client.post(
f"{base}/audio/speech",
@@ -1698,6 +1726,9 @@ class ArkGateway:
"response_format": "mp3",
},
)
+ if resp.status_code < 400 and resp.content and len(resp.content) >= 1000:
+ dest.write_bytes(resp.content)
+ return True
if resp.status_code >= 400:
logger.warning(
"OpenAI speech HTTP %s model=%s: %s",
@@ -1705,11 +1736,58 @@ class ArkGateway:
model_id,
(resp.text or "")[:300],
)
+ if uses_tokenfree_audio(base_url=base) and tokenfree_tts_uses_chat_audio(model_id):
+ return await self._tts_openai_chat_audio(text, voice, dest, model=model_id)
+ return False
+
+ async def _tts_openai_chat_audio(
+ self,
+ text: str,
+ voice: str,
+ dest: Path,
+ *,
+ model: str,
+ ) -> bool:
+ """Gemini 非流式 chat 出音频;Qwen-Omni 必须 SSE 流式。"""
+ base = (self.settings.ark_base_url or "").rstrip("/")
+ if not base:
return False
- if not resp.content or len(resp.content) < 1000:
+ omni = tokenfree_tts_uses_omni_stream(model)
+ body = (
+ build_omni_tts_chat_body(text, voice, model)
+ if omni
+ else {
+ "model": model,
+ "messages": [{"role": "user", "content": text}],
+ "modalities": ["audio"],
+ "audio": {"voice": voice, "format": "mp3"},
+ }
+ )
+ async with httpx.AsyncClient(timeout=120.0) as client:
+ resp = await client.post(f"{base}/chat/completions", headers=self._headers(), json=body)
+ if resp.status_code >= 400:
+ logger.warning(
+ "OpenAI chat-audio HTTP %s model=%s: %s",
+ resp.status_code,
+ model,
+ (resp.text or "")[:300],
+ )
return False
- dest.write_bytes(resp.content)
- return True
+ audio: bytes | None = extract_sse_audio_bytes(resp.text or "") if omni else None
+ if not audio:
+ try:
+ payload = resp.json()
+ except Exception: # noqa: BLE001
+ payload = None
+ if isinstance(payload, dict):
+ audio = extract_chat_audio_bytes(payload)
+ if not audio:
+ return False
+ dest.parent.mkdir(parents=True, exist_ok=True)
+ wav = wrap_pcm_s16le_wav(audio)
+ if not wav:
+ return False
+ return await asyncio.to_thread(self._persist_tts_mp3, dest, wav)
@staticmethod
def _build_tts_additions(speaker: str, emotion_hint: str | None) -> str | None:
@@ -1734,7 +1812,7 @@ class ArkGateway:
duration_hint: float = 4.0,
emotion_hint: str | None = None,
) -> str:
- """整片/单镜配音:豆包 openspeech →(qwen 能认的音色才走 TokenFree)→ edge-tts;失败则抛错,不写静音。"""
+ """整片/单镜配音:豆包 openspeech → TokenFree 多 TTS → edge-tts;失败则抛错,不写静音。"""
voice_map = {
"narrator_calm": "zh_female_cancan_uranus_bigtts",
"warm_storyteller": "zh_female_tianmeixiaoyuan_uranus_bigtts",
@@ -1784,24 +1862,25 @@ class ArkGateway:
except Exception as exc: # noqa: BLE001
logger.warning("openspeech TTS failed: %s", exc)
- # TokenFree qwen-tts 只认 Ethan/Cherry 等;豆包 zh_* 会全员男=Ethan,先跳过
- if on_tokenfree and tokenfree_speech_honors_speaker(speaker):
- try:
- ok = await self._tts_openai_speech(clean, speaker, dest, model=audio_model)
- if ok:
- url = await _accept_if_audible("tokenfree-speech")
- if url:
- logger.info(
- "TTS tokenfree ok shot=%s model=%s bytes=%s",
- shot_no,
- audio_model,
- dest.stat().st_size,
- )
- return url
- except Exception as exc: # noqa: BLE001
- logger.warning("tokenfree speech failed: %s", exc)
+ # TokenFree:默认模型 + Gemini / ElevenLabs / Qwen 其它 TTS 依次试
+ if on_tokenfree:
+ for model_id in iter_tokenfree_tts_models(audio_model):
+ try:
+ ok = await self._tts_openai_speech(clean, speaker, dest, model=model_id)
+ if ok:
+ url = await _accept_if_audible("tokenfree-speech")
+ if url:
+ logger.info(
+ "TTS tokenfree ok shot=%s model=%s bytes=%s",
+ shot_no,
+ model_id,
+ dest.stat().st_size,
+ )
+ return url
+ except Exception as exc: # noqa: BLE001
+ logger.warning("tokenfree speech failed model=%s: %s", model_id, exc)
- # edge-tts:按 speaker 映射不同 neural,豆包未授权时仍能分出角色声线
+ # edge-tts:按 speaker 映射不同 neural,上游都失败时仍能分出角色声线
try:
await self._tts_edge(clean, dest, voice_hint=speaker)
url = await _accept_if_audible("edge-tts")
@@ -1811,22 +1890,6 @@ class ArkGateway:
except Exception as exc: # noqa: BLE001
logger.warning("edge-tts failed: %s", exc)
- # qwen 压声线也比完全没声音好:edge 失败后再用 TokenFree
- if on_tokenfree and not tokenfree_speech_honors_speaker(speaker):
- try:
- ok = await self._tts_openai_speech(clean, speaker, dest, model=audio_model)
- if ok:
- url = await _accept_if_audible("tokenfree-speech-fallback")
- if url:
- logger.info(
- "TTS tokenfree fallback ok shot=%s model=%s",
- shot_no,
- audio_model,
- )
- return url
- except Exception as exc: # noqa: BLE001
- logger.warning("tokenfree speech fallback failed: %s", exc)
-
# 非 TokenFree 时再试 /audio/speech(方舟等)
if not on_tokenfree:
try:
@@ -1914,12 +1977,76 @@ class ArkGateway:
return b"".join(chunks)
async def _tts_edge(self, text: str, dest: Path, voice_hint: str = "") -> None:
+ """微软 edge-tts 兜底。国内连 api.msedgeservices.com 常超过默认 10s,拉长握手并重试。"""
import edge_tts
voice = edge_tts_voice_for_speaker(voice_hint)
dest.parent.mkdir(parents=True, exist_ok=True)
- communicate = edge_tts.Communicate(text, voice)
- await communicate.save(str(dest))
+ last_err: Exception | None = None
+ for attempt in range(3):
+ try:
+ communicate = edge_tts.Communicate(
+ text,
+ voice,
+ connect_timeout=30,
+ receive_timeout=90,
+ )
+ await communicate.save(str(dest))
+ return
+ except Exception as exc: # noqa: BLE001
+ last_err = exc
+ logger.warning("edge-tts attempt %s/3 failed: %s", attempt + 1, exc)
+ if attempt < 2:
+ await asyncio.sleep(1.2 * (attempt + 1))
+ raise RuntimeError(str(last_err) if last_err else "edge-tts failed")
+
+ def _persist_tts_mp3(self, dest: Path, audio: bytes) -> bool:
+ """把 Omni WAV 转成配音 mp3;已是 MPEG 则直接落盘。转码失败返回 False。"""
+ if len(audio) < 1000:
+ return False
+ dest.parent.mkdir(parents=True, exist_ok=True)
+ if audio[:3] == b"ID3" or (audio[0] == 0xFF and (audio[1] & 0xE0) == 0xE0):
+ dest.write_bytes(audio)
+ return True
+ import shutil
+ import subprocess
+ import tempfile
+
+ # ffmpeg 可执行文件 / 临时 wav / 转码进程
+ ffmpeg = shutil.which(self.settings.ffmpeg_path) or shutil.which("ffmpeg")
+ if not ffmpeg:
+ logger.warning("tts persist skipped: ffmpeg not found")
+ return False
+ with tempfile.TemporaryDirectory(prefix="pf_tts_") as tmp_dir:
+ src = Path(tmp_dir) / "omni.wav"
+ src.write_bytes(audio)
+ proc = subprocess.run(
+ [
+ ffmpeg,
+ "-nostdin",
+ "-y",
+ "-i",
+ str(src),
+ "-q:a",
+ "4",
+ "-acodec",
+ "libmp3lame",
+ str(dest),
+ ],
+ capture_output=True,
+ check=False,
+ stdin=subprocess.DEVNULL,
+ )
+ if proc.returncode == 0 and dest.exists() and dest.stat().st_size >= 1000:
+ return True
+ logger.warning(
+ "tts persist ffmpeg failed code=%s stderr=%s",
+ proc.returncode,
+ (proc.stderr or b"").decode("utf-8", errors="replace")[:300],
+ )
+ if dest.exists():
+ dest.unlink(missing_ok=True)
+ return False
def _write_silence_mp3(self, dest: Path, duration: float) -> None:
import shutil
@@ -2031,6 +2158,7 @@ class ArkGateway:
duration_min: int,
duration_max: int,
pipeline_mode: str = "full",
+ shot_range_override: tuple[int, int] | None = None,
) -> StoryboardResult:
chunks = [c.strip() for c in re.split(r"[。!?\n\.\!\?]+", source_text) if c.strip()]
if source_type == "theme" and len(chunks) <= 1:
@@ -2045,7 +2173,10 @@ class ArkGateway:
if len(chunks) < 3:
chunks = chunks + ["补充画面过渡", "收尾总结"]
# shot_lo/shot_hi 与正式拆镜区间一致,避免 mock 仍只出 5 镜
- shot_lo, shot_hi = segplan.suggested_kepu_shot_range(source_text, pipeline_mode=pipeline_mode)
+ if shot_range_override:
+ shot_lo, shot_hi = shot_range_override
+ else:
+ shot_lo, shot_hi = segplan.suggested_kepu_shot_range(source_text, pipeline_mode=pipeline_mode)
chunks = chunks[:shot_hi]
while len(chunks) < shot_lo:
chunks.append("补充画面过渡")
diff --git a/backend/app/services/model_routing_config.py b/backend/app/services/model_routing_config.py
index 2e38ba9..51ce670 100644
--- a/backend/app/services/model_routing_config.py
+++ b/backend/app/services/model_routing_config.py
@@ -30,7 +30,15 @@ def infer_model_capability(model: str) -> LogicalModelCapability:
mid = normalize_model_name(model)
if not mid:
return "text"
- if "tts" in mid or mid.startswith("zh_") or "speaker" in mid or mid.startswith("s_"):
+ if (
+ "tts" in mid
+ or "text-to-speech" in mid
+ or "text-to-dialogue" in mid
+ or "elevenlabs" in mid
+ or mid.startswith("zh_")
+ or "speaker" in mid
+ or mid.startswith("s_")
+ ):
return "audio"
if (
"seedance" in mid
diff --git a/backend/app/services/pipeline.py b/backend/app/services/pipeline.py
index 83504f2..ea27654 100644
--- a/backend/app/services/pipeline.py
+++ b/backend/app/services/pipeline.py
@@ -32,8 +32,10 @@ from app.services.style_lock import (
merge_negative,
seedream_ref_urls,
strip_lock_blocks,
+ template_allow_source_names,
template_consistency_mode,
template_is_photoreal,
+ template_shot_range,
)
from app.services.kepu_continuity import (
image_refs_for_shot,
@@ -690,6 +692,8 @@ async def _script_stage(project_id: int) -> None:
extra_requirements=extra,
consistency_mode=consist,
output_ratio=_project_output_ratio(project),
+ shot_range_override=template_shot_range(tpl),
+ allow_source_names=template_allow_source_names(tpl),
)
plans = plans_result.shots
project.character_bible = resolve_script_character_bible(
diff --git a/backend/app/services/style_lock.py b/backend/app/services/style_lock.py
index 51beecb..5a2d7a2 100644
--- a/backend/app/services/style_lock.py
+++ b/backend/app/services/style_lock.py
@@ -163,6 +163,33 @@ def template_is_photoreal(tpl) -> bool:
return any(c in {"真人感", "写实感"} for c in cats)
+def _seedream_cfg(tpl) -> dict:
+ """取出模板 seedream_config,缺省或类型不对时返回空 dict。"""
+ cfg = getattr(tpl, "seedream_config", None) or {}
+ return cfg if isinstance(cfg, dict) else {}
+
+
+def template_shot_range(tpl) -> tuple[int, int] | None:
+ """模板锁定的分镜数量区间;未配置则返回 None,走字数默认 6–10 镜。"""
+ if tpl is None:
+ return None
+ cfg = _seedream_cfg(tpl)
+ raw_lo = cfg.get("shot_count_min")
+ if raw_lo is None:
+ return None
+ lo = max(1, int(raw_lo))
+ raw_hi = cfg.get("shot_count_max")
+ hi = max(lo, int(raw_hi)) if raw_hi is not None else lo
+ return lo, hi
+
+
+def template_allow_source_names(tpl) -> bool:
+ """获客类模板:旁白保留用户文案里的店名/产品名。"""
+ if tpl is None:
+ return False
+ return bool(_seedream_cfg(tpl).get("allow_source_names"))
+
+
def template_prompt_defaults(tpl) -> dict[str, str]:
"""Canonical style / character / extra prompts from a template.
diff --git a/backend/app/services/templates_seed.py b/backend/app/services/templates_seed.py
index 9834ed2..e0cd41b 100644
--- a/backend/app/services/templates_seed.py
+++ b/backend/app/services/templates_seed.py
@@ -1,7 +1,8 @@
"""内置风格模板 — 提示词与风格描述统一中文。
分类约定(category[0] 为主分类,用于首页筛选):
-电影感 / 真人感 / 写实感 / 科普 / 儿童 / 国风 / 科幻 / 动漫 / 3D / 商业 / 复古 / 纪录片 / 奇幻 / 图文 / 悬疑 / 开源
+电影感 / 真人感 / 写实感 / 科普 / 儿童 / 国风 / 科幻 / 动漫 / 3D / 商业 / 复古 / 纪录片 / 奇幻 / 图文 / 悬疑 / 开源 / 获客
+获客短视频四条在 templates_seed_huoke.py,并入 TEMPLATES 末尾;category[0] 仍为科普。
真人感、写实感模板须在 seedream_config 设 photoreal: true。
一致性(seedream_config.consistency_mode):
@@ -14,6 +15,8 @@
模板 default_ratio 仅作画幅默认建议。
"""
+from app.services.templates_seed_huoke import HUOKE_TEMPLATES
+
TEMPLATES: list[dict] = [
{
"id": "opensource_showcase",
@@ -817,3 +820,5 @@ TEMPLATES: list[dict] = [
"is_premium": False,
},
]
+
+TEMPLATES.extend(HUOKE_TEMPLATES)
diff --git a/backend/app/services/templates_seed_huoke.py b/backend/app/services/templates_seed_huoke.py
new file mode 100644
index 0000000..957f9fc
--- /dev/null
+++ b/backend/app/services/templates_seed_huoke.py
@@ -0,0 +1,262 @@
+"""获客短视频模板(并入科普模板库)。
+
+结构来自共创营销 Demo 四平台骨架(小红书 / 抖音 / 点评 / 朋友圈):
+钩子→印象→分点体验→推荐给谁;0–3 秒钩子→画面→1–2 体验→CTA;
+总体评价→环境服务→推荐理由→性价比→适合谁;一句感受→一个细节→轻推荐。
+
+铁律:不编造用户没写的体验;卖点只能客观陈述;不用广告法绝对化用语。
+category[0] 固定为「科普」,便于首页科普筛选;另挂「获客」「商业」。
+sort_order 0–3:创建页「热门推荐」与默认模板会优先落到这四条。
+"""
+
+# 四条模板共用:事实边界 + 人称边界 + 合规(写入 llm_system_addon 前缀)
+HUOKE_IRON_RULES = (
+ "【获客铁律】只使用用户文案里出现的事实;没写到的价格、项目、口感、效果、服务细节一个字都不许编。"
+ "信息不够就写短,绝不用想象补齐。"
+ "【人称边界】第一人称(我试了/我看到/对我们)只能来自用户原文;"
+ "商家卖点只能写成客观陈述(「他们家主打X」),禁止写成「我用了X特别好」。"
+ "用户没提到的卖点不得放进「真实体验」分点。"
+ "【合规】禁止最、第一、国家级、100%、永久、根治等绝对化用语;数字以用户文案为准;"
+ "禁止编造成功率、案例人数、名人背书。"
+ "【名称】用户文案里出现的店名、地址、产品名必须原样保留,禁止改成某店/某品牌;文案没有的名称一律不许编。"
+ "【口播】短句口语,禁止通版广告腔。"
+)
+
+# 叠字:竖屏获客片顶部大字 + 底部口播字幕
+_HUOKE_SUB_SPLIT = {
+ "font": "SourceHanSans",
+ "position": "split",
+ "title_scale": 1.65,
+ "sub_scale": 1.45,
+ "caption_scale": 1.28,
+}
+
+
+def _tpl(
+ *,
+ tid: str,
+ name: str,
+ description: str,
+ style_prefix: str,
+ negative_prompt: str,
+ default_ratio: str,
+ shot_duration_min: int,
+ shot_duration_max: int,
+ structure_addon: str,
+ seedream_config: dict,
+ seedance_config: dict,
+ audio_config: dict,
+ subtitle_config: dict,
+ sort_order: int,
+ photoreal: bool = False,
+ shot_count_min: int = 3,
+ shot_count_max: int = 5,
+) -> dict:
+ """组装一条获客科普模板,字段与 TEMPLATES 条目一致。"""
+ cfg = dict(seedream_config)
+ if photoreal:
+ cfg["photoreal"] = True
+ cfg["shot_count_min"] = shot_count_min
+ cfg["shot_count_max"] = shot_count_max
+ cfg["allow_source_names"] = True
+ return {
+ "id": tid,
+ "name": name,
+ "description": description,
+ "category": ["科普", "获客", "商业"],
+ "preview_cover": f"/static/templates/covers/{tid}.png",
+ "style_prefix": style_prefix,
+ "negative_prompt": negative_prompt,
+ "default_ratio": default_ratio,
+ "shot_duration_min": shot_duration_min,
+ "shot_duration_max": shot_duration_max,
+ "llm_system_addon": HUOKE_IRON_RULES + structure_addon,
+ "seedream_config": cfg,
+ "seedance_config": seedance_config,
+ "audio_config": audio_config,
+ "subtitle_config": subtitle_config,
+ "sort_order": sort_order,
+ "is_active": True,
+ "is_premium": False,
+ }
+
+
+HUOKE_TEMPLATES: list[dict] = [
+ _tpl(
+ tid="huoke_douyin_hook",
+ name="获客·抖音钩子",
+ description="竖屏口播节奏:前 3 秒钩子→场景画面→1–2 个可核验体验→到店/下单号召。适合投放获客。",
+ style_prefix=(
+ "竖屏获客短视频静帧:门店外立面、产品特写、服务动作或操作界面交替出现,"
+ "强对比自然光,主体清晰、留白便于叠大字,电影级产品演示质感,非卡通非动漫"
+ ),
+ negative_prompt=(
+ "卡通,动漫,赛璐璐,二次元,霓虹赛博大屏,任务清单,画面乱码文字,"
+ "字幕水印,logo 乱码,虚假奖杯证书,夸张促销海报堆叠"
+ ),
+ default_ratio="9:16",
+ shot_duration_min=3,
+ shot_duration_max=6,
+ structure_addon=(
+ "这是抖音获客口播片。【分镜数量】按 3–4 镜拆,忽略更长的默认区间;"
+ "事实不够就合并节拍,宁可少镜也不许编。"
+ "节拍:①【0-3秒钩子】反差/悬念/痛点,title 极短;"
+ "②【场景画面】交代在哪、做什么,只写用户文案里有的场景;"
+ "③【核心体验】最多 2 个可核验点,禁止凑满去编;"
+ "④【行动号召】到店/下单/私信的具体下一步,不承诺结果。"
+ "每镜 segments:visual 与 narration 交替;旁白短句能一口气读完;"
+ "title=钩子词,subtitle=卖点客观句,text=口播。"
+ ),
+ seedream_config={
+ "ref_images": [],
+ "strength": 0.72,
+ "consistency_mode": "style",
+ "extra_prompt": (
+ "竖屏主体清晰,顶部与底部留白叠字;各镜构图必须不同;画面内不要出现文字"
+ ),
+ },
+ seedance_config={
+ "motion_bias": "轻微手持推进,产品或门店细节切换",
+ "character_consistency": False,
+ "generate_audio": True,
+ },
+ audio_config={"voice_preset": "urban_editorial", "bgm_mood": "轻快专业"},
+ subtitle_config=dict(_HUOKE_SUB_SPLIT),
+ sort_order=0,
+ photoreal=True,
+ shot_count_min=3,
+ shot_count_max=4,
+ ),
+ _tpl(
+ tid="huoke_xhs_recommend",
+ name="获客·小红书安利",
+ description="竖屏闺蜜安利结构:钩子标题→第一印象→分点真实体验→推荐给谁。封面信息量高、口语化。",
+ style_prefix=(
+ "竖屏生活安利静帧:明亮自然光,浅色桌面或门店角落,产品/空间细节清楚,"
+ "杂志封面气质、留白分层,适合叠标题,非浓妆棚拍、非卡通"
+ ),
+ negative_prompt=(
+ "阴暗脏乱,赛博霓虹,卡通动漫,硬广海报堆字,假抠图,水印乱码"
+ ),
+ default_ratio="9:16",
+ shot_duration_min=4,
+ shot_duration_max=8,
+ structure_addon=(
+ "这是小红书获客安利片。【分镜数量】按 3–5 镜拆,忽略更长的默认区间;"
+ "事实不够就少镜,禁止编体验凑镜。"
+ "节拍:①钩子标题(情绪或反差,不像广告);"
+ "②我为什么来 / 第一印象(只来自用户原文);"
+ "③分点真实体验(每镜一个细节);"
+ "④推荐给谁 / 值不值得(场景来自文案,给不出就客观收束)。"
+ "口播像跟闺蜜说话;title 短、subtitle 带一个具体细节。"
+ "每镜 segments:visual 与 narration 交替。"
+ ),
+ seedream_config={
+ "ref_images": [],
+ "strength": 0.7,
+ "consistency_mode": "style",
+ "extra_prompt": "明亮竖屏,顶部大留白叠标题,画面内不要出现文字,各镜场景不同",
+ },
+ seedance_config={
+ "motion_bias": "缓慢平移与轻微推近细节",
+ "character_consistency": False,
+ "generate_audio": True,
+ },
+ audio_config={"voice_preset": "warm_storyteller", "bgm_mood": "温暖人文"},
+ subtitle_config=dict(_HUOKE_SUB_SPLIT),
+ sort_order=1,
+ photoreal=True,
+ shot_count_min=3,
+ shot_count_max=5,
+ ),
+ _tpl(
+ tid="huoke_review_facts",
+ name="获客·口碑拆解",
+ description="横屏客观详实:总体评价→环境/服务→推荐项+理由→性价比→适合谁。帮别人做决策,不抒情。",
+ style_prefix=(
+ "干净讲解静帧:浅色桌面或门店信息分区,产品/空间/价目氛围(无可读文字),"
+ "信息层级清楚、光线均匀,纪录片式克制,非卡通非霓虹"
+ ),
+ negative_prompt=(
+ "卡通,动漫,夸张表情包,霓虹赛博,假证书奖杯,画面乱码文字,促销爆炸贴"
+ ),
+ default_ratio="16:9",
+ shot_duration_min=5,
+ shot_duration_max=10,
+ structure_addon=(
+ "这是口碑/点评式获客讲解片。【分镜数量】按 3–5 镜拆,忽略更长的默认区间;"
+ "没写到的栏目直接跳过,禁止编事实凑镜。"
+ "节拍:①总体评价一句话(来自用户文案,禁止自行打分);"
+ "②环境或服务(只写提到的);"
+ "③推荐项+具体理由(理由必须来自原文);"
+ "④人均与性价比(用户没写价格就不要猜,改讲「怎么选」);"
+ "⑤适合场景与结论(给谁来、不适合谁,不承诺效果)。"
+ "旁白像认真写评价,信息密度高、少形容词。"
+ "每镜 segments:visual 与 narration 交替;title=栏目名,subtitle=可核验短句。"
+ ),
+ seedream_config={
+ "ref_images": [],
+ "strength": 0.7,
+ "consistency_mode": "style",
+ "extra_prompt": "横屏讲解构图,左右或上下留白叠字,画面内不要出现文字,各镜明显不同",
+ },
+ seedance_config={
+ "motion_bias": "缓慢推近产品或空间细节",
+ "character_consistency": False,
+ "generate_audio": True,
+ },
+ audio_config={"voice_preset": "narrator_calm", "bgm_mood": "冷静纪实"},
+ subtitle_config={
+ "font": "SourceHanSans",
+ "position": "split",
+ "title_scale": 1.5,
+ "sub_scale": 1.35,
+ "caption_scale": 1.2,
+ },
+ sort_order=2,
+ photoreal=True,
+ shot_count_min=3,
+ shot_count_max=5,
+ ),
+ _tpl(
+ tid="huoke_soft_invite",
+ name="获客·熟人轻推",
+ description="竖屏生活化短片:一句真实感受→一个具体细节→一句轻推荐。克制、不像广告,适合转发给熟人。",
+ style_prefix=(
+ "竖屏生活纪实静帧:窗光、街角、桌面一角或门店日常,暖色克制,"
+ "真实材质与皮肤,像随手拍的一张,非棚拍硬广、非卡通"
+ ),
+ negative_prompt=(
+ "棚拍浓妆,硬广海报,卡通动漫,霓虹赛博,假笑模特,水印乱码,爆炸贴"
+ ),
+ default_ratio="9:16",
+ shot_duration_min=4,
+ shot_duration_max=8,
+ structure_addon=(
+ "这是朋友圈/熟人获客短片。【分镜数量】按 2–3 镜拆,忽略更长的默认区间;更短更好。"
+ "节拍:①一句真实感受(尽量靠近用户原话语感);"
+ "②一个具体细节或画面(只取文案里最具体的那一点);"
+ "③可选轻推荐(想来可以问我 / 自己去看看),不要强 CTA、不要优惠堆砌。"
+ "不加话题标签腔;emoji 不要写进旁白。"
+ "每镜 segments:visual 与 narration 交替;title 极短或不抢戏。"
+ ),
+ seedream_config={
+ "ref_images": [],
+ "strength": 0.72,
+ "consistency_mode": "style",
+ "character_prompt": "生活感路人视角,可露侧脸或只出手部与场景,着装日常,全片气质统一",
+ "extra_prompt": "暖色窗光,竖屏生活感,顶部可留白,画面内不要出现文字",
+ },
+ seedance_config={
+ "motion_bias": "轻微手持呼吸感,缓慢平移",
+ "character_consistency": False,
+ "generate_audio": True,
+ },
+ audio_config={"voice_preset": "warm_storyteller", "bgm_mood": "温暖人文"},
+ subtitle_config={"font": "SourceHanSans", "position": "top", "caption_scale": 1.25},
+ sort_order=3,
+ photoreal=True,
+ shot_count_min=2,
+ shot_count_max=3,
+ ),
+]
diff --git a/backend/app/services/tokenfree_audio.py b/backend/app/services/tokenfree_audio.py
index d5891d2..b3c5715 100644
--- a/backend/app/services/tokenfree_audio.py
+++ b/backend/app/services/tokenfree_audio.py
@@ -1,11 +1,33 @@
-"""TokenFree / New API 语音:OpenAI 兼容 POST /v1/audio/speech。"""
+"""TokenFree / New API 语音:Qwen-TTS 的 /audio/speech 未实现,改走 Omni 流式 chat。"""
from __future__ import annotations
+import base64
+import json
+import struct
+from typing import Any
+
from app.services.tokenfree_gateway import TOKENFREE_CHANNEL_ID
-# 账号目录里实际有的 TTS;seed-tts-2.0 不在 TokenFree 价目/渠道中
+# 管理端逻辑名仍是 qwen-tts;真正发请求时改打 Omni(Ali ConvertAudioRequest 未实现)
TOKENFREE_DEFAULT_TTS_MODEL = "qwen-tts-2025-05-22"
+TOKENFREE_OMNI_TTS_MODEL = "qwen3-omni-flash"
+
+# 配音时按顺序试:管理端默认模型优先,其余作同渠道兜底
+TOKENFREE_TTS_FALLBACKS: tuple[str, ...] = (
+ "qwen-tts-2025-05-22",
+ "qwen3-omni-flash",
+ "qwen3-tts-flash",
+ "gemini-3.1-flash-tts",
+ "gemini-2.5-pro-preview-tts",
+ "elevenlabs-tts",
+ "elevenlabs/text-to-speech-multilingual-v2",
+)
+
+# Omni 流式口播:禁止改写原文
+TOKENFREE_OMNI_TTS_SYSTEM = "你是语音合成器。只朗读用户给出的原文,禁止改写、解释或添加任何额外句子。"
+# Omni 流式 PCM 实测为 24 kHz / 16-bit / mono
+TOKENFREE_OMNI_PCM_RATE = 24000
_SEED_TTS_MARKERS = ("seed-tts",)
@@ -23,7 +45,7 @@ def uses_tokenfree_audio(*, base_url: str = "", channel_id: str = "") -> bool:
def resolve_tokenfree_tts_model(model: str | None) -> str:
- """把已下线的 seed-tts 换成目录内 Qwen TTS。"""
+ """把已下线的 seed-tts 换成目录内默认 Qwen TTS。"""
mid = (model or "").strip()
low = mid.lower()
if not mid or any(mark in low for mark in _SEED_TTS_MARKERS):
@@ -31,6 +53,44 @@ def resolve_tokenfree_tts_model(model: str | None) -> str:
return mid
+def tokenfree_tts_chat_model(model: str) -> str:
+ """qwen-tts 在 TokenFree 阿里渠道上 /audio/speech 未实现,改打 Omni 流式 chat。"""
+ low = (model or "").casefold()
+ if "qwen-tts" in low:
+ return TOKENFREE_OMNI_TTS_MODEL
+ return model
+
+
+def iter_tokenfree_tts_models(preferred: str | None) -> list[str]:
+ """默认语音模型 + TokenFree 目录里其它 TTS,去重保序;qwen-tts 折叠成 Omni。"""
+ seen: set[str] = set()
+ out: list[str] = []
+ for raw in (preferred, *TOKENFREE_TTS_FALLBACKS):
+ mid = tokenfree_tts_chat_model(resolve_tokenfree_tts_model(raw))
+ key = mid.casefold()
+ if not mid or key in seen:
+ continue
+ seen.add(key)
+ out.append(mid)
+ return out
+
+
+def tokenfree_tts_uses_chat_audio(model: str) -> bool:
+ """Gemini TTS / Qwen-TTS / Qwen-Omni 都走 chat 出音频,不要打 /audio/speech。"""
+ low = (model or "").casefold()
+ if "gemini" in low and "tts" in low:
+ return True
+ if "qwen-tts" in low:
+ return True
+ return "omni" in low
+
+
+def tokenfree_tts_uses_omni_stream(model: str) -> bool:
+ """Qwen-Omni 必须 stream + modalities audio,非流式会缺 input.text 或不出声。"""
+ low = (model or "").casefold()
+ return "omni" in low or "qwen-tts" in low
+
+
# qwen-tts 实际认的音色名;豆包 zh_* / S_ 不在此列
_TOKENFREE_NATIVE_VOICES = frozenset({"Cherry", "Serena", "Ethan", "Chelsie", "alloy"})
_TOKENFREE_NATIVE_VOICES_FOLD = {v.casefold(): v for v in _TOKENFREE_NATIVE_VOICES}
@@ -41,13 +101,159 @@ def tokenfree_speech_honors_speaker(speaker: str) -> bool:
return (speaker or "").strip().casefold() in _TOKENFREE_NATIVE_VOICES_FOLD
-def tokenfree_speech_voice(speaker: str) -> str:
- """豆包 speaker id → Qwen/OpenAI 兼容音色。"""
+def _speaker_is_male(speaker: str) -> bool:
+ """豆包 speaker id / 英文音色名是否按男声映射。"""
+ low = (speaker or "").strip().lower()
+ return low.startswith("zh_male") or "_male_" in low
+
+
+def tokenfree_speech_voice(speaker: str, model: str = "") -> str:
+ """豆包 speaker id → 当前 TTS 模型能认的音色。"""
raw = (speaker or "").strip()
native = _TOKENFREE_NATIVE_VOICES_FOLD.get(raw.casefold())
+ mid = (model or "").casefold()
+ if native and "gemini" not in mid and "eleven" not in mid:
+ return native
+ male = _speaker_is_male(raw)
+ if "gemini" in mid:
+ return "Puck" if male else "Kore"
+ if "eleven" in mid:
+ return "Adam" if male else "Rachel"
if native:
return native
- low = raw.lower()
- if low.startswith("zh_male") or "_male_" in low:
- return "Ethan"
- return "Cherry"
+ return "Ethan" if male else "Cherry"
+
+
+def extract_chat_audio_bytes(payload: dict[str, Any]) -> bytes | None:
+ """从 chat/completions 或 DashScope 包里取出音频字节。"""
+ if not isinstance(payload, dict):
+ return None
+ choices = payload.get("choices")
+ if isinstance(choices, list) and choices:
+ msg = choices[0].get("message") if isinstance(choices[0], dict) else None
+ if isinstance(msg, dict):
+ got = _audio_bytes_from_obj(msg.get("audio"))
+ if got:
+ return got
+ got = _audio_bytes_from_obj(msg.get("content"))
+ if got:
+ return got
+ output = payload.get("output")
+ if isinstance(output, dict):
+ got = _audio_bytes_from_obj(output.get("audio"))
+ if got:
+ return got
+ return _audio_bytes_from_obj(payload.get("audio") or payload.get("data"))
+
+
+def _audio_bytes_from_obj(raw: Any) -> bytes | None:
+ """解析 base64 / data URL / 嵌套 data 字段。"""
+ if isinstance(raw, str) and raw.strip():
+ text = raw.strip()
+ if text.startswith("data:") and "," in text:
+ text = text.split(",", 1)[1]
+ try:
+ data = base64.b64decode(text, validate=False)
+ except Exception: # noqa: BLE001
+ return None
+ return data if len(data) >= 1000 else None
+ if isinstance(raw, dict):
+ for key in ("data", "b64_json", "audio"):
+ got = _audio_bytes_from_obj(raw.get(key))
+ if got:
+ return got
+ return None
+
+
+def _decode_audio_chunk(raw: Any) -> bytes:
+ """SSE 分片可能远小于 1KB,这里不按整段音频门槛丢弃。"""
+ if isinstance(raw, str) and raw.strip():
+ text = raw.strip()
+ if text.startswith("data:") and "," in text:
+ text = text.split(",", 1)[1]
+ try:
+ return base64.b64decode(text, validate=False)
+ except Exception: # noqa: BLE001
+ return b""
+ if isinstance(raw, dict):
+ for key in ("data", "b64_json", "audio"):
+ got = _decode_audio_chunk(raw.get(key))
+ if got:
+ return got
+ return b""
+
+
+def extract_sse_audio_bytes(raw: str) -> bytes | None:
+ """从 Omni / chat SSE 里拼接 delta.audio.data。"""
+ chunks: list[bytes] = []
+ for line in (raw or "").splitlines():
+ line = line.strip()
+ if not line.startswith("data:"):
+ continue
+ payload = line[5:].strip()
+ if not payload or payload == "[DONE]":
+ continue
+ try:
+ obj = json.loads(payload)
+ except Exception: # noqa: BLE001
+ continue
+ if not isinstance(obj, dict):
+ continue
+ if isinstance(obj.get("error"), dict) and not chunks:
+ return None
+ for choice in obj.get("choices") or []:
+ if not isinstance(choice, dict):
+ continue
+ delta = choice.get("delta") if isinstance(choice.get("delta"), dict) else {}
+ message = choice.get("message") if isinstance(choice.get("message"), dict) else {}
+ blob = _decode_audio_chunk((delta or {}).get("audio") or (message or {}).get("audio"))
+ if blob:
+ chunks.append(blob)
+ joined = b"".join(chunks)
+ return joined if len(joined) >= 1000 else None
+
+
+def _looks_like_mpeg(raw: bytes) -> bool:
+ """识别无 ID3 的 MP3 帧头(含 \\xff\\xfa 等)。"""
+ return len(raw) >= 2 and raw[0] == 0xFF and (raw[1] & 0xE0) == 0xE0
+
+
+def wrap_pcm_s16le_wav(pcm: bytes, *, sample_rate: int = TOKENFREE_OMNI_PCM_RATE, channels: int = 1) -> bytes:
+ """把 Omni 流式 PCM 包成 WAV;已是 RIFF/MP3 则原样返回。"""
+ if len(pcm) < 1000:
+ return b""
+ if pcm[:4] == b"RIFF" or pcm[:3] == b"ID3" or _looks_like_mpeg(pcm):
+ return pcm
+ byte_rate = sample_rate * channels * 2
+ header = struct.pack(
+ "<4sI4s4sIHHIIHH4sI",
+ b"RIFF",
+ 36 + len(pcm),
+ b"WAVE",
+ b"fmt ",
+ 16,
+ 1,
+ channels,
+ sample_rate,
+ byte_rate,
+ channels * 2,
+ 16,
+ b"data",
+ len(pcm),
+ )
+ return header + pcm
+
+
+def build_omni_tts_chat_body(text: str, voice: str, model: str) -> dict[str, Any]:
+ """构造 Qwen-Omni 流式配音请求体。"""
+ return {
+ "model": model,
+ "messages": [
+ {"role": "system", "content": TOKENFREE_OMNI_TTS_SYSTEM},
+ {"role": "user", "content": text},
+ ],
+ "modalities": ["text", "audio"],
+ "audio": {"voice": voice, "format": "wav"},
+ "stream": True,
+ "stream_options": {"include_usage": True},
+ }
diff --git a/backend/app/services/tokenfree_pricing.py b/backend/app/services/tokenfree_pricing.py
index 3f61900..10c3b9c 100644
--- a/backend/app/services/tokenfree_pricing.py
+++ b/backend/app/services/tokenfree_pricing.py
@@ -106,6 +106,27 @@ RECOMMENDED_MODELS: tuple[dict[str, Any], ...] = (
"note": "更快更便宜的备选",
"recommended": False,
},
+ {
+ "id": "qwen-tts-2025-05-22",
+ "capability": "audio",
+ "label": "Qwen TTS",
+ "note": "默认配音逻辑名;Ali /audio/speech 未实现,实际走 qwen3-omni-flash 流式 chat",
+ "recommended": True,
+ },
+ {
+ "id": "gemini-3.1-flash-tts",
+ "capability": "audio",
+ "label": "Gemini 3.1 Flash TTS",
+ "note": "TokenFree 目录备选配音",
+ "recommended": True,
+ },
+ {
+ "id": "elevenlabs-tts",
+ "capability": "audio",
+ "label": "ElevenLabs TTS",
+ "note": "TokenFree 目录备选配音",
+ "recommended": False,
+ },
)
_cache: dict[str, "OfficialRate"] | None = None
diff --git a/backend/static/site/wechat_group_qr.png b/backend/static/site/wechat_group_qr.png
new file mode 100644
index 0000000..7df87c9
Binary files /dev/null and b/backend/static/site/wechat_group_qr.png differ
diff --git a/backend/static/templates/covers/huoke_douyin_hook.png b/backend/static/templates/covers/huoke_douyin_hook.png
new file mode 100644
index 0000000..5d4556a
Binary files /dev/null and b/backend/static/templates/covers/huoke_douyin_hook.png differ
diff --git a/backend/static/templates/covers/huoke_review_facts.png b/backend/static/templates/covers/huoke_review_facts.png
new file mode 100644
index 0000000..54cf729
Binary files /dev/null and b/backend/static/templates/covers/huoke_review_facts.png differ
diff --git a/backend/static/templates/covers/huoke_soft_invite.png b/backend/static/templates/covers/huoke_soft_invite.png
new file mode 100644
index 0000000..a720983
Binary files /dev/null and b/backend/static/templates/covers/huoke_soft_invite.png differ
diff --git a/backend/static/templates/covers/huoke_xhs_recommend.png b/backend/static/templates/covers/huoke_xhs_recommend.png
new file mode 100644
index 0000000..21e9def
Binary files /dev/null and b/backend/static/templates/covers/huoke_xhs_recommend.png differ
diff --git a/backend/tests/test_huoke_templates.py b/backend/tests/test_huoke_templates.py
new file mode 100644
index 0000000..3171b9e
--- /dev/null
+++ b/backend/tests/test_huoke_templates.py
@@ -0,0 +1,58 @@
+"""获客科普模板:四平台结构 + 不编造体验铁律。"""
+
+from types import SimpleNamespace
+
+from app.services.ark import storyboard_name_policy
+from app.services.style_lock import template_allow_source_names, template_shot_range
+from app.services.templates_seed import TEMPLATES
+from app.services.templates_seed_huoke import HUOKE_IRON_RULES, HUOKE_TEMPLATES
+
+HUOKE_IDS = (
+ "huoke_douyin_hook",
+ "huoke_xhs_recommend",
+ "huoke_review_facts",
+ "huoke_soft_invite",
+)
+
+
+def test_huoke_templates_registered_in_seed():
+ by_id = {t["id"]: t for t in TEMPLATES}
+ for tid in HUOKE_IDS:
+ assert tid in by_id, tid
+ item = by_id[tid]
+ assert item["category"][0] == "科普"
+ assert "获客" in item["category"]
+ assert "商业" in item["category"]
+ assert item["llm_system_addon"].startswith(HUOKE_IRON_RULES)
+ assert "店名" in item["llm_system_addon"]
+ assert item["preview_cover"].endswith(f"{tid}.png")
+ cfg = item["seedream_config"]
+ assert cfg.get("photoreal") is True
+ assert cfg.get("allow_source_names") is True
+ assert cfg.get("consistency_mode") == "style"
+ assert cfg.get("shot_count_min") >= 2
+ assert cfg["shot_count_max"] >= cfg["shot_count_min"]
+
+
+def test_huoke_platform_structures_are_distinct():
+ addons = {t["id"]: t["llm_system_addon"] for t in HUOKE_TEMPLATES}
+ assert "0-3秒钩子" in addons["huoke_douyin_hook"]
+ assert "第一印象" in addons["huoke_xhs_recommend"]
+ assert "性价比" in addons["huoke_review_facts"]
+ assert "轻推荐" in addons["huoke_soft_invite"]
+ assert "必须 4 镜" not in addons["huoke_douyin_hook"]
+ assert addons["huoke_douyin_hook"] != addons["huoke_xhs_recommend"]
+
+
+def test_huoke_shot_range_and_names_wire_into_pipeline_helpers():
+ tpl = SimpleNamespace(seedream_config=HUOKE_TEMPLATES[0]["seedream_config"])
+ assert template_shot_range(tpl) == (3, 4)
+ assert template_allow_source_names(tpl) is True
+ assert template_shot_range(SimpleNamespace(seedream_config={})) is None
+ assert "原样保留" in storyboard_name_policy(True)
+ assert "改用泛称" in storyboard_name_policy(False)
+
+
+def test_template_ids_unique():
+ ids = [t["id"] for t in TEMPLATES]
+ assert len(ids) == len(set(ids))
diff --git a/backend/tests/test_media_catalog_validation.py b/backend/tests/test_media_catalog_validation.py
index 7e0dcbf..43a2fb4 100644
--- a/backend/tests/test_media_catalog_validation.py
+++ b/backend/tests/test_media_catalog_validation.py
@@ -26,6 +26,10 @@ def test_tokenfree_style_ids_infer_capability():
assert infer_model_capability("kie-veo3-fast") == "video"
assert infer_model_capability("kie-seedream-5") == "image"
assert infer_model_capability("nano-banana-2") == "image"
+ assert infer_model_capability("qwen-tts-2025-05-22") == "audio"
+ assert infer_model_capability("gemini-3.1-flash-tts") == "audio"
+ assert infer_model_capability("elevenlabs/text-to-speech-multilingual-v2") == "audio"
+ assert infer_model_capability("elevenlabs-tts") == "audio"
def test_catalog_payload_uses_tokenfree_routing() -> None:
diff --git a/backend/tests/test_site_wechat_qr.py b/backend/tests/test_site_wechat_qr.py
new file mode 100644
index 0000000..502a3af
--- /dev/null
+++ b/backend/tests/test_site_wechat_qr.py
@@ -0,0 +1,91 @@
+"""Public site-config + admin WeChat QR upload."""
+
+from __future__ import annotations
+
+from unittest.mock import AsyncMock, patch
+
+import pytest
+from fastapi import FastAPI
+from fastapi.testclient import TestClient
+
+from app.api import site as site_api
+from app.api.admin import settings as admin_settings
+from app.config import Settings, get_settings
+from app.database import get_db
+from app.deps import get_current_admin
+from app.schemas_settings import AdminModelSettingsOut
+
+
+def _minimal_png() -> bytes:
+ # 1x1 PNG
+ return (
+ b"\x89PNG\r\n\x1a\n\x00\x00\x00\rIHDR\x00\x00\x00\x01\x00\x00\x00\x01"
+ b"\x08\x02\x00\x00\x00\x90wS\xde\x00\x00\x00\x0cIDATx\x9cc\xf8\x0f\x00"
+ b"\x00\x01\x01\x00\x05\x18\xd8N\x00\x00\x00\x00IEND\xaeB`\x82"
+ )
+
+
+def site_app(tmp_path, monkeypatch):
+ """挂载公开 site-config + 管理端上传(鉴权与 DB 打桩)。"""
+ from app.services import storage
+
+ monkeypatch.setattr(storage, "STATIC_ROOT", tmp_path)
+ (tmp_path / "site").mkdir(parents=True, exist_ok=True)
+
+ def fake_settings() -> Settings:
+ return Settings(wechat_group_qr_url="/static/site/wechat_group_qr.png")
+
+ get_settings.cache_clear()
+ monkeypatch.setattr("app.api.site.get_settings", fake_settings)
+
+ app = FastAPI()
+ app.include_router(site_api.router, prefix="/api")
+ app.include_router(admin_settings.router, prefix="/api/admin")
+
+ async def _admin():
+ return type("U", (), {"id": 1, "role": "admin"})()
+
+ async def _db():
+ yield AsyncMock()
+
+ app.dependency_overrides[get_current_admin] = _admin
+ app.dependency_overrides[get_db] = _db
+
+ yield app
+ get_settings.cache_clear()
+ app.dependency_overrides.clear()
+
+
+def test_site_config_returns_qr_url(site_app):
+ client = TestClient(site_app)
+ res = client.get("/api/site-config")
+ assert res.status_code == 200
+ assert res.json()["wechat_group_qr_url"] == "/static/site/wechat_group_qr.png"
+
+
+def test_admin_upload_wechat_qr(site_app, tmp_path):
+ fake_out = AdminModelSettingsOut(
+ wechat_group_qr_url="/static/site/wechat_group_qr.png?v=1",
+ source="db",
+ )
+
+ async def _patch(_db, body):
+ assert body.wechat_group_qr_url
+ assert "wechat_group_qr" in body.wechat_group_qr_url
+ return fake_out, ["wechat_group_qr_url"]
+
+ with patch("app.api.admin.settings.patch_admin_model_settings", new=_patch), patch(
+ "app.api.admin.settings.storage.publish_local",
+ return_value="/static/site/wechat_group_qr.png",
+ ):
+ client = TestClient(site_app)
+ res = client.post(
+ "/api/admin/settings/site/wechat-group-qr",
+ files={"file": ("qr.png", _minimal_png(), "image/png")},
+ )
+ assert res.status_code == 200, res.text
+ data = res.json()
+ assert data["ok"] is True
+ assert data["wechat_group_qr_url"].startswith("/static/site/wechat_group_qr.png")
+ assert (tmp_path / "site" / "wechat_group_qr.png").is_file()
diff --git a/backend/tests/test_tokenfree_audio.py b/backend/tests/test_tokenfree_audio.py
index 2ecd43b..964d940 100644
--- a/backend/tests/test_tokenfree_audio.py
+++ b/backend/tests/test_tokenfree_audio.py
@@ -1,10 +1,19 @@
"""TokenFree 音频路由检测。"""
+import base64
+
from app.services.tokenfree_audio import (
+ extract_chat_audio_bytes,
+ extract_sse_audio_bytes,
+ iter_tokenfree_tts_models,
resolve_tokenfree_tts_model,
tokenfree_speech_honors_speaker,
tokenfree_speech_voice,
+ tokenfree_tts_chat_model,
+ tokenfree_tts_uses_chat_audio,
+ tokenfree_tts_uses_omni_stream,
uses_tokenfree_audio,
+ wrap_pcm_s16le_wav,
)
from app.services.tokenfree_gateway import TOKENFREE_BASE_URL, TOKENFREE_CHANNEL_ID
@@ -25,6 +34,8 @@ def test_tokenfree_speech_voice_gender():
assert tokenfree_speech_voice("zh_female_cancan_uranus_bigtts") == "Cherry"
assert tokenfree_speech_voice("zh_male_shaonianzixin_uranus_bigtts") == "Ethan"
assert tokenfree_speech_voice("Cherry") == "Cherry"
+ assert tokenfree_speech_voice("zh_female_cancan_uranus_bigtts", "gemini-3.1-flash-tts") == "Kore"
+ assert tokenfree_speech_voice("zh_male_shaonianzixin_uranus_bigtts", "elevenlabs-tts") == "Adam"
def test_tokenfree_speech_does_not_honor_doubao_ids():
@@ -32,3 +43,56 @@ def test_tokenfree_speech_does_not_honor_doubao_ids():
assert tokenfree_speech_honors_speaker("ethan") is True
assert tokenfree_speech_honors_speaker("zh_male_shaonianzixin_uranus_bigtts") is False
assert tokenfree_speech_honors_speaker("S_abc") is False
+
+
+def test_iter_tokenfree_tts_models_puts_preferred_first():
+ models = iter_tokenfree_tts_models("gemini-3.1-flash-tts")
+ assert models[0] == "gemini-3.1-flash-tts"
+ assert "qwen3-omni-flash" in models
+ assert "qwen-tts-2025-05-22" not in models
+ assert "elevenlabs-tts" in models
+ assert models.count("gemini-3.1-flash-tts") == 1
+ assert models.count("qwen3-omni-flash") == 1
+
+
+def test_qwen_tts_is_remapped_to_omni_chat():
+ assert tokenfree_tts_chat_model("qwen-tts-2025-05-22") == "qwen3-omni-flash"
+ assert iter_tokenfree_tts_models("qwen-tts-2025-05-22")[0] == "qwen3-omni-flash"
+ assert tokenfree_tts_uses_chat_audio("qwen-tts-2025-05-22") is True
+ assert tokenfree_tts_uses_omni_stream("qwen3-omni-flash") is True
+
+
+def test_tokenfree_tts_uses_chat_audio_for_gemini():
+ assert tokenfree_tts_uses_chat_audio("gemini-3.1-flash-tts") is True
+ assert tokenfree_tts_uses_chat_audio("qwen3-omni-flash") is True
+
+
+def test_extract_chat_audio_bytes_from_message():
+ blob = base64.b64encode(b"a" * 1200).decode("ascii")
+ got = extract_chat_audio_bytes({"choices": [{"message": {"audio": {"data": blob}}}]})
+ assert got == b"a" * 1200
+
+
+def test_extract_sse_audio_bytes_concatenates_chunks():
+ part = base64.b64encode(b"a" * 600).decode("ascii")
+ raw = (
+ 'data: {"choices":[{"delta":{"audio":{"data":"%s"}}}]}\n\n'
+ 'data: {"choices":[{"delta":{"audio":{"data":"%s"}}}]}\n\n'
+ "data: [DONE]\n"
+ ) % (part, part)
+ got = extract_sse_audio_bytes(raw)
+ assert got == b"a" * 1200
+
+
+def test_extract_sse_audio_bytes_drops_error_stream():
+ raw = 'data: {"error":{"message":"Field required: input.text"}}\n\n'
+ assert extract_sse_audio_bytes(raw) is None
+
+
+def test_wrap_pcm_s16le_wav_adds_riff_header():
+ pcm = b"\x00\x01" * 600
+ wav = wrap_pcm_s16le_wav(pcm)
+ assert wav.startswith(b"RIFF")
+ assert wav[8:12] == b"WAVE"
+ assert wav.endswith(pcm)
+
diff --git a/backend/tests/test_tokenfree_pricing.py b/backend/tests/test_tokenfree_pricing.py
index f42c2ee..ec31f05 100644
--- a/backend/tests/test_tokenfree_pricing.py
+++ b/backend/tests/test_tokenfree_pricing.py
@@ -61,12 +61,12 @@ def test_parse_pricing_payload_per_call_and_token() -> None:
assert video.placeholder is True
-def test_recommended_models_cover_text_image_video() -> None:
- """短名单覆盖文字/图/视频,且含默认推荐;不含 TokenFree 不可用的 Seedream。"""
+def test_recommended_models_cover_text_image_video_audio() -> None:
+ """短名单覆盖文字/图/视频/语音,且含默认推荐;不含 TokenFree 不可用的 Seedream。"""
caps = {row["capability"] for row in RECOMMENDED_MODELS}
- assert caps == {"text", "image", "video"}
+ assert caps == {"text", "image", "video", "audio"}
ids = {row["id"] for row in RECOMMENDED_MODELS}
- assert {"kimi-k2.6", "gpt-image-2-5", "seedance-2-5", "seedance-2-0"} <= ids
+ assert {"kimi-k2.6", "gpt-image-2-5", "seedance-2-5", "seedance-2-0", "qwen-tts-2025-05-22", "gemini-3.1-flash-tts"} <= ids
assert "seedream-5-0-pro" not in ids
assert any(row["recommended"] and row["id"] == "kimi-k2.6" for row in RECOMMENDED_MODELS)
diff --git a/backend/tests/test_tts_tokenfree_fallback.py b/backend/tests/test_tts_tokenfree_fallback.py
index b68c897..63821ab 100644
--- a/backend/tests/test_tts_tokenfree_fallback.py
+++ b/backend/tests/test_tts_tokenfree_fallback.py
@@ -45,8 +45,45 @@ async def test_tts_tokenfree_falls_back_to_edge(tmp_path: Path, monkeypatch: pyt
silence.assert_not_called()
-async def test_tts_skips_qwen_for_doubao_speaker(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
- """豆包 zh_male_* 不能先走 qwen(会全员 Ethan),应直接 edge-tts。"""
+async def test_tts_tokenfree_qwen_skips_speech_endpoint(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ """qwen-tts 不得再打 /audio/speech,应直接走 Omni chat。"""
+ gw = ArkGateway(settings=_tts_settings())
+ monkeypatch.setattr("app.services.storage.project_dir", lambda _pid: tmp_path)
+ monkeypatch.setattr("app.services.storage.publish_local", lambda p: f"/static/{Path(p).name}")
+ monkeypatch.setattr(gw, "_ark_api_key", lambda: "sk-test")
+ monkeypatch.setattr(gw, "_tts_openspeech", AsyncMock(return_value=False))
+ monkeypatch.setattr("app.services.ark.is_near_silent_audio", lambda _p: False)
+ captured: dict = {}
+
+ async def fake_chat(text: str, voice: str, dest_path, *, model=None):
+ dest_path.write_bytes(b"a" * 4000)
+ captured["model"] = model
+ captured["voice"] = voice
+ return True
+
+ chat = AsyncMock(side_effect=fake_chat)
+ monkeypatch.setattr(gw, "_tts_openai_chat_audio", chat)
+
+ class BoomClient:
+ def __init__(self, *args, **kwargs):
+ raise AssertionError("qwen-tts must not open HTTP for /audio/speech")
+
+ async def __aenter__(self):
+ return self
+
+ async def __aexit__(self, *args):
+ return False
+
+ monkeypatch.setattr("app.services.ark.httpx.AsyncClient", BoomClient)
+
+ url = await gw.tts("你好。", "narrator_calm", project_id=1, shot_no=2)
+ assert url.endswith("shot_002_tts.mp3")
+ chat.assert_called()
+ assert captured.get("model") == "qwen3-omni-flash"
+
+
+async def test_tts_tokenfree_tried_before_edge_for_doubao_speaker(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ """豆包 speaker 也会走 TokenFree 多模型;成功则不再落到 edge-tts。"""
gw = ArkGateway(settings=_tts_settings())
monkeypatch.setattr("app.services.storage.project_dir", lambda _pid: tmp_path)
monkeypatch.setattr("app.services.storage.publish_local", lambda p: f"/static/{Path(p).name}")
@@ -56,11 +93,13 @@ async def test_tts_skips_qwen_for_doubao_speaker(tmp_path: Path, monkeypatch: py
monkeypatch.setattr(gw, "_tts_openai_speech", speech)
monkeypatch.setattr("app.services.ark.is_near_silent_audio", lambda _p: False)
- async def fake_edge(text: str, dest: Path, voice_hint: str = "") -> None:
- dest.parent.mkdir(parents=True, exist_ok=True)
- dest.write_bytes(b"a" * 4000)
+ async def fake_speech(text: str, voice: str, dest_path, *, model=None):
+ dest_path.write_bytes(b"a" * 4000)
+ return True
- monkeypatch.setattr(gw, "_tts_edge", fake_edge)
+ speech.side_effect = fake_speech
+ edge = AsyncMock()
+ monkeypatch.setattr(gw, "_tts_edge", edge)
url = await gw.tts(
"你好。",
@@ -69,7 +108,8 @@ async def test_tts_skips_qwen_for_doubao_speaker(tmp_path: Path, monkeypatch: py
shot_no=3,
)
assert url.endswith("shot_003_tts.mp3")
- speech.assert_not_called()
+ speech.assert_called()
+ edge.assert_not_called()
async def test_tts_raises_when_all_providers_fail(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
@@ -90,3 +130,26 @@ async def test_tts_raises_when_all_providers_fail(tmp_path: Path, monkeypatch: p
with pytest.raises(RuntimeError, match="配音失败"):
await gw.tts("你好。", "narrator_calm", project_id=1, shot_no=0)
silence.assert_not_called()
+
+
+async def test_tts_edge_lengthens_connect_timeout(tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
+ """国内握手慢,edge-tts 必须把 connect_timeout 拉到 30 秒。"""
+ import edge_tts
+
+ captured: dict = {}
+
+ class FakeCommunicate:
+ def __init__(self, text: str, voice: str, **kwargs):
+ captured.update(kwargs)
+ captured["text"] = text
+ captured["voice"] = voice
+
+ async def save(self, path: str) -> None:
+ Path(path).write_bytes(b"x" * 3000)
+
+ monkeypatch.setattr(edge_tts, "Communicate", FakeCommunicate)
+ gw = ArkGateway(settings=_tts_settings())
+ dest = tmp_path / "shot.mp3"
+ await gw._tts_edge("你好。", dest, voice_hint="narrator_calm")
+ assert captured.get("connect_timeout") == 30
+ assert dest.stat().st_size == 3000
diff --git a/docs/images/wechat-group-qr.png b/docs/images/wechat-group-qr.png
new file mode 100644
index 0000000..7df87c9
Binary files /dev/null and b/docs/images/wechat-group-qr.png differ
diff --git a/frontend/index.html b/frontend/index.html
index ff0eb32..0619a70 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -5,7 +5,7 @@
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>PRINTFILM · AI短视频平台</title>
- <meta name="description" content="PRINTFILM AI短视频平台:输入主题与风格,自动生成分镜、画面、旁白与成片。" />
+ <meta name="description" content="PRINTFILM AI短视频:输入卖点与风格,自动生成分镜、画面、旁白与成片。" />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
diff --git a/frontend/public/wechat-group-qr.png b/frontend/public/wechat-group-qr.png
new file mode 100644
index 0000000..7df87c9
Binary files /dev/null and b/frontend/public/wechat-group-qr.png differ
diff --git a/frontend/src/App.tsx b/frontend/src/App.tsx
index 3e318c6..6034ac8 100644
--- a/frontend/src/App.tsx
+++ b/frontend/src/App.tsx
@@ -2,9 +2,11 @@ import { BrowserRouter, Navigate, Route, Routes } from 'react-router-dom'
import DialogHost from './components/ui/DialogHost'
import BillingAlertHost from './components/billing/BillingAlertHost'
import { DramaGenQueuePanel } from './components/drama/DramaGenQueuePanel'
+import WeChatGroupFab from './components/layout/WeChatGroupFab'
import AuthPage from './pages/AuthPage'
import HistoryPage from './pages/HistoryPage'
import HomePage from './pages/HomePage'
+import MethodPage from './pages/MethodPage'
import ToolsPage from './pages/ToolsPage'
import ToolDetailPage from './pages/ToolDetailPage'
import HelpPage from './pages/HelpPage'
@@ -33,6 +35,7 @@ export default function App() {
<BrowserRouter>
<Routes>
<Route path="/" element={<HomePage />} />
+ <Route path="/method" element={<MethodPage />} />
<Route path="/auth" element={<AuthPage />} />
<Route path="/templates" element={<TemplatesPage />} />
<Route path="/tools" element={<ToolsPage />} />
@@ -64,6 +67,7 @@ export default function App() {
<Route path="/drama/projects/:projectId/canvas" element={<CanvasPage />} />
<Route path="*" element={<Navigate to="/" replace />} />
</Routes>
+ <WeChatGroupFab />
<DramaGenQueuePanel />
<BillingAlertHost />
<DialogHost />
diff --git a/frontend/src/components/layout/WeChatGroupFab.tsx b/frontend/src/components/layout/WeChatGroupFab.tsx
new file mode 100644
index 0000000..2b48a7a
--- /dev/null
+++ b/frontend/src/components/layout/WeChatGroupFab.tsx
@@ -0,0 +1,132 @@
+/** 全站右下角:微信用户群二维码入口(点击展开;URL 由后台站点配置下发) */
+import { useEffect, useRef, useState } from 'react'
+import { X } from 'lucide-react'
+import { useI18n } from '../../i18n'
+
+const FALLBACK_QR = '/wechat-group-qr.png'
+
+/** API 根路径(空字符串 = 同源) */
+function apiBase(): string {
+ const raw = import.meta.env.VITE_API_BASE
+ if (raw === undefined || raw === null) {
+ if (typeof window !== 'undefined' && window.location?.hostname) {
+ const { protocol, hostname } = window.location
+ return `${protocol}//${hostname}:8000`
+ }
+ return 'http://127.0.0.1:8000'
+ }
+ return String(raw).replace(/\/$/, '')
+}
+
+/** 把 /static 相对路径拼到 API 基址;绝对 URL 原样返回 */
+function resolveMediaUrl(url: string): string {
+ const trimmed = url.trim()
+ if (!trimmed) return ''
+ if (
+ trimmed.startsWith('http://') ||
+ trimmed.startsWith('https://') ||
+ trimmed.startsWith('data:') ||
+ trimmed.startsWith('blob:')
+ ) {
+ return trimmed
+ }
+ if (trimmed.startsWith('/')) {
+ const base = apiBase()
+ return base ? `${base}${trimmed}` : trimmed
+ }
+ return trimmed
+}
+
+/** 简易微信气泡图标 */
+function WeChatIcon({ size = 22 }: { size?: number }) {
+ return (
+ <svg width={size} height={size} viewBox="0 0 24 24" aria-hidden fill="currentColor">
+ <path d="M9.5 4C5.91 4 3 6.46 3 9.5c0 1.72.9 3.26 2.32 4.32L4.7 16.1l2.42-.72c.72.22 1.5.35 2.33.35.18 0 .35 0 .52-.02A4.9 4.9 0 0 1 9.5 14.5c0-2.99 2.8-5.4 6.25-5.4.1 0 .2 0 .3.01C15.4 5.9 12.7 4 9.5 4Zm-2.4 3.4a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8Zm4.1 0a.9.9 0 1 1 0 1.8.9.9 0 0 1 0-1.8Z" />
+ <path d="M15.75 10.1c-2.9 0-5.25 1.9-5.25 4.25S12.85 18.6 15.75 18.6c.62 0 1.21-.1 1.76-.27l1.95.58-.48-1.55c1.1-.82 1.82-2 1.82-3.31 0-2.35-2.35-4.25-5.05-4.25Zm-1.7 3.1a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4Zm3.4 0a.7.7 0 1 1 0 1.4.7.7 0 0 1 0-1.4Z" />
+ </svg>
+ )
+}
+
+export default function WeChatGroupFab() {
+ const { t } = useI18n()
+ const [open, setOpen] = useState(false)
+ const [qrSrc, setQrSrc] = useState(FALLBACK_QR)
+ const rootRef = useRef<HTMLDivElement>(null)
+
+ // 从公开站点配置拉取后台可热更的二维码
+ useEffect(() => {
+ let cancelled = false
+ async function load() {
+ try {
+ const res = await fetch(`${apiBase()}/api/site-config`)
+ if (!res.ok) return
+ const data = (await res.json()) as { wechat_group_qr_url?: string }
+ const resolved = resolveMediaUrl(data.wechat_group_qr_url || '')
+ if (!cancelled && resolved) setQrSrc(resolved)
+ } catch {
+ /* 保持本地兜底图 */
+ }
+ }
+ void load()
+ return () => {
+ cancelled = true
+ }
+ }, [])
+
+ // 点击浮层外关闭
+ useEffect(() => {
+ if (!open) return
+ function onPointerDown(e: PointerEvent) {
+ if (rootRef.current && !rootRef.current.contains(e.target as Node)) {
+ setOpen(false)
+ }
+ }
+ function onKey(e: KeyboardEvent) {
+ if (e.key === 'Escape') setOpen(false)
+ }
+ document.addEventListener('pointerdown', onPointerDown)
+ document.addEventListener('keydown', onKey)
+ return () => {
+ document.removeEventListener('pointerdown', onPointerDown)
+ document.removeEventListener('keydown', onKey)
+ }
+ }, [open])
+
+ return (
+ <div className="pf-wx-fab-root" ref={rootRef}>
+ {open ? (
+ <div className="pf-wx-fab-panel" role="dialog" aria-label={t('wechatGroup.title')}>
+ <header className="pf-wx-fab-head">
+ <div>
+ <strong>{t('wechatGroup.title')}</strong>
+ <p>{t('wechatGroup.lead')}</p>
+ </div>
+ <button
+ type="button"
+ className="pf-wx-fab-close"
+ onClick={() => setOpen(false)}
+ aria-label={t('common.close')}
+ >
+ <X size={16} strokeWidth={2} aria-hidden />
+ </button>
+ </header>
+ <div className="pf-wx-fab-qr">
+ <img src={qrSrc} alt={t('wechatGroup.qrAlt')} width={200} height={200} />
+ </div>
+ <p className="pf-wx-fab-tip">{t('wechatGroup.tip')}</p>
+ </div>
+ ) : null}
+ <button
+ type="button"
+ className={`pf-wx-fab-btn${open ? ' is-open' : ''}`}
+ onClick={() => setOpen((v) => !v)}
+ aria-expanded={open}
+ aria-label={t('wechatGroup.open')}
+ title={t('wechatGroup.open')}
+ >
+ <WeChatIcon />
+ <span className="pf-wx-fab-label">{t('wechatGroup.short')}</span>
+ </button>
+ </div>
+ )
+}
diff --git a/frontend/src/i18n/locales/en/pages.ts b/frontend/src/i18n/locales/en/pages.ts
index 728a4f5..ac66435 100644
--- a/frontend/src/i18n/locales/en/pages.ts
+++ b/frontend/src/i18n/locales/en/pages.ts
@@ -4,7 +4,7 @@ export const enPages = {
home: {
headlineBefore: 'Turn stories into',
headlineEm: 'films you can play',
- lede: 'AI drama from script to episodic film. Explainer videos from storyboard to voice and compose. One studio, two ways to ship.',
+ lede: 'AI drama from script to episodic film. AI short video from offer to storyboard to film. One studio, two ways to ship.',
startCreate: 'Start creating',
browseTools: 'Browse tools',
products: 'Products',
@@ -13,8 +13,8 @@ export const enPages = {
dramaDesc: 'Generate a script from one line, lock characters and scenes, then board each episode.',
kepuTitle: 'AI Short Video',
kepuTag: 'Lead-gen shorts',
- kepuFor: 'For knowledge creators',
- kepuDesc: 'Pick a look, write narration boards, and run the pipeline to a short explainer.',
+ kepuFor: 'For brands that need leads',
+ kepuDesc: 'Turn an offer into short videos you can post, then batch them through the storyboard pipeline.',
howKicker: 'How it works',
howTitle: 'Three steps to a film',
capsKicker: 'Capabilities',
@@ -25,9 +25,10 @@ export const enPages = {
whoKicker: 'For',
whoTitle: 'Who it’s for',
closeTitle: 'Start from one idea',
- closeLead: 'Sign in, pick Drama or Explainers, and enter the matching workspace.',
+ closeLead: 'Sign in, pick Drama or AI Short Video, and enter the matching workspace.',
viewPricing: 'View pricing',
- footBrand: 'AI drama and explainer video studio',
+ methodLink: 'Lead-gen method',
+ footBrand: 'AI drama and AI short video studio',
footNav: 'Footer',
dramaSteps: ['AI script', 'Cast & scenes', 'Episode boards', 'Export'],
kepuSteps: ['Pick a style', 'Write boards', 'Voice & compose', 'Batch output'],
@@ -40,11 +41,11 @@ export const enPages = {
{ title: '19 film looks', desc: 'From mythic epics to urban realism and neon cyberpunk — one style carries the whole piece.' },
{ title: 'Reusable assets', desc: 'Generate a character once, reuse it across the series instead of redrawing every shot.' },
{ title: 'Editable boards', desc: '@-mention assets, set duration and camera moves, and see the shot before you generate.' },
- { title: 'Two output paths', desc: 'Drama for episodic stories, explainers for storyboard pipelines — one account and one wallet.' },
+ { title: 'Two output paths', desc: 'Drama for episodic stories, AI short video for the storyboard pipeline — one account and one wallet.' },
],
audiences: [
{ title: 'Short-drama creators', desc: 'Break a story into shootable episodes. Assets first, film second.' },
- { title: 'Knowledge creators', desc: 'Turn articles into vertical explainers with a consistent look and pace.' },
+ { title: 'Brand acquisition', desc: 'Turn an offer into vertical shorts with a consistent look you can batch.' },
{ title: 'Small teams', desc: 'Keep projects, assets, and history in one place instead of hopping tools.' },
],
},
@@ -82,12 +83,12 @@ export const enPages = {
{
n: '01',
title: 'Choose an entry',
- body: 'Open AI Drama or Explainer video from Home. For a single image or clip, use Tools in the top nav.',
+ body: 'Open AI Drama or AI Short Video from Home. For a single image or clip, use Tools in the top nav.',
},
{
n: '02',
title: 'Configure and generate',
- body: 'Drama: idea → outline → assets → episodes. Explainers: topic → style → boards → film. Tools: fill a prompt or upload media, then generate.',
+ body: 'Drama: idea → outline → assets → episodes. AI Short Video: topic → style → boards → film. Tools: fill a prompt or upload media, then generate.',
},
{
n: '03',
@@ -97,21 +98,21 @@ export const enPages = {
{
n: '04',
title: 'Save and download',
- body: 'Outputs land in cloud storage. Explainers download from History; drama from the project workspace; tool runs from Account.',
+ body: 'Outputs land in cloud storage. AI Short Video downloads from History; drama from the project workspace; tool runs from Account.',
},
],
faq: [
{
q: 'Where should I start?',
- a: 'Open Home and pick AI Drama or Explainer video. Drama is for episodic stories and character consistency; explainers are a short-video storyboard pipeline. For a single image or clip, go to Tools.',
+ a: 'Open Home and pick AI Drama or AI Short Video. Drama is for episodic stories and character consistency; AI Short Video is positioned for lead-gen storyboards. For a single image or clip, go to Tools.',
},
{
q: 'What’s the difference between AI video and stills-to-film?',
- a: 'AI video has stronger motion and costs more. Stills-to-film (image + narration) is faster and more stable for explainers. Choose when you create a new explainer project.',
+ a: 'AI video has stronger motion and costs more. Stills-to-film (image + narration) is faster and more stable for explainers. Choose when you create a new lead-gen project.',
},
{
q: 'Can I leave the page while it generates?',
- a: 'Yes. Jobs keep running on the server. Check explainer History, the drama project workspace, or Account for tool-run status. For in-page video tools, staying until it finishes is safer.',
+ a: 'Yes. Jobs keep running on the server. Check AI Short Video History, the drama project workspace, or Account for tool-run status. For in-page video tools, staying until it finishes is safer.',
},
{
q: 'What can the tool hub do?',
@@ -127,11 +128,11 @@ export const enPages = {
},
{
q: 'Where do I download finished films or assets?',
- a: 'Explainers: History in the top nav. Drama: the project workspace. Global assets: Assets in the top nav.',
+ a: 'AI Short Video: History in the top nav. Drama: the project workspace. Global assets: Assets in the top nav.',
},
{
q: 'What’s in Account?',
- a: 'Profile, drama projects, explainer history, tool runs, asset library entry, and plan & balance. Team, API, and notifications are still in progress.',
+ a: 'Profile, drama projects, AI Short Video history, tool runs, asset library entry, and plan & balance. Team, API, and notifications are still in progress.',
},
{
q: 'How do top-ups and charges work?',
@@ -139,7 +140,7 @@ export const enPages = {
},
{
q: 'Generation failed or the image is off?',
- a: 'Tweak the prompt, negative prompt, or reference image and retry. Drama and explainers support per-shot regen. Check network and balance; safety filters may block sensitive content.',
+ a: 'Tweak the prompt, negative prompt, or reference image and retry. Drama and AI Short Video support per-shot regen. Check network and balance; safety filters may block sensitive content.',
},
],
drawerCats: [
@@ -209,7 +210,7 @@ export const enPages = {
lead: 'Open a tool workspace to generate images and short video.',
goDrama: 'Go to Drama',
goDramaHint: 'Script · episodes · film',
- goKepu: 'Explainer history',
+ goKepu: 'AI Short Video',
goKepuHint: 'Storyboard pipeline',
generating: 'Generating…',
generatingVideo: 'Generating video…',
@@ -386,9 +387,9 @@ export const enPages = {
updatedAt: 'Updated {time}',
},
history: {
- title: 'Explainer history',
- lead: 'Manage explainer projects — keep editing or download the film.',
- newKepu: 'New explainer',
+ title: 'AI Short Video',
+ lead: 'Manage AI short video projects — keep editing or download the film.',
+ newKepu: 'New short',
goDrama: 'Go to Drama',
statTotal: 'Projects',
statRunning: 'In progress',
@@ -413,7 +414,7 @@ export const enPages = {
searchPlaceholder: 'Search by title',
packing: 'Zipping {progress}…',
packDownload: 'Download zip ({count})',
- empty: 'No explainer projects yet. Click “New explainer” to start.',
+ empty: 'No AI short video projects yet. Click “New short” to start.',
noCover: 'No cover',
published: 'Published',
templateMeta: 'Template {name} · {when}',
@@ -423,7 +424,7 @@ export const enPages = {
deleteFailed: 'Delete failed',
downloadFailed: 'Download failed',
packFailed: 'Zip failed',
- pagination: 'Explainer history pages',
+ pagination: 'AI Short Video pages',
},
dramaList: {
title: 'My drama projects',
diff --git a/frontend/src/i18n/locales/en/shell.ts b/frontend/src/i18n/locales/en/shell.ts
index a7bf11b..be7a3d8 100644
--- a/frontend/src/i18n/locales/en/shell.ts
+++ b/frontend/src/i18n/locales/en/shell.ts
@@ -2,9 +2,9 @@
export const enShell = {
meta: {
- title: 'PRINTFILM · AI video studio',
+ title: 'PRINTFILM · AI short video',
description:
- 'PRINTFILM: turn scripts into episodic AI dramas, or storyboards into explainer videos.',
+ 'PRINTFILM: turn scripts into episodic AI dramas, or offers into AI short videos.',
},
common: {
comingSoon: 'Coming soon',
@@ -72,12 +72,20 @@ export const enShell = {
help: 'Help',
links: 'Footer links',
},
+ wechatGroup: {
+ short: 'WeChat',
+ open: 'Join WeChat user group',
+ title: 'printfilm user group',
+ lead: 'Short drama tips · deploy help · templates',
+ qrAlt: 'WeChat group QR code',
+ tip: 'Scan with WeChat. Invite codes expire in about 7 days — open an Issue if it fails.',
+ },
auth: {
loginTitle: 'Back to the studio',
registerTitle: 'Create a creator account',
forgotTitle: 'Reset your password',
resetTitle: 'Choose a new password',
- lede: 'PRINTFILM · AI drama and explainer videos',
+ lede: 'PRINTFILM · AI drama and AI short video',
nickname: 'Display name',
email: 'Email',
password: 'Password',
@@ -119,7 +127,7 @@ export const enShell = {
tabs: {
account: 'Profile',
projects: 'Drama projects',
- kepu: 'Explainer history',
+ kepu: 'AI Short Video',
tools: 'Tool runs',
assets: 'Assets',
subscription: 'Plan & balance',
@@ -153,10 +161,10 @@ export const enShell = {
noDrama: 'No drama projects yet',
goCreate: 'Create one',
projectFallback: 'Project #{id}',
- kepuLead: 'Explainer projects and finished films',
+ kepuLead: 'AI short video projects and finished films',
allHistory: 'All history',
- newKepu: 'New explainer',
- noKepu: 'No explainer projects yet',
+ newKepu: 'New short',
+ noKepu: 'No AI short video projects yet',
assetsLead: 'Characters, scenes, props, and media live in the asset library',
openAssets: 'Open library',
subLead: 'Pay as you go — balance never expires',
diff --git a/frontend/src/i18n/locales/zh/pages.ts b/frontend/src/i18n/locales/zh/pages.ts
index f48d6e1..38b1ba4 100644
--- a/frontend/src/i18n/locales/zh/pages.ts
+++ b/frontend/src/i18n/locales/zh/pages.ts
@@ -4,7 +4,7 @@ export const zhPages = {
home: {
headlineBefore: '把故事做成',
headlineEm: '能播的片子',
- lede: 'AI 漫剧从剧本到分集成片,AI短视频从分镜到配音合成。一套工作台,两种出片方式。',
+ lede: 'AI 漫剧从剧本到分集成片,AI短视频从卖点到分镜成片。一套工作台,两种出片方式。',
startCreate: '开始创作',
browseTools: '浏览工具',
products: '主产品',
@@ -13,8 +13,8 @@ export const zhPages = {
dramaDesc: '从一句话生成剧本,沉淀角色与场景,再按集分镜成片。',
kepuTitle: 'AI短视频',
kepuTag: '获客短视频',
- kepuFor: '给知识创作者',
- kepuDesc: '选定画面风格,写好分镜旁白,沿流水线出讲解短片。',
+ kepuFor: '给要获客的品牌',
+ kepuDesc: '把卖点做成可投放的短视频,选定风格后沿分镜流水线批量出片。',
howKicker: 'How it works',
howTitle: '三步出片',
capsKicker: 'Capabilities',
@@ -25,8 +25,9 @@ export const zhPages = {
whoKicker: 'For',
whoTitle: '适合谁用',
closeTitle: '从一条创意开始',
- closeLead: '登录后选择漫剧或科普,进入对应工作台。',
+ closeLead: '登录后选择漫剧或 AI短视频,进入对应工作台。',
viewPricing: '查看定价',
+ methodLink: '获客短视频方法论',
footBrand: 'AI 漫剧与 AI短视频创作平台',
footNav: '页脚导航',
dramaSteps: ['AI 生剧本', '角色与场景', '分集分镜', '成片导出'],
@@ -40,11 +41,11 @@ export const zhPages = {
{ title: '19 种成片风格', desc: '从神话史诗到都市写实、赛博霓虹,选定后贯穿整部作品。' },
{ title: '资产可复用', desc: '角色、场景、道具、音色一次生成,全剧引用,避免每镜重画。' },
{ title: '分镜可编辑', desc: '脚本里 @ 引用资产、插入时长与运镜,生成前就能看清这一镜。' },
- { title: '两条出片路径', desc: '漫剧走分集叙事,科普走分镜流水线,同一套账号与积分。' },
+ { title: '两条出片路径', desc: '漫剧走分集叙事,AI短视频走分镜流水线,同一套账号与积分。' },
],
audiences: [
{ title: '短剧创作者', desc: '把故事拆成可拍的分集,先出资产再成片。' },
- { title: '知识博主', desc: '把文章变成竖屏讲解片,风格统一、节奏可控。' },
+ { title: '品牌获客', desc: '把卖点做成竖屏短视频,风格统一、可批量出片。' },
{ title: '团队制作', desc: '项目、资产、历史集中在一处,少在工具间来回搬。' },
],
},
@@ -87,31 +88,31 @@ export const zhPages = {
{
n: '02',
title: '配置并生成',
- body: '漫剧:创意 → 大纲 → 资产 → 分集;科普:主题 → 风格 → 分镜 → 成片;工具:填提示词或上传素材后点生成。',
+ body: '漫剧:创意 → 大纲 → 资产 → 分集;AI短视频:主题 → 风格 → 分镜 → 成片;工具:填提示词或上传素材后点生成。',
},
{
n: '03',
title: '审阅与迭代',
- body: '漫剧 / 科普可单镜重绘、重生视频或重配音,不必整片重做。工具结果可在工作台预览后再次生成。',
+ body: '漫剧 / AI短视频可单镜重绘、重生视频或重配音,不必整片重做。工具结果可在工作台预览后再次生成。',
},
{
n: '04',
title: '保存与下载',
- body: '结果会写入云端存储。科普在历史页下载;漫剧在项目工作台查看;工具创作在个人中心查看详情并下载。',
+ body: '结果会写入云端存储。AI短视频在历史页下载;漫剧在项目工作台查看;工具创作在个人中心查看详情并下载。',
},
],
faq: [
{
q: '第一次使用从哪开始?',
- a: '打开工作台,选择「AI 漫剧」或「AI短视频」。漫剧适合分集叙事与角色一致性;AI短视频适合短视频分镜流水线。若只要单张图或短片段,可直接进入「工具」。',
+ a: '打开工作台,选择「AI 漫剧」或「AI短视频」。漫剧适合分集叙事与角色一致性;AI短视频定位获客,适合卖点讲解与分镜流水线。若只要单张图或短片段,可直接进入「工具」。',
},
{
q: '「AI 视频」和「静图成片」有什么区别?',
- a: 'AI 视频镜头运动更强、成本更高;静图成片(图文视频)以画面 + 旁白为主,更快更稳,适合讲解类科普。新建科普项目时按需求选择即可。',
+ a: 'AI 视频镜头运动更强、成本更高;静图成片(图文视频)以画面 + 旁白为主,更快更稳,适合讲解类获客短片。新建 AI短视频项目时按需求选择即可。',
},
{
q: '生成中可以离开页面吗?',
- a: '可以。任务在服务端继续执行。科普可回「科普」历史页看进度;漫剧回对应项目工作台;工具视频任务请尽量停留在当前页等待完成,或稍后在个人中心查看状态。',
+ a: '可以。任务在服务端继续执行。AI短视频可回历史页看进度;漫剧回对应项目工作台;工具视频任务请尽量停留在当前页等待完成,或稍后在个人中心查看状态。',
},
{
q: '工具中心能做什么?',
@@ -127,11 +128,11 @@ export const zhPages = {
},
{
q: '成片或素材在哪里下载?',
- a: '科普成片:顶栏「科普」历史页,已完成项目可下载或打包。漫剧:进入对应项目工作台查看分镜与成片。全局资产:顶栏「资产」管理角色、场景、道具与音色。',
+ a: 'AI短视频:顶栏「AI短视频」历史页,已完成项目可下载或打包。漫剧:进入对应项目工作台查看分镜与成片。全局资产:顶栏「资产」管理角色、场景、道具与音色。',
},
{
q: '个人中心有哪些内容?',
- a: '包含账号信息、漫剧项目、科普历史、工具创作记录、资产管理入口,以及订阅与余额。团队、API、通知偏好等能力仍在建设中。',
+ a: '包含账号信息、漫剧项目、AI短视频历史、工具创作记录、资产管理入口,以及订阅与余额。团队、API、通知偏好等能力仍在建设中。',
},
{
q: '如何充值?余额怎么扣?',
@@ -139,7 +140,7 @@ export const zhPages = {
},
{
q: '生成失败或画面不符合预期怎么办?',
- a: '可调整提示词、反向提示词或参考图后重试;漫剧 / 科普支持单镜重生。若反复失败,请检查网络与余额,或稍后重试。敏感内容可能被模型安全策略拦截。',
+ a: '可调整提示词、反向提示词或参考图后重试;漫剧 / AI短视频支持单镜重生。若反复失败,请检查网络与余额,或稍后重试。敏感内容可能被模型安全策略拦截。',
},
],
drawerCats: [
@@ -202,7 +203,7 @@ export const zhPages = {
lead: '进入工具工作台,生成图片与短视频。',
goDrama: '去漫剧创作',
goDramaHint: '剧本 · 分集 · 成片',
- goKepu: '去科普历史',
+ goKepu: '去AI短视频',
goKepuHint: '分镜流水线出片',
generating: '生成中…',
generatingVideo: '视频生成中…',
@@ -379,9 +380,9 @@ export const zhPages = {
updatedAt: '更新于 {time}',
},
history: {
- title: '科普历史',
+ title: 'AI短视频',
lead: '管理你的 AI短视频项目,继续编辑或下载成片。',
- newKepu: '新建科普',
+ newKepu: '新建短视频',
goDrama: '去漫剧',
statTotal: '总作品数',
statRunning: '生成中',
@@ -406,7 +407,7 @@ export const zhPages = {
searchPlaceholder: '搜索项目名称',
packing: '打包中 {progress}…',
packDownload: '打包下载 ({count})',
- empty: '暂无科普项目,点击「新建科普」开始创作',
+ empty: '暂无 AI短视频项目,点击「新建短视频」开始创作',
noCover: '无封面',
published: '已发布',
templateMeta: '模板 {name} · {when}',
@@ -416,7 +417,7 @@ export const zhPages = {
deleteFailed: '删除失败',
downloadFailed: '下载失败',
packFailed: '打包失败',
- pagination: '科普历史分页',
+ pagination: 'AI短视频分页',
},
dramaList: {
title: '我的漫剧项目',
diff --git a/frontend/src/i18n/locales/zh/shell.ts b/frontend/src/i18n/locales/zh/shell.ts
index cb5e79a..06d0ce1 100644
--- a/frontend/src/i18n/locales/zh/shell.ts
+++ b/frontend/src/i18n/locales/zh/shell.ts
@@ -3,7 +3,7 @@
export const zhShell = {
meta: {
title: 'PRINTFILM · AI短视频平台',
- description: 'PRINTFILM:AI 漫剧从剧本到分集成片,AI短视频从分镜到配音合成。',
+ description: 'PRINTFILM:AI 漫剧从剧本到分集成片,AI短视频从卖点到分镜成片。',
},
common: {
comingSoon: '即将推出',
@@ -71,6 +71,14 @@ export const zhShell = {
help: '帮助中心',
links: '页脚链接',
},
+ wechatGroup: {
+ short: '加群',
+ open: '加入微信用户群',
+ title: 'printfilm 用户群',
+ lead: '学习短剧 · 部署答疑 · 模板交流',
+ qrAlt: '微信用户群二维码',
+ tip: '微信扫码入群。邀请码约 7 天有效,失效请联系客服或提 Issue。',
+ },
auth: {
loginTitle: '回到工作台',
registerTitle: '创建创作者账号',
@@ -154,8 +162,8 @@ export const zhShell = {
projectFallback: '项目 #{id}',
kepuLead: 'AI短视频项目与成片记录',
allHistory: '全部历史',
- newKepu: '新建科普',
- noKepu: '还没有科普项目',
+ newKepu: '新建短视频',
+ noKepu: '还没有 AI短视频项目',
assetsLead: '角色、场景、道具与成片素材统一存放在资产库',
openAssets: '打开资产库',
subLead: '按量充值,余额永久有效',
diff --git a/frontend/src/lib/categories.ts b/frontend/src/lib/categories.ts
index 12359ca..5503dff 100644
--- a/frontend/src/lib/categories.ts
+++ b/frontend/src/lib/categories.ts
@@ -1,6 +1,7 @@
export const CATEGORY_ORDER = [
'开源',
'科普',
+ '获客',
'纪录片',
'写实感',
'真人感',
@@ -20,6 +21,7 @@ export const HOME_CATEGORY_LABELS: Record<string, string> = {
全部: '全部',
开源: '开源项目',
科普: '知识科普',
+ 获客: '获客短视频',
纪录片: '纪录片',
写实感: '写实感',
真人感: '人物故事',
diff --git a/frontend/src/lib/helpContent.ts b/frontend/src/lib/helpContent.ts
index 3cd9545..41ac727 100644
--- a/frontend/src/lib/helpContent.ts
+++ b/frontend/src/lib/helpContent.ts
@@ -36,32 +36,32 @@ export const HELP_GUIDE_STEPS: HelpGuideStep[] = [
{
n: '02',
title: '配置并生成',
- body: '漫剧:创意 → 大纲 → 资产 → 分集;科普:主题 → 风格 → 分镜 → 成片;工具:填提示词或上传素材后点生成。',
+ body: '漫剧:创意 → 大纲 → 资产 → 分集;AI短视频:主题 → 风格 → 分镜 → 成片;工具:填提示词或上传素材后点生成。',
},
{
n: '03',
title: '审阅与迭代',
- body: '漫剧 / 科普可单镜重绘、重生视频或重配音,不必整片重做。工具结果可在工作台预览后再次生成。',
+ body: '漫剧 / AI短视频可单镜重绘、重生视频或重配音,不必整片重做。工具结果可在工作台预览后再次生成。',
},
{
n: '04',
title: '保存与下载',
- body: '结果会写入云端存储。科普在历史页下载;漫剧在项目工作台查看;工具创作在个人中心查看详情并下载。',
+ body: '结果会写入云端存储。AI短视频在历史页下载;漫剧在项目工作台查看;工具创作在个人中心查看详情并下载。',
},
]
export const HELP_FAQ_ITEMS: HelpFaqItem[] = [
{
q: '第一次使用从哪开始?',
- a: '打开工作台,选择「AI 漫剧」或「AI短视频」。漫剧适合分集叙事与角色一致性;AI短视频适合短视频分镜流水线。若只要单张图或短片段,可直接进入「工具」。',
+ a: '打开工作台,选择「AI 漫剧」或「AI短视频」。漫剧适合分集叙事与角色一致性;AI短视频定位获客,适合卖点讲解与分镜流水线。若只要单张图或短片段,可直接进入「工具」。',
},
{
q: '「AI 视频」和「静图成片」有什么区别?',
- a: 'AI 视频镜头运动更强、成本更高;静图成片(图文视频)以画面 + 旁白为主,更快更稳,适合讲解类科普。新建科普项目时按需求选择即可。',
+ a: 'AI 视频镜头运动更强、成本更高;静图成片(图文视频)以画面 + 旁白为主,更快更稳,适合讲解类获客短片。新建 AI短视频项目时按需求选择即可。',
},
{
q: '生成中可以离开页面吗?',
- a: '可以。任务在服务端继续执行。科普可回「科普」历史页看进度;漫剧回对应项目工作台;工具视频任务请尽量停留在当前页等待完成,或稍后在个人中心查看状态。',
+ a: '可以。任务在服务端继续执行。AI短视频可回历史页看进度;漫剧回对应项目工作台;工具视频任务请尽量停留在当前页等待完成,或稍后在个人中心查看状态。',
},
{
q: '工具中心能做什么?',
@@ -77,11 +77,11 @@ export const HELP_FAQ_ITEMS: HelpFaqItem[] = [
},
{
q: '成片或素材在哪里下载?',
- a: '科普成片:顶栏「科普」历史页,已完成项目可下载或打包。漫剧:进入对应项目工作台查看分镜与成片。全局资产:顶栏「资产」管理角色、场景、道具与音色。',
+ a: 'AI短视频:顶栏「AI短视频」历史页,已完成项目可下载或打包。漫剧:进入对应项目工作台查看分镜与成片。全局资产:顶栏「资产」管理角色、场景、道具与音色。',
},
{
q: '个人中心有哪些内容?',
- a: '包含账号信息、漫剧项目、科普历史、工具创作记录、资产管理入口,以及订阅与余额。团队、API、通知偏好等能力仍在建设中。',
+ a: '包含账号信息、漫剧项目、AI短视频历史、工具创作记录、资产管理入口,以及订阅与余额。团队、API、通知偏好等能力仍在建设中。',
},
{
q: '如何充值?余额怎么扣?',
@@ -89,7 +89,7 @@ export const HELP_FAQ_ITEMS: HelpFaqItem[] = [
},
{
q: '生成失败或画面不符合预期怎么办?',
- a: '可调整提示词、反向提示词或参考图后重试;漫剧 / 科普支持单镜重生。若反复失败,请检查网络与余额,或稍后重试。敏感内容可能被模型安全策略拦截。',
+ a: '可调整提示词、反向提示词或参考图后重试;漫剧 / AI短视频支持单镜重生。若反复失败,请检查网络与余额,或稍后重试。敏感内容可能被模型安全策略拦截。',
},
]
diff --git a/frontend/src/lib/legalContent.ts b/frontend/src/lib/legalContent.ts
index baa2c81..c3a4c94 100644
--- a/frontend/src/lib/legalContent.ts
+++ b/frontend/src/lib/legalContent.ts
@@ -104,7 +104,7 @@ export const LEGAL_DOCS: Record<'terms' | 'privacy', LegalDoc> = {
{
title: '2. 信息的使用目的',
bullets: [
- '提供、维护与改进漫剧、科普与工具等创作服务。',
+ '提供、维护与改进漫剧、AI短视频与工具等创作服务。',
'完成身份验证、计费结算、订单查询与客服支持。',
'保障账号与系统安全,防范欺诈与滥用。',
'在获得同意或法律法规允许的情况下,向您发送服务通知或产品更新。',
diff --git a/frontend/src/lib/methodLanding.ts b/frontend/src/lib/methodLanding.ts
new file mode 100644
index 0000000..c2b0a59
--- /dev/null
+++ b/frontend/src/lib/methodLanding.ts
@@ -0,0 +1,396 @@
+/** 获客短视频宣传页(/method)文案:对标交付方法论结构,不承诺效果 */
+
+export const METHOD_START_URL = 'https://www.printfilm.com/studio/new'
+export const METHOD_GEO_URL = 'https://www.geohao.com/'
+
+export type MethodTocItem = { href: string; label: string }
+
+export type MethodStep = {
+ title: string
+ body: string
+ note?: string
+}
+
+export type MethodCard = {
+ title: string
+ body: string
+}
+
+export type MethodTableRow = {
+ platform: string
+ form: string
+ focus: string
+ owner: string
+}
+
+export type MethodLandingCopy = {
+ metaTitle: string
+ metaDescription: string
+ kicker: string
+ title: string
+ ledeBefore: string
+ ledeEm: string
+ ledeAfter: string
+ startCta: string
+ geoCta: string
+ brandLine: string
+ skip: string
+ noticeTitle: string
+ noticeBody: string
+ toc: MethodTocItem[]
+ sopKicker: string
+ sopTitle: string
+ sopLeadBefore: string
+ sopLeadEm: string
+ sopSteps: MethodStep[]
+ sopCalloutTitle: string
+ sopCalloutBody: string
+ geoKicker: string
+ geoTitle: string
+ geoLead: string
+ geoCards: MethodCard[]
+ geoCalloutTitle: string
+ geoCalloutBody: string
+ distKicker: string
+ distTitle: string
+ distLead: string
+ distTableCaption: string
+ distTableHead: [string, string, string, string]
+ distRows: MethodTableRow[]
+ distCalloutTitle: string
+ distCalloutBody: string
+ paceKicker: string
+ paceTitle: string
+ paceLead: string
+ paceIncludeTitle: string
+ paceInclude: string[]
+ paceExcludeTitle: string
+ paceExclude: string[]
+ paceCalloutTitle: string
+ paceCalloutBody: string
+ qcKicker: string
+ qcTitle: string
+ qcLead: string
+ qcCards: MethodCard[]
+ boundKicker: string
+ boundTitle: string
+ boundLead: string
+ boundItems: string[]
+ closeTitle: string
+ closeBody: string
+ footAbout: string
+ footLegal: string
+ footCopy: string
+ jsonLdHeadline: string
+}
+
+const zh: MethodLandingCopy = {
+ metaTitle: '获客短视频 · PRINTFILM(内容生产 SOP · GEO 配套 · 多平台分发)',
+ metaDescription:
+ 'PRINTFILM 获客短视频交付方法论:内容生产四步 SOP、与 GEO 的配合方式、多平台分发、成片节奏与人工质检。本页为方法论说明,不承诺获客或成交结果。',
+ kicker: 'Method',
+ title: '获客短视频',
+ ledeBefore: '这一页写的是',
+ ledeEm: '我们怎么做获客短视频',
+ ledeAfter:
+ ':内容怎么生产、怎么和 GEO 配合、多平台怎么排、成片怎么用。看完你应该能判断这套流程是否适合你的行业。',
+ startCta: '开始使用',
+ geoCta: '回到 GEO',
+ brandLine: '获客短视频 · GEO 配套出片',
+ skip: '跳到主要内容',
+ noticeTitle: '阅读前须知',
+ noticeBody:
+ '以下为交付方法论与能力说明,不是客户背书,也不是效果承诺。本页不展示任何客户名称、案例数据、成交金额或客户评价。PRINTFILM 按实际上游用量计费,不承诺获客、播放、线索或成交结果。页内周期与产能为参考区间,待核。',
+ toc: [
+ { href: '#sop', label: '内容生产 SOP' },
+ { href: '#geo', label: '和 GEO 怎么配合' },
+ { href: '#dist', label: '多平台分发' },
+ { href: '#pace', label: '成片节奏' },
+ { href: '#qc', label: '人工质检与合规' },
+ { href: '#bound', label: '能力边界' },
+ ],
+ sopKicker: '01',
+ sopTitle: '一、内容生产 SOP',
+ sopLeadBefore: '我们把获客短视频拆成四步,每步都有明确输入与产出。核心思路是:',
+ sopLeadEm: '让 AI 处理可规模化的部分,让人守住必须由人判断的部分。',
+ sopSteps: [
+ {
+ title: '卖点采集:先写清你在卖什么',
+ body: '输入是你的产品、价格、服务流程、常见异议,以及行业关键词。产出是一份可拍的选题清单:痛点、对比、流程说明、价格拆解。这一步解决的是「拍什么」靠拍脑袋的问题——先有被验证的需求,再进工作台。',
+ note: '资料以你提供的书面材料为准,模型不会凭空补你的价格与资质。',
+ },
+ {
+ title: '结构拆解:把「感觉能获客」变成模板',
+ body: '按标题、开头 3 秒钩子、痛点、方案、结尾行动五个维度拆开,归类成可复用栏目。PRINTFILM 用画面风格 + 口播结构承接这些栏目,让同一套卖点可以批量出片,而不是每条从零写起。',
+ },
+ {
+ title: '脚本与分镜:AI 出初稿,人确认再往下',
+ body: '主题或口播进入工作台后,沿分镜流水线拆镜、出图、配音、合成。AI 负责速度与结构一致;你负责改写语气、补行业细节,并在分镜确认后再继续生成——这一步决定了片子像不像你。',
+ },
+ {
+ title: '审核发布:人控阀不可跳过',
+ body: '每条成片对外发布前经过三道检查:事实性(数字、资质、价格是否与实际一致)、合规性(平台规则与广告法限制)、品牌语气(是否像你在说话)。审核通过后由你用自己的账号发布,我们不代发。',
+ },
+ ],
+ sopCalloutTitle: '为什么不让 AI 直接发',
+ sopCalloutBody:
+ '一是平台侧:主流平台对批量发布、自动化代发、非本人设备登录均有明确风控规则,代发带来的封号与限流风险最终由账号持有者承担。二是内容侧:AI 会自信地编造细节,没有人工审核的内容迟早出问题。所以流程里「人控阀」是硬环节,不因提速而省略。',
+ geoKicker: '02',
+ geoTitle: '二、和 GEO 怎么配合',
+ geoLead:
+ 'GEO(Generative Engine Optimization,生成式引擎优化)解决的是:当用户向大模型提问时,愿不愿意引用你、提到你。获客短视频解决的是:在抖音、小红书、视频号这些种草场景里,人能不能看见你。两者不是替代关系,是同一套品牌事实的两种表达。',
+ geoCards: [
+ {
+ title: '同一套事实,两种载体',
+ body: '官网、FAQ、对比表给生成式引擎摘取;短视频把同一口径改成钩子、口播和画面。口径不一致时,模型和平台都会降低信任。',
+ },
+ {
+ title: '短视频扩大可引用面',
+ body: '生成式引擎的来源不限于官网。公开的短视频、图文说明同样可能被纳入。多平台同步的是可核验表述,不是情绪化长文。',
+ },
+ {
+ title: 'GEO 做诊断,短视频做出片',
+ body: '品牌档案、知识库与命中监测在 GEO 侧完成;PRINTFILM 承接「能播的片子」。需要回到诊断与套餐时,从本页返回 GEO。',
+ },
+ {
+ title: '不做命中承诺',
+ body: 'GEO 见效周期通常以周计,且不是线性可控的排名机制。短视频也不承诺播放或线索。两边都按服务内容收费,不按结果对赌。',
+ },
+ ],
+ geoCalloutTitle: 'GEO 与获客短视频(一句话版本)',
+ geoCalloutBody:
+ 'GEO 优化的是「在 AI 生成的答案里被不被提到」,获客短视频优化的是「在种草场景里能不能被看完、被问价」。前者争引用,后者争触达。详见 GEO 站点的诊断与套餐说明。',
+ distKicker: '03',
+ distTitle: '三、多平台分发策略',
+ distLead:
+ '同一份核心卖点,在不同平台的表达方式是不同的。我们不做「一条视频全平台原样搬运」,而是按平台特性改钩子、封面与时长,同时把账号风险留给账号持有者自己控制。',
+ distTableCaption: '分发适配原则(通用参考,具体平台规则以官方最新说明为准)',
+ distTableHead: ['平台', '内容形态偏好', '适配重点', '发布主体'],
+ distRows: [
+ { platform: '抖音', form: '短视频 / 强钩子', focus: '前 3 秒钩子、节奏密度、评论区引导', owner: '你的自有账号' },
+ { platform: '小红书', form: '图文 / 中短视频', focus: '标题关键词、封面信息量、正文结构化', owner: '你的自有账号' },
+ { platform: '视频号', form: '短视频 / 直播切片', focus: '熟人关系链、本地属性、转发友好', owner: '你的自有账号' },
+ { platform: '知乎 / 公众号', form: '长文 / 干货', focus: '定义前置、FAQ、对比表,兼顾 GEO 引用', owner: '你的自有账号' },
+ { platform: 'B 站', form: '中长视频', focus: '体系化讲解、章节划分、信息密度', owner: '你的自有账号' },
+ ],
+ distCalloutTitle: '分发纪律',
+ distCalloutBody:
+ '全部内容由你自己的账号发布。PRINTFILM 只提供成片与结构建议;不使用 RPA 批量代发,不代持账号密码,不使用任何声称「绕过平台风控」的第三方工具。这条纪律的优先级高于效率。',
+ paceKicker: '04',
+ paceTitle: '四、成片节奏',
+ paceLead:
+ '工作台的作用不是「汇报成绩」,而是让你能按栏目持续出片,并把已完成的项目留在历史里对照。发布节奏、投放与私信回复仍由你自己决定。',
+ paceIncludeTitle: '工作台里能看到',
+ paceInclude: [
+ '项目清单(条数、画面风格、成片或图文模式)',
+ '生成状态(草稿 / 生成中 / 已完成)',
+ '分镜确认后再继续,避免未审脚本直接出片',
+ '单镜重绘、重生视频或重配音,不必整片重做',
+ '完成后下载或打包,用你的账号去发',
+ ],
+ paceExcludeTitle: '这里不提供',
+ paceExclude: [
+ '对播放量、涨粉或获客数量的预测与保证',
+ '未经授权搬运第三方平台后台数据',
+ '把单条内容的表现归因于某一个按钮或模型',
+ '以「行业平均」名义给出的未经核实对比',
+ ],
+ paceCalloutTitle: '和 GEO 月报怎么分工',
+ paceCalloutBody:
+ 'GEO 侧看的是品牌是否被模型提及、表述是否准确;PRINTFILM 侧看的是这一周有没有按栏目把片子做出来。两边对不上时,先改口径再改产量,而不是加一条更夸张的钩子。',
+ qcKicker: '05',
+ qcTitle: '五、人工质检与合规',
+ qcLead: '这部分决定了内容能不能长期稳定地发下去,是整个流程里最不能被 AI 替代的环节。',
+ qcCards: [
+ {
+ title: '事实检查',
+ body: '涉及价格、资质、服务范围、售后政策的每一处数字与表述,均以你提供的书面材料为准,不采信模型自行生成的内容。',
+ },
+ {
+ title: '广告法检查',
+ body: '不使用「最」「第一」「国家级」「保证」「根治」等绝对化或承诺性表述;涉医疗、金融、教育等强监管行业,需按对应法规额外加一道审查。',
+ },
+ {
+ title: 'AI 标识',
+ body: '按平台要求对 AI 生成或辅助生成的内容进行标识,标注方式以各平台最新规则为准。',
+ },
+ {
+ title: '账号隔离',
+ body: '每个账号下的项目与素材相互隔离。不要把 A 客户的口播模板直接套给 B 客户,避免串数据和串人设。',
+ },
+ ],
+ boundKicker: '06',
+ boundTitle: '六、能力边界(先说清楚不适合的情况)',
+ boundLead: '与其事后解释,不如事前说清。以下情况我们会直接告诉你「不建议做」或「需要前置条件」。',
+ boundItems: [
+ '要求承诺获客数量、播放量或成交金额——我们不做,也与按量计费的方式冲突。',
+ '需要代持账号密码、使用批量代发工具——不做,风控风险由账号持有者承担。',
+ '涉医疗、金融、教育等强监管行业,但无法提供合规资质与审核流程——需先补齐。',
+ '希望「一周见效」——内容与 GEO 都是累积型工作,见效周期以周为单位计。',
+ '无法提供任何业务资料、也无人确认分镜——AI 无法凭空生成可信的行业细节。',
+ ],
+ closeTitle: '从一条卖点开始出片',
+ closeBody: '进入工作台新建获客短视频;需要品牌诊断、知识库与模型命中,请回到 GEO。',
+ footAbout: 'PRINTFILM 提供获客短视频工作台:主题 / 口播 → 分镜 → 画面 → 成片。与 GEO 站点配合使用,不替代诊断与引用监测。',
+ footLegal:
+ '本页为方法论与能力说明,非客户背书,亦不构成任何效果承诺。服务按内容产能与实际上游用量收费,不承诺获客、播放、线索或成交结果。站内不使用绝对化用语,不展示未经授权的客户名称或案例数据。',
+ footCopy: 'PRINTFILM · 获客短视频',
+ jsonLdHeadline: 'PRINTFILM 获客短视频:内容生产 SOP、GEO 配套、多平台分发与人工质检',
+}
+
+const en: MethodLandingCopy = {
+ metaTitle: 'Lead-gen short video · PRINTFILM (SOP · GEO companion · distribution)',
+ metaDescription:
+ 'How PRINTFILM makes lead-gen short videos: a four-step SOP, how it pairs with GEO, multi-platform adaptation, and human review. Methodology only — no performance promises.',
+ kicker: 'Method',
+ title: 'Lead-gen short video',
+ ledeBefore: 'This page is about ',
+ ledeEm: 'how we make lead-gen shorts',
+ ledeAfter:
+ ': how content is produced, how it pairs with GEO, how it is adapted per platform, and how films are used. Read it to judge whether the process fits your industry.',
+ startCta: 'Start',
+ geoCta: 'Back to GEO',
+ brandLine: 'Lead-gen shorts · GEO companion',
+ skip: 'Skip to content',
+ noticeTitle: 'Read this first',
+ noticeBody:
+ 'This is a methodology and capability note, not a testimonial and not a performance promise. We do not show client names, case metrics, deal sizes, or reviews. PRINTFILM bills on actual upstream usage and does not promise leads, views, or sales. Timelines here are reference ranges.',
+ toc: [
+ { href: '#sop', label: 'Production SOP' },
+ { href: '#geo', label: 'How it pairs with GEO' },
+ { href: '#dist', label: 'Distribution' },
+ { href: '#pace', label: 'Shipping cadence' },
+ { href: '#qc', label: 'Human review' },
+ { href: '#bound', label: 'Boundaries' },
+ ],
+ sopKicker: '01',
+ sopTitle: '1. Production SOP',
+ sopLeadBefore: 'Lead-gen video is four steps, each with a clear input and output. The idea is: ',
+ sopLeadEm: 'let AI scale what can be scaled, and keep humans on what must be judged.',
+ sopSteps: [
+ {
+ title: 'Collect the offer: write down what you sell',
+ body: 'Inputs are product, price, service flow, objections, and category keywords. Output is a shootable topic list: pain points, comparisons, process explainers, price breakdowns. Demand first, studio second.',
+ note: 'Numbers and credentials come from your written materials. The model does not invent your price list.',
+ },
+ {
+ title: 'Break the pattern: turn “this could convert” into a template',
+ body: 'Split samples by title, first-three-second hook, pain, offer, and call to action. PRINTFILM holds those columns with a visual style plus narration structure so you can batch, not start from zero.',
+ },
+ {
+ title: 'Script and boards: AI drafts, you confirm before going on',
+ body: 'A topic or voiceover enters the studio, then storyboard, stills, voice, and compose. AI keeps pace and structure; you rewrite tone and confirm boards before the rest of the pipeline runs.',
+ },
+ {
+ title: 'Review and publish: the human gate is not optional',
+ body: 'Before anything goes public: facts (numbers, licenses, prices), compliance (platform rules and advertising law), and brand voice. You publish from your own accounts. We do not post for you.',
+ },
+ ],
+ sopCalloutTitle: 'Why AI does not publish',
+ sopCalloutBody:
+ 'Platforms restrict bulk posting, auto-publish, and login from non-owner devices; bans land on the account holder. Models also invent details with confidence. The human gate stays, even when it slows you down.',
+ geoKicker: '02',
+ geoTitle: '2. How it pairs with GEO',
+ geoLead:
+ 'GEO (Generative Engine Optimization) asks whether models will cite you. Lead-gen shorts ask whether people will see you on Douyin, Xiaohongshu, and video accounts. Same brand facts, two expressions — not substitutes.',
+ geoCards: [
+ {
+ title: 'One set of facts, two carriers',
+ body: 'Site copy, FAQs, and comparison tables for generative engines; shorts for hooks, voiceover, and picture. Inconsistent claims cost trust in both places.',
+ },
+ {
+ title: 'Video widens what can be cited',
+ body: 'Engines do not only read your homepage. Public shorts and captions can be included too. We sync verifiable claims, not hype essays.',
+ },
+ {
+ title: 'GEO diagnoses, PRINTFILM ships film',
+ body: 'Brand files, knowledge bases, and mention checks live on the GEO side. PRINTFILM ships playable films. Return to GEO for diagnosis and plans.',
+ },
+ {
+ title: 'No mention guarantees',
+ body: 'GEO usually takes weeks and is not a controllable ranking. Shorts do not promise views or leads. Both bill for work done, not for outcomes.',
+ },
+ ],
+ geoCalloutTitle: 'GEO vs lead-gen video (one line)',
+ geoCalloutBody:
+ 'GEO is “are you in the AI answer?” Lead-gen video is “can someone finish the clip and ask a price?” One fights citation, the other fights attention. See the GEO site for diagnosis and plans.',
+ distKicker: '03',
+ distTitle: '3. Multi-platform distribution',
+ distLead:
+ 'The same offer should not be copy-pasted across apps. We adapt hook, cover, and length per platform, and we leave account risk with the account owner.',
+ distTableCaption: 'Adaptation notes (generic; follow each platform’s current rules)',
+ distTableHead: ['Platform', 'Format', 'Focus', 'Who posts'],
+ distRows: [
+ { platform: 'Douyin', form: 'Short / strong hook', focus: 'First 3 seconds, pace, comment CTA', owner: 'Your account' },
+ { platform: 'Xiaohongshu', form: 'Carousel / mid-short', focus: 'Title keywords, cover density, structure', owner: 'Your account' },
+ { platform: 'Channels', form: 'Short / live cuts', focus: 'Social graph, local, easy to forward', owner: 'Your account' },
+ { platform: 'Zhihu / WeChat', form: 'Long-form', focus: 'Definition first, FAQ, tables for GEO', owner: 'Your account' },
+ { platform: 'Bilibili', form: 'Mid-long', focus: 'Chapters, density, systematic explainers', owner: 'Your account' },
+ ],
+ distCalloutTitle: 'Distribution rules',
+ distCalloutBody:
+ 'You post from your own accounts. PRINTFILM supplies films and structure notes. No RPA bulk posting, no holding passwords, no “bypass the risk engine” tools. This rule outranks speed.',
+ paceKicker: '04',
+ paceTitle: '4. Shipping cadence',
+ paceLead:
+ 'The studio is not a scoreboard. It lets you keep shipping by column and keep finished projects in History. Cadence, ads, and DMs stay yours.',
+ paceIncludeTitle: 'What you can see',
+ paceInclude: [
+ 'Project list (count, look, full film vs stills-to-film)',
+ 'Status (draft / running / done)',
+ 'Confirm boards before the rest of the pipeline',
+ 'Regenerate a still, clip, or voice track without remaking the film',
+ 'Download or pack when done, then post from your account',
+ ],
+ paceExcludeTitle: 'What we do not provide',
+ paceExclude: [
+ 'Forecasts or guarantees of views, followers, or leads',
+ 'Copying third-party analytics without your permission',
+ 'Blaming a single button or model for one clip’s result',
+ 'Unverified “industry average” comparisons',
+ ],
+ paceCalloutTitle: 'How this splits from GEO reporting',
+ paceCalloutBody:
+ 'GEO asks whether models mention you and describe you accurately. PRINTFILM asks whether this week’s films actually shipped. When they disagree, fix the claims before you add volume.',
+ qcKicker: '05',
+ qcTitle: '5. Human review and compliance',
+ qcLead: 'This is what lets you keep posting. It is the part AI cannot replace.',
+ qcCards: [
+ {
+ title: 'Facts',
+ body: 'Every number on price, license, scope, and after-sales comes from your written materials — not from the model.',
+ },
+ {
+ title: 'Advertising law',
+ body: 'No superlatives or cure-all promises. Medical, finance, and education need an extra review against the relevant rules.',
+ },
+ {
+ title: 'AI labeling',
+ body: 'Label AI-generated or AI-assisted work as each platform currently requires.',
+ },
+ {
+ title: 'Account isolation',
+ body: 'Projects stay in the account that made them. Do not paste Client A’s voiceover onto Client B.',
+ },
+ ],
+ boundKicker: '06',
+ boundTitle: '6. Boundaries (what we will not do)',
+ boundLead: 'Better to say this up front. We will decline or require preconditions when:',
+ boundItems: [
+ 'You want guaranteed leads, views, or revenue — we do not, and it conflicts with usage billing.',
+ 'You want us to hold passwords or bulk-post — we do not; platform risk sits with the account owner.',
+ 'You are in a tightly regulated category without licenses or a review process — fix that first.',
+ 'You expect results in a week — both content and GEO accumulate over weeks.',
+ 'You cannot provide any business facts or confirm boards — the model cannot invent credible detail.',
+ ],
+ closeTitle: 'Start from one offer',
+ closeBody: 'Open the studio to make a lead-gen short. For brand diagnosis, knowledge base, and model mentions, go back to GEO.',
+ footAbout:
+ 'PRINTFILM is a lead-gen short-video studio: topic / voiceover → boards → picture → film. It pairs with the GEO site; it does not replace diagnosis or citation monitoring.',
+ footLegal:
+ 'Methodology and capability only — not a testimonial, not a performance promise. We bill for content capacity and actual upstream usage. No guarantees of leads, views, or sales. No superlatives. No unauthorized client names or case data.',
+ footCopy: 'PRINTFILM · Lead-gen short video',
+ jsonLdHeadline: 'PRINTFILM lead-gen short video: production SOP, GEO companion, distribution, and human review',
+}
+
+export const METHOD_LANDING: Record<'zh' | 'en', MethodLandingCopy> = { zh, en }
diff --git a/frontend/src/pages/HomePage.tsx b/frontend/src/pages/HomePage.tsx
index 6ddf04a..3d099ae 100644
--- a/frontend/src/pages/HomePage.tsx
+++ b/frontend/src/pages/HomePage.tsx
@@ -210,6 +210,7 @@ export default function HomePage() {
<nav className="pf-land-foot-nav" aria-label={t('home.footNav')}>
<Link to="/drama">{t('nav.drama')}</Link>
<Link to="/history">{t('nav.kepu')}</Link>
+ <Link to="/method">{t('home.methodLink')}</Link>
<Link to="/tools">{t('nav.tools')}</Link>
<Link to="/pricing">{t('nav.pricing')}</Link>
<Link to="/help">{t('nav.help')}</Link>
diff --git a/frontend/src/pages/MethodPage.tsx b/frontend/src/pages/MethodPage.tsx
new file mode 100644
index 0000000..f2ed337
--- /dev/null
+++ b/frontend/src/pages/MethodPage.tsx
@@ -0,0 +1,282 @@
+/** 获客短视频宣传页:方法论结构 + 开始使用 / 回到 GEO */
+import { useEffect, type ReactNode } from 'react'
+import { ArrowRight, ArrowUpRight } from 'lucide-react'
+import LanguageSwitch from '../components/layout/LanguageSwitch'
+import { useI18n } from '../i18n'
+import {
+ METHOD_GEO_URL,
+ METHOD_LANDING,
+ METHOD_START_URL,
+ type MethodLandingCopy,
+} from '../lib/methodLanding'
+import './method/method.css'
+
+const PAGE_URL = 'https://www.printfilm.com/method'
+
+// 注入本页 title / description;延迟一拍以免被 I18nProvider 的默认 meta 覆盖
+function useMethodMeta(copy: MethodLandingCopy) {
+ useEffect(() => {
+ const descEl = document.querySelector('meta[name="description"]')
+ const prevTitle = document.title
+ const prevDesc = descEl?.getAttribute('content')
+
+ // 写入宣传页 SEO 文案
+ function apply() {
+ document.title = copy.metaTitle
+ descEl?.setAttribute('content', copy.metaDescription)
+ }
+
+ apply()
+ const timer = window.setTimeout(apply, 0)
+ return () => {
+ window.clearTimeout(timer)
+ document.title = prevTitle
+ if (descEl && prevDesc) descEl.setAttribute('content', prevDesc)
+ }
+ }, [copy.metaTitle, copy.metaDescription])
+}
+
+// 外链按钮:开始使用 / 回到 GEO
+function MethodCta({
+ href,
+ className,
+ children,
+}: {
+ href: string
+ className: string
+ children: ReactNode
+}) {
+ return (
+ <a className={className} href={href} rel="noopener noreferrer">
+ {children}
+ </a>
+ )
+}
+
+/** 获客短视频宣传页主体:方法论章节 + 双 CTA */
+export default function MethodPage() {
+ const { locale } = useI18n()
+ const copy = METHOD_LANDING[locale]
+ useMethodMeta(copy)
+
+ const jsonLd = {
+ '@context': 'https://schema.org',
+ '@type': 'Article',
+ headline: copy.jsonLdHeadline,
+ description: copy.metaDescription,
+ inLanguage: locale === 'zh' ? 'zh-CN' : 'en',
+ author: { '@type': 'Organization', name: 'PRINTFILM' },
+ publisher: { '@type': 'Organization', name: 'PRINTFILM' },
+ mainEntityOfPage: { '@type': 'WebPage', '@id': PAGE_URL },
+ about: copy.toc.map((item) => ({ '@type': 'Thing', name: item.label })),
+ }
+
+ return (
+ <div className="pf-method">
+ <script type="application/ld+json">{JSON.stringify(jsonLd)}</script>
+ <a className="pf-method-skip" href="#method-main">
+ {copy.skip}
+ </a>
+
+ <header className="pf-method-nav">
+ <a className="pf-method-brand" href={METHOD_START_URL} rel="noopener noreferrer">
+ <img src="/logo.svg" alt="" />
+ <span className="pf-method-word">
+ <strong>PRINTFILM</strong>
+ <span>{copy.brandLine}</span>
+ </span>
+ </a>
+ <div className="pf-method-nav-actions">
+ <LanguageSwitch />
+ <MethodCta href={METHOD_START_URL} className="pf-method-btn is-lime">
+ {copy.startCta}
+ <ArrowRight size={15} strokeWidth={2.2} aria-hidden />
+ </MethodCta>
+ <MethodCta href={METHOD_GEO_URL} className="pf-method-btn is-ghost">
+ {copy.geoCta}
+ <ArrowUpRight size={15} strokeWidth={2.2} aria-hidden />
+ </MethodCta>
+ </div>
+ </header>
+
+ <main className="pf-method-main" id="method-main">
+ <section className="pf-method-hero">
+ <p className="pf-method-kicker">{copy.kicker}</p>
+ <h1>{copy.title}</h1>
+ <p className="pf-method-lede">
+ {copy.ledeBefore}
+ <em>{copy.ledeEm}</em>
+ {copy.ledeAfter}
+ </p>
+ </section>
+
+ <aside className="pf-method-notice">
+ <strong>{copy.noticeTitle}</strong>
+ <p>{copy.noticeBody}</p>
+ </aside>
+
+ <ul className="pf-method-toc">
+ {copy.toc.map((item) => (
+ <li key={item.href}>
+ <a href={item.href}>{item.label}</a>
+ </li>
+ ))}
+ </ul>
+
+ <section className="pf-method-section" id="sop">
+ <p className="pf-method-kicker">{copy.sopKicker}</p>
+ <h2>{copy.sopTitle}</h2>
+ <p className="pf-method-lead">
+ {copy.sopLeadBefore}
+ <em>{copy.sopLeadEm}</em>
+ </p>
+ <ol className="pf-method-steps">
+ {copy.sopSteps.map((step) => (
+ <li key={step.title}>
+ <h3>{step.title}</h3>
+ <p>{step.body}</p>
+ {step.note ? <p className="pf-method-note">{step.note}</p> : null}
+ </li>
+ ))}
+ </ol>
+ <aside className="pf-method-callout">
+ <strong>{copy.sopCalloutTitle}</strong>
+ <p>{copy.sopCalloutBody}</p>
+ </aside>
+ </section>
+
+ <section className="pf-method-section" id="geo">
+ <p className="pf-method-kicker">{copy.geoKicker}</p>
+ <h2>{copy.geoTitle}</h2>
+ <p className="pf-method-lead">{copy.geoLead}</p>
+ <div className="pf-method-grid">
+ {copy.geoCards.map((card) => (
+ <article key={card.title}>
+ <h3>{card.title}</h3>
+ <p>{card.body}</p>
+ </article>
+ ))}
+ </div>
+ <aside className="pf-method-callout">
+ <strong>{copy.geoCalloutTitle}</strong>
+ <p>{copy.geoCalloutBody}</p>
+ </aside>
+ </section>
+
+ <section className="pf-method-section" id="dist">
+ <p className="pf-method-kicker">{copy.distKicker}</p>
+ <h2>{copy.distTitle}</h2>
+ <p className="pf-method-lead">{copy.distLead}</p>
+ <div className="pf-method-table-wrap">
+ <table className="pf-method-table">
+ <caption className="pf-method-caption">{copy.distTableCaption}</caption>
+ <thead>
+ <tr>
+ {copy.distTableHead.map((head) => (
+ <th key={head} scope="col">
+ {head}
+ </th>
+ ))}
+ </tr>
+ </thead>
+ <tbody>
+ {copy.distRows.map((row) => (
+ <tr key={row.platform}>
+ <th scope="row">{row.platform}</th>
+ <td>{row.form}</td>
+ <td>{row.focus}</td>
+ <td>{row.owner}</td>
+ </tr>
+ ))}
+ </tbody>
+ </table>
+ </div>
+ <aside className="pf-method-callout">
+ <strong>{copy.distCalloutTitle}</strong>
+ <p>{copy.distCalloutBody}</p>
+ </aside>
+ </section>
+
+ <section className="pf-method-section" id="pace">
+ <p className="pf-method-kicker">{copy.paceKicker}</p>
+ <h2>{copy.paceTitle}</h2>
+ <p className="pf-method-lead">{copy.paceLead}</p>
+ <div className="pf-method-split">
+ <section>
+ <h3>{copy.paceIncludeTitle}</h3>
+ <ul>
+ {copy.paceInclude.map((item) => (
+ <li key={item}>{item}</li>
+ ))}
+ </ul>
+ </section>
+ <section>
+ <h3>{copy.paceExcludeTitle}</h3>
+ <ul>
+ {copy.paceExclude.map((item) => (
+ <li key={item}>{item}</li>
+ ))}
+ </ul>
+ </section>
+ </div>
+ <aside className="pf-method-callout">
+ <strong>{copy.paceCalloutTitle}</strong>
+ <p>{copy.paceCalloutBody}</p>
+ </aside>
+ </section>
+
+ <section className="pf-method-section" id="qc">
+ <p className="pf-method-kicker">{copy.qcKicker}</p>
+ <h2>{copy.qcTitle}</h2>
+ <p className="pf-method-lead">{copy.qcLead}</p>
+ <div className="pf-method-grid">
+ {copy.qcCards.map((card) => (
+ <article key={card.title}>
+ <h3>{card.title}</h3>
+ <p>{card.body}</p>
+ </article>
+ ))}
+ </div>
+ </section>
+
+ <section className="pf-method-section" id="bound">
+ <p className="pf-method-kicker">{copy.boundKicker}</p>
+ <h2>{copy.boundTitle}</h2>
+ <p className="pf-method-lead">{copy.boundLead}</p>
+ <ul className="pf-method-bound">
+ {copy.boundItems.map((item) => (
+ <li key={item}>{item}</li>
+ ))}
+ </ul>
+ </section>
+
+ <section className="pf-method-close">
+ <div>
+ <h2>{copy.closeTitle}</h2>
+ <p>{copy.closeBody}</p>
+ </div>
+ <div className="pf-method-cta">
+ <MethodCta href={METHOD_START_URL} className="pf-method-btn is-lime is-lg">
+ {copy.startCta}
+ <ArrowRight size={16} strokeWidth={2.2} aria-hidden />
+ </MethodCta>
+ <MethodCta href={METHOD_GEO_URL} className="pf-method-btn is-ghost is-lg">
+ {copy.geoCta}
+ <ArrowUpRight size={16} strokeWidth={2.2} aria-hidden />
+ </MethodCta>
+ </div>
+ </section>
+ </main>
+
+ <footer className="pf-method-foot">
+ <div className="pf-method-foot-inner">
+ <p className="pf-method-copy">
+ © {new Date().getFullYear()} {copy.footCopy}
+ </p>
+ <p>{copy.footAbout}</p>
+ <p>{copy.footLegal}</p>
+ </div>
+ </footer>
+ </div>
+ )
+}
diff --git a/frontend/src/pages/drama/drama.css b/frontend/src/pages/drama/drama.css
index c2f79a5..0542bba 100644
--- a/frontend/src/pages/drama/drama.css
+++ b/frontend/src/pages/drama/drama.css
@@ -5920,7 +5920,8 @@
.drama-ep-fail-reason-pop {
position: fixed;
right: 24px;
- bottom: 96px;
+ /* 在生成队列 FAB(bottom:96)与微信加群钮之上 */
+ bottom: 168px;
z-index: 80;
width: min(380px, calc(100vw - 32px));
max-height: min(70vh, 520px);
@@ -6400,7 +6401,8 @@
.drama-gen-fab-root {
position: fixed;
right: 20px;
- bottom: 24px;
+ /* 抬高,避免挡住全站微信加群浮钮 */
+ bottom: 96px;
z-index: 90;
display: flex;
flex-direction: column;
diff --git a/frontend/src/pages/method/method.css b/frontend/src/pages/method/method.css
new file mode 100644
index 0000000..5361c72
--- /dev/null
+++ b/frontend/src/pages/method/method.css
@@ -0,0 +1,526 @@
+/* 获客短视频宣传页:亮色纸面 + PRINTFILM 酸橙点缀 */
+
+.pf-method {
+ --m-bg: #f7f8fa;
+ --m-panel: #ffffff;
+ --m-line: rgba(17, 19, 24, 0.12);
+ --m-line-soft: rgba(17, 19, 24, 0.08);
+ --m-txt: #111318;
+ --m-soft: #4b5563;
+ --m-muted: #6b7280;
+ --m-lime: #b6ff00;
+ --m-lime-ink: #111318;
+ --m-lime-deep: #5f8f00;
+ --m-warn: #c67a12;
+ min-height: 100vh;
+ min-height: 100dvh;
+ background:
+ radial-gradient(900px 420px at 8% -10%, rgba(182, 255, 0, 0.22), transparent 55%),
+ radial-gradient(640px 320px at 100% 0%, rgba(182, 255, 0, 0.12), transparent 50%),
+ var(--m-bg);
+ color: var(--m-txt);
+ font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
+}
+
+.pf-method a {
+ color: var(--m-lime-deep);
+}
+
+.pf-method-skip {
+ position: absolute;
+ left: -999px;
+ top: 0;
+ z-index: 80;
+ padding: 0.55rem 0.9rem;
+ background: var(--m-lime);
+ color: var(--m-lime-ink);
+ font-weight: 700;
+}
+
+.pf-method-skip:focus {
+ left: 12px;
+ top: 12px;
+}
+
+.pf-method-nav {
+ position: sticky;
+ top: 0;
+ z-index: 40;
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+ gap: 1rem;
+ min-height: 64px;
+ padding: 0.7rem 1.4rem;
+ background: rgba(247, 248, 250, 0.92);
+ border-bottom: 1px solid var(--m-line-soft);
+ backdrop-filter: blur(14px);
+}
+
+.pf-method a.pf-method-brand {
+ display: flex;
+ align-items: center;
+ gap: 0.7rem;
+ min-width: 0;
+ color: var(--m-txt);
+ text-decoration: none;
+}
+
+.pf-method a.pf-method-brand:hover {
+ color: var(--m-txt);
+}
+
+.pf-method-brand img {
+ width: 28px;
+ height: 28px;
+ flex-shrink: 0;
+}
+
+.pf-method-word {
+ display: flex;
+ flex-direction: column;
+ min-width: 0;
+}
+
+.pf-method-word strong {
+ font-family: 'Space Grotesk', 'Noto Sans SC', sans-serif;
+ font-size: 0.95rem;
+ letter-spacing: 0.04em;
+}
+
+.pf-method-word span {
+ color: var(--m-muted);
+ font-size: 0.72rem;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.pf-method-nav-actions {
+ display: flex;
+ align-items: center;
+ gap: 0.55rem;
+ flex-shrink: 0;
+}
+
+.pf-method-nav .pf-nav-lang {
+ border-color: var(--m-line);
+ background: #fff;
+}
+
+.pf-method-btn {
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ gap: 0.35rem;
+ min-height: 40px;
+ padding: 0 0.95rem;
+ border-radius: 999px;
+ font-size: 0.88rem;
+ font-weight: 700;
+ text-decoration: none;
+ white-space: nowrap;
+ transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
+}
+
+.pf-method-btn:hover {
+ transform: translateY(-1px);
+}
+
+.pf-method-btn.is-lime {
+ background: var(--m-lime);
+ color: var(--m-lime-ink);
+ box-shadow: 0 8px 24px rgba(182, 255, 0, 0.18);
+}
+
+.pf-method-btn.is-ghost {
+ border: 1px solid var(--m-line);
+ background: #fff;
+ color: var(--m-txt);
+}
+
+.pf-method-btn.is-ghost:hover {
+ color: var(--m-txt);
+ background: #f4ffd6;
+}
+
+.pf-method-btn.is-lg {
+ min-height: 48px;
+ padding: 0 1.25rem;
+ font-size: 0.95rem;
+}
+
+.pf-method-main {
+ width: min(1120px, calc(100% - 2rem));
+ margin: 0 auto;
+ padding: 2.4rem 0 4.5rem;
+}
+
+.pf-method-hero {
+ max-width: 44rem;
+ padding: 1.2rem 0 2rem;
+}
+
+.pf-method-kicker {
+ margin: 0 0 0.7rem;
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 0.78rem;
+ font-weight: 600;
+ letter-spacing: 0.16em;
+ text-transform: uppercase;
+ color: var(--m-lime-deep);
+}
+
+.pf-method-hero h1 {
+ margin: 0 0 1rem;
+ font-family: 'Noto Serif SC', 'Noto Sans SC', serif;
+ font-size: clamp(2.3rem, 6vw, 3.6rem);
+ font-weight: 700;
+ letter-spacing: -0.03em;
+ line-height: 1.12;
+}
+
+.pf-method-lede {
+ margin: 0;
+ color: var(--m-soft);
+ font-size: 1.08rem;
+ line-height: 1.75;
+}
+
+.pf-method-lede em {
+ font-style: normal;
+ color: var(--m-txt);
+ font-weight: 650;
+ box-shadow: inset 0 -0.42em 0 rgba(182, 255, 0, 0.28);
+}
+
+.pf-method-notice,
+.pf-method-callout {
+ margin: 0 0 1.6rem;
+ padding: 1.05rem 1.15rem;
+ border-radius: 16px;
+ border: 1px solid var(--m-line-soft);
+ background: var(--m-panel);
+}
+
+.pf-method-notice {
+ border-color: rgba(198, 122, 18, 0.28);
+ background: #fff8ec;
+}
+
+.pf-method-notice strong,
+.pf-method-callout strong {
+ display: block;
+ margin-bottom: 0.4rem;
+ font-size: 0.92rem;
+}
+
+.pf-method-notice p,
+.pf-method-callout p {
+ margin: 0;
+ color: var(--m-soft);
+ line-height: 1.7;
+}
+
+.pf-method-toc {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.55rem;
+ margin: 0 0 2.6rem;
+ padding: 0;
+ list-style: none;
+}
+
+.pf-method-toc a {
+ display: inline-flex;
+ padding: 0.4rem 0.75rem;
+ border-radius: 999px;
+ border: 1px solid var(--m-line);
+ background: #fff;
+ color: var(--m-soft);
+ text-decoration: none;
+ font-size: 0.86rem;
+}
+
+.pf-method-toc a:hover {
+ border-color: #7ab800;
+ color: var(--m-txt);
+ background: #f4ffd6;
+}
+
+.pf-method-section {
+ margin: 0 0 2.8rem;
+ padding-top: 0.4rem;
+ scroll-margin-top: 84px;
+}
+
+.pf-method-section > h2 {
+ margin: 0 0 0.85rem;
+ font-family: 'Noto Serif SC', serif;
+ font-size: clamp(1.45rem, 3vw, 1.85rem);
+ letter-spacing: -0.02em;
+}
+
+.pf-method-lead {
+ margin: 0 0 1.2rem;
+ max-width: 46rem;
+ color: var(--m-soft);
+ line-height: 1.75;
+}
+
+.pf-method-lead em {
+ font-style: normal;
+ color: var(--m-txt);
+ font-weight: 650;
+}
+
+.pf-method-steps {
+ margin: 0;
+ padding: 0;
+ list-style: none;
+ display: grid;
+ gap: 0.85rem;
+}
+
+.pf-method-steps li {
+ position: relative;
+ padding: 1.15rem 1.2rem 1.15rem 4.1rem;
+ border-radius: 16px;
+ border: 1px solid var(--m-line-soft);
+ background: var(--m-panel);
+}
+
+.pf-method-steps li::before {
+ content: counter(step);
+ counter-increment: step;
+ position: absolute;
+ left: 1.1rem;
+ top: 1.2rem;
+ font-family: 'Space Grotesk', sans-serif;
+ font-size: 1.05rem;
+ font-weight: 700;
+ color: var(--m-lime-deep);
+}
+
+.pf-method-steps {
+ counter-reset: step;
+}
+
+.pf-method-steps h3 {
+ margin: 0 0 0.4rem;
+ font-size: 1.05rem;
+}
+
+.pf-method-steps p,
+.pf-method-note {
+ margin: 0;
+ color: var(--m-soft);
+ line-height: 1.7;
+}
+
+.pf-method-note {
+ margin-top: 0.55rem;
+ font-size: 0.88rem;
+ color: var(--m-muted);
+}
+
+.pf-method-grid {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 0.85rem;
+}
+
+.pf-method-grid article {
+ padding: 1.1rem 1.15rem;
+ border-radius: 16px;
+ border: 1px solid var(--m-line-soft);
+ background: var(--m-panel);
+}
+
+.pf-method-grid h3 {
+ margin: 0 0 0.4rem;
+ font-size: 1rem;
+}
+
+.pf-method-grid p {
+ margin: 0;
+ color: var(--m-soft);
+ line-height: 1.65;
+}
+
+.pf-method-table-wrap {
+ overflow-x: auto;
+ margin: 0 0 1rem;
+ border: 1px solid var(--m-line-soft);
+ border-radius: 16px;
+ background: var(--m-panel);
+}
+
+.pf-method-table {
+ width: 100%;
+ min-width: 640px;
+ border-collapse: collapse;
+ font-size: 0.9rem;
+}
+
+.pf-method-caption {
+ caption-side: top;
+ text-align: left;
+ padding: 0.9rem 1rem 0.4rem;
+ color: var(--m-muted);
+ font-size: 0.82rem;
+}
+
+.pf-method-table th,
+.pf-method-table td {
+ padding: 0.75rem 1rem;
+ text-align: left;
+ border-top: 1px solid var(--m-line-soft);
+ vertical-align: top;
+}
+
+.pf-method-table th {
+ color: var(--m-muted);
+ font-weight: 650;
+ font-size: 0.78rem;
+ letter-spacing: 0.04em;
+}
+
+.pf-method-split {
+ display: grid;
+ grid-template-columns: repeat(2, minmax(0, 1fr));
+ gap: 0.85rem;
+ margin-bottom: 1rem;
+}
+
+.pf-method-split section {
+ padding: 1.1rem 1.15rem;
+ border-radius: 16px;
+ border: 1px solid var(--m-line-soft);
+ background: var(--m-panel);
+}
+
+.pf-method-split h3 {
+ margin: 0 0 0.65rem;
+ font-size: 0.98rem;
+}
+
+.pf-method-split ul {
+ margin: 0;
+ padding-left: 1.1rem;
+ color: var(--m-soft);
+ line-height: 1.7;
+}
+
+.pf-method-bound {
+ margin: 0;
+ padding-left: 1.15rem;
+ color: var(--m-soft);
+ line-height: 1.75;
+}
+
+.pf-method-bound li + li {
+ margin-top: 0.45rem;
+}
+
+.pf-method-close {
+ display: flex;
+ align-items: flex-end;
+ justify-content: space-between;
+ gap: 1.4rem;
+ padding: 1.6rem 1.5rem;
+ border-radius: 22px;
+ border: 1px solid rgba(182, 255, 0, 0.55);
+ background: linear-gradient(135deg, #f4ffd6 0%, #ffffff 70%);
+}
+
+.pf-method-close h2 {
+ margin: 0 0 0.45rem;
+ font-family: 'Noto Serif SC', serif;
+ font-size: 1.45rem;
+}
+
+.pf-method-close p {
+ margin: 0;
+ color: var(--m-soft);
+ max-width: 36rem;
+}
+
+.pf-method-cta {
+ display: flex;
+ flex-wrap: wrap;
+ gap: 0.65rem;
+}
+
+.pf-method-foot {
+ border-top: 1px solid var(--m-line-soft);
+ padding: 2rem 1.4rem 2.6rem;
+}
+
+.pf-method-foot-inner {
+ width: min(1120px, 100%);
+ margin: 0 auto;
+ display: grid;
+ gap: 0.85rem;
+}
+
+.pf-method-foot p {
+ margin: 0;
+ color: var(--m-muted);
+ font-size: 0.86rem;
+ line-height: 1.7;
+ max-width: 52rem;
+}
+
+.pf-method-copy {
+ color: var(--m-soft) !important;
+ font-family: 'Space Grotesk', sans-serif;
+}
+
+@media (max-width: 820px) {
+ .pf-method-nav-actions .pf-nav-lang {
+ display: none;
+ }
+
+ .pf-method-grid,
+ .pf-method-split,
+ .pf-method-close {
+ grid-template-columns: 1fr;
+ flex-direction: column;
+ align-items: stretch;
+ }
+
+ .pf-method-steps li {
+ padding-left: 1.15rem;
+ padding-top: 2.4rem;
+ }
+
+ .pf-method-steps li::before {
+ top: 0.85rem;
+ }
+}
+
+@media (max-width: 560px) {
+ .pf-method-word span {
+ display: none;
+ }
+
+ .pf-method-btn {
+ padding: 0 0.75rem;
+ font-size: 0.82rem;
+ }
+
+ .pf-method-main {
+ width: min(1120px, calc(100% - 1.25rem));
+ }
+}
+
+@media (prefers-reduced-motion: reduce) {
+ .pf-method-btn {
+ transition: none;
+ }
+
+ .pf-method-btn:hover {
+ transform: none;
+ }
+}
diff --git a/frontend/src/pages/studio/CreateProjectPage.tsx b/frontend/src/pages/studio/CreateProjectPage.tsx
index c18a695..dbee8b4 100644
--- a/frontend/src/pages/studio/CreateProjectPage.tsx
+++ b/frontend/src/pages/studio/CreateProjectPage.tsx
@@ -17,6 +17,41 @@ type Inspiration = {
}
const INSPIRATION_POOL: Inspiration[] = [
+ {
+ title: '到店打卡怎么拍',
+ theme: '把一家本地店的卖点做成抖音获客口播:前3秒钩子、场景、1-2个体验、到店号召。只写已知事实。',
+ script:
+ '路过这条街十次,这次才走进去。\n\n' +
+ '店面不大,招牌清楚,位置就在地铁口附近。\n\n' +
+ '我点了他们家主打那一项,口感按我自己的感受来:味道正、上桌快。\n\n' +
+ '想试的话,按店里现有套餐自己看,别听绝对化承诺。',
+ },
+ {
+ title: '闺蜜安利一篇笔记',
+ theme: '小红书获客安利:钩子标题、第一印象、分点真实体验、推荐给谁。卖点只作客观陈述。',
+ script:
+ '本来只是路过,结果在店里坐了很久。\n\n' +
+ '第一印象是光线干净、座位不挤。\n\n' +
+ '我点了招牌,份量如实说;环境安静,适合聊天。\n\n' +
+ '更适合想慢慢坐的人;赶时间的可以先看套餐再决定。',
+ },
+ {
+ title: '口碑拆解给决策',
+ theme: '点评式获客讲解:总体评价、环境服务、推荐项带理由、性价比、适合谁。没写的价格不要猜。',
+ script:
+ '总体感受:干净、流程清楚,适合第一次来的人。\n\n' +
+ '环境通透,服务员会主动说明怎么选。\n\n' +
+ '推荐他们家主打项目,理由是我当场体验过、步骤好懂。\n\n' +
+ '人均以店内公示为准。带朋友来比一个人更合适。',
+ },
+ {
+ title: '熟人圈轻推荐',
+ theme: '朋友圈获客短片:一句真实感受、一个具体细节、一句轻推荐。克制,不像广告。',
+ script:
+ '今天路过顺路坐了一会儿,比想象中安静。\n\n' +
+ '窗边那张桌子有自然光,适合歇脚。\n\n' +
+ '你们要是附近,可以自己去看看。',
+ },
{
title: '黑洞是如何形成的',
theme: '黑洞是如何形成的?用通俗方式讲清恒星坍缩、事件视界与时空弯曲,面向中学生。',
@@ -200,6 +235,7 @@ export default function CreateProjectPage() {
const inspTotal = Math.ceil(INSPIRATION_POOL.length / PAGE_SIZE)
const inspirations = INSPIRATION_POOL.slice(inspPage * PAGE_SIZE, inspPage * PAGE_SIZE + PAGE_SIZE)
+ // 把灵感示例填进主题/文案,并同步短标题
function applyInspiration(item: Inspiration) {
if (sourceType === 'script') {
setInputTab('粘贴完整文案')
diff --git a/frontend/src/styles/printfilm.css b/frontend/src/styles/printfilm.css
index 3e923f4..1f1d5a9 100644
--- a/frontend/src/styles/printfilm.css
+++ b/frontend/src/styles/printfilm.css
@@ -7077,3 +7077,138 @@ button.pf-shot-editable:disabled {
justify-content: flex-start;
}
}
+
+/* ——— WeChat group FAB (全站右下角) ——— */
+.pf-wx-fab-root {
+ position: fixed;
+ right: 20px;
+ bottom: 24px;
+ z-index: 88;
+ display: flex;
+ flex-direction: column;
+ align-items: flex-end;
+ gap: 10px;
+ pointer-events: none;
+}
+
+.pf-wx-fab-btn,
+.pf-wx-fab-panel,
+.pf-wx-fab-close {
+ pointer-events: auto;
+}
+
+.pf-wx-fab-btn {
+ display: inline-flex;
+ align-items: center;
+ gap: 0.4rem;
+ height: 48px;
+ padding: 0 0.95rem 0 0.85rem;
+ border: 0;
+ border-radius: 999px;
+ background: #07c160;
+ color: #fff;
+ cursor: pointer;
+ font: inherit;
+ font-size: 0.88rem;
+ font-weight: 650;
+ box-shadow: 0 10px 28px rgba(7, 193, 96, 0.35);
+ transition: transform 0.15s ease, background 0.15s ease;
+}
+
+.pf-wx-fab-btn:hover {
+ background: #06ad56;
+ transform: translateY(-1px);
+}
+
+.pf-wx-fab-btn.is-open {
+ background: #05964b;
+}
+
+.pf-wx-fab-label {
+ letter-spacing: 0.02em;
+}
+
+.pf-wx-fab-panel {
+ width: min(280px, calc(100vw - 2.5rem));
+ padding: 0.9rem 0.95rem 1rem;
+ border-radius: 16px;
+ background: #fff;
+ border: 1px solid var(--pf-line);
+ box-shadow: 0 16px 40px rgba(17, 19, 24, 0.14);
+}
+
+.pf-wx-fab-head {
+ display: flex;
+ align-items: flex-start;
+ justify-content: space-between;
+ gap: 0.5rem;
+ margin-bottom: 0.65rem;
+}
+
+.pf-wx-fab-head strong {
+ display: block;
+ font-size: 0.95rem;
+ font-weight: 700;
+ color: var(--pf-ink);
+}
+
+.pf-wx-fab-head p {
+ margin: 0.2rem 0 0;
+ font-size: 0.78rem;
+ color: var(--pf-muted);
+ line-height: 1.35;
+}
+
+.pf-wx-fab-close {
+ flex-shrink: 0;
+ display: grid;
+ place-items: center;
+ width: 28px;
+ height: 28px;
+ border: 0;
+ border-radius: 8px;
+ background: transparent;
+ color: var(--pf-muted);
+ cursor: pointer;
+}
+
+.pf-wx-fab-close:hover {
+ background: var(--pf-bg);
+ color: var(--pf-ink);
+}
+
+.pf-wx-fab-qr {
+ display: grid;
+ place-items: center;
+ padding: 0.35rem;
+ border-radius: 12px;
+ background: #fafafa;
+ border: 1px solid var(--pf-line);
+}
+
+.pf-wx-fab-qr img {
+ display: block;
+ width: 200px;
+ height: auto;
+ max-width: 100%;
+}
+
+.pf-wx-fab-tip {
+ margin: 0.65rem 0 0;
+ font-size: 0.75rem;
+ line-height: 1.4;
+ color: var(--pf-muted);
+ text-align: center;
+}
+
+@media (max-width: 520px) {
+ .pf-wx-fab-label {
+ display: none;
+ }
+
+ .pf-wx-fab-btn {
+ width: 48px;
+ padding: 0;
+ justify-content: center;
+ }
+}