From 8b697c4152496cae6a75983290c02a997fc19078 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=8C=97=E6=9E=B3?= <7854742+wang_rumeng@user.noreply.gitee.com> Date: Tue, 16 Sep 2025 20:07:08 +0800 Subject: [PATCH] =?UTF-8?q?=E6=A8=A1=E7=89=88=E8=87=AA=E7=94=B1=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E5=B8=83=E5=B1=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/ChatInputBox/H5TemplateDrawer.tsx | 42 +++++++++++++++++- components/ChatInputBox/PcTemplateModal.tsx | 45 +++++++++++++++++++- 2 files changed, 85 insertions(+), 2 deletions(-) diff --git a/components/ChatInputBox/H5TemplateDrawer.tsx b/components/ChatInputBox/H5TemplateDrawer.tsx index dab09b5..b51b3a4 100644 --- a/components/ChatInputBox/H5TemplateDrawer.tsx +++ b/components/ChatInputBox/H5TemplateDrawer.tsx @@ -71,6 +71,19 @@ export const H5TemplateDrawer = ({ const [inputVisible, setInputVisible] = useState<{ [key: string]: boolean }>({}); const [isBottomExpanded, setIsBottomExpanded] = useState(true); const [isDescExpanded, setIsDescExpanded] = useState(false); + // 自由输入框布局 + const [freeInputLayout, setFreeInputLayout] = useState('bottom'); + + // 自由输入框布局 + useEffect(() => { + if (selectedTemplate?.storyRole && selectedTemplate.storyRole.length > 0 || + selectedTemplate?.storyItem && selectedTemplate.storyItem.length > 0 + ) { + setFreeInputLayout('bottom'); + } else { + setFreeInputLayout('top'); + } + }, [selectedTemplate]) useEffect(() => { if (isOpen) { @@ -488,10 +501,37 @@ export const H5TemplateDrawer = ({ {renderRoles()} {renderItems()} + {/** 自由输入文字 */} + {freeInputLayout === 'top' && selectedTemplate?.freeInput && selectedTemplate.freeInput.length > 0 && ( +
+

+ input Configuration +

+