兼容 早教 和 百科

This commit is contained in:
北枳 2025-09-08 16:18:21 +08:00
parent dd14f44910
commit 6a543e36b4
2 changed files with 40 additions and 23 deletions

View File

@ -69,12 +69,21 @@ export const useTemplateStoryServiceHook = (): UseTemplateStoryService => {
const templates = await templateStoryUseCase.getTemplateStoryList();
templates.forEach(template => {
if (template.template_id === '69') {
if (template.id === 'f944abad-f42b-4899-b54a-a6beb9d27805') {
template.freeInputItem = {
user_tips: "How is coffee made?",
constraints: "",
free_input_text: ""
};
template.storyRole = [];
}
if (template.id === 'e7438cd8-a23d-4974-8cde-13b5671b410c') {
template.freeInputItem = {
user_tips: "Input an English word you wanna learn",
constraints: "",
free_input_text: ""
};
template.storyItem = [];
}
});

View File

@ -672,6 +672,36 @@ const RenderTemplateStoryMode = ({
</div>
)}
{/** 自由输入文字 */}
{(selectedTemplate?.freeInputItem) && (
<div className="py-2 flex-1 flex flex-col" style={{
height: 'calc(70vh - 300px - 8rem)'
}}>
<h3
data-alt="items-section-title"
className="text-lg font-semibold text-white mb-4"
>
input Configuration
</h3>
<textarea
value={selectedTemplate?.freeInputItem?.free_input_text || ""}
placeholder={selectedTemplate?.freeInputItem?.user_tips || ""}
className="w-full flex-1 px-3 py-2 pr-16 bg-white/0 border border-white/10 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500/30 transition-all duration-200 text-sm"
onChange={(e) => {
// 更新自由输入文字字段
const updatedTemplate = {
...selectedTemplate!,
freeInputItem: {
...selectedTemplate!.freeInputItem,
free_input_text: e.target.value
}
};
setSelectedTemplate(updatedTemplate as StoryTemplateEntity);
}}
/>
</div>
)}
{/* 角色自定义部分 - 精简布局 */}
{/* <div className="p-4">
<h3
@ -791,28 +821,6 @@ const RenderTemplateStoryMode = ({
</div>
</div> */}
<div className=" absolute -bottom-8 right-0 w-full flex items-center justify-end gap-2">
{/** 自由输入文字 */}
{(selectedTemplate?.freeInputItem) && (
<div className="py-2 flex-1">
<input
type="text"
value={selectedTemplate?.freeInputItem?.free_input_text || ""}
placeholder="How is coffee made?"
className="w-full px-3 py-2 pr-16 bg-white/0 border border-white/10 rounded-lg text-white placeholder-gray-400 focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500/30 transition-all duration-200 text-sm"
onChange={(e) => {
// 更新自由输入文字字段
const updatedTemplate = {
...selectedTemplate!,
freeInputItem: {
...selectedTemplate!.freeInputItem,
free_input_text: e.target.value
}
};
setSelectedTemplate(updatedTemplate as StoryTemplateEntity);
}}
/>
</div>
)}
<ActionButton
isCreating={isTemplateCreating || localLoading > 0}
handleCreateVideo={handleConfirm}