前端模板处理

This commit is contained in:
海龙 2025-08-26 23:30:50 +08:00
parent eccb0a3e53
commit 1f63a470c7
2 changed files with 14 additions and 5 deletions

View File

@ -313,6 +313,10 @@ export const useTemplateStoryServiceHook = (): UseTemplateStoryService => {
}; };
console.log("params", params); console.log("params", params);
const result = await createMovieProjectV3(params); const result = await createMovieProjectV3(params);
if((result.data as unknown) === 'message'){
message.error(result.message);
return;
}
return result.data.project_id as string; return result.data.project_id as string;
} catch (error) { } catch (error) {
console.error("创建电影项目失败:", error); console.error("创建电影项目失败:", error);

View File

@ -130,7 +130,7 @@ const RenderTemplateStoryMode = ({
clearInterval(timer); clearInterval(timer);
return 95; return 95;
} }
return prev + 1; return prev + 0.1;
}); });
}, 100); }, 100);
try { try {
@ -151,15 +151,20 @@ const RenderTemplateStoryMode = ({
if (projectId) { if (projectId) {
// 跳转到电影详情页 // 跳转到电影详情页
router.push(`/create/work-flow?episodeId=${projectId}`); router.push(`/create/work-flow?episodeId=${projectId}`);
onClose();
// 重置状态
setSelectedTemplate(null);
setActiveRoleIndex(0);
} }
console.log("Story action created:", projectId); console.log("Story action created:", projectId);
} catch (error) {
console.error("Failed to create story action:", error);
// 这里可以添加 toast 提示
onClose(); onClose();
// 重置状态 // 重置状态
setSelectedTemplate(null); setSelectedTemplate(null);
setActiveRoleIndex(0); setActiveRoleIndex(0);
} catch (error) {
console.error("Failed to create story action:", error);
// 这里可以添加 toast 提示
} finally { } finally {
setLocalLoading(0); setLocalLoading(0);
clearInterval(timer); clearInterval(timer);
@ -556,7 +561,7 @@ const RenderTemplateStoryMode = ({
style={{ maxWidth: "800px", marginTop: "0vh" }} style={{ maxWidth: "800px", marginTop: "0vh" }}
className="photo-story-modal !pb-0 rounded-lg bg-white/[0.08] backdrop-blur-[20px] [&_.ant-modal-content]:bg-white/[0.00]" className="photo-story-modal !pb-0 rounded-lg bg-white/[0.08] backdrop-blur-[20px] [&_.ant-modal-content]:bg-white/[0.00]"
> >
<GlobalLoad show={isLoading} progress={0}> <GlobalLoad show={isLoading} progress={localLoading}>
<div className="rounded-2xl min-h-min transition-all duration-700 ease-out"> <div className="rounded-2xl min-h-min transition-all duration-700 ease-out">
{/* 弹窗头部 */} {/* 弹窗头部 */}
<div className="flex items-center justify-between px-4 pb-6 border-b border-white/[0.1]"> <div className="flex items-center justify-between px-4 pb-6 border-b border-white/[0.1]">