feat: 快捷信息引导语

This commit is contained in:
jinyaqiu 2025-07-30 11:53:25 +08:00
parent b261fbf970
commit 14377edd1e
3 changed files with 30 additions and 3 deletions

View File

@ -139,6 +139,7 @@ export default function AskScreen() {
useFocusEffect(
useCallback(() => {
setIsHello(true);
setUserMessages([])
}, [])
);

View File

@ -43,7 +43,7 @@ function ChatComponent(
data={userMessages}
keyExtractor={keyExtractor}
renderItem={({ item, index }) => {
const itemStyle = index === 0 ? { marginTop: 16 } : {};
const itemStyle = index === 0 ? { marginTop: 16, marginHorizontal: 16 } : { marginHorizontal: 16 };
return (
<View style={itemStyle}>
{MessageItem({ t, setSelectedImages, selectedImages, insets, item, sessionId, modalVisible, setModalVisible, setModalDetailsVisible, modalDetailsVisible })}

View File

@ -70,6 +70,16 @@ export default function SendMessage(props: Props) {
// 确保在下一个事件循环中更新状态,避免可能的渲染问题
requestAnimationFrame(() => {
setIsHello(false);
setUserMessages([
{
content: {
text: '想打开记忆盲盒吗?描述你的回忆,我来帮你找回照片、生成影片或解锁隐藏彩蛋✨'
},
role: 'Assistant',
timestamp: new Date().toISOString()
}
])
});
}
});
@ -124,14 +134,30 @@ export default function SendMessage(props: Props) {
}
}, [inputValue, conversationId, selectedImages, createNewConversation, getConversation]);
const handleQuitly = (type: string) => {
setIsHello(false)
setUserMessages(pre => ([
...pre,
{
content: {
text: type === "search"
? '想找合适的图片?试试这样搜更精准:\n\n• 明确主题:比如"秋日森林""极简风书桌""复古海报设计"\n\n• 加上细节:想找特定风格?试试"水彩风猫咪""赛博朋克城市夜景";需要特定用途?比如"无版权风景图""可商用图标"\n\n• 描述场景:比如"阳光透过树叶的光斑""雨天咖啡馆窗外"\n\n输入这些关键词说不定就能找到你想要的画面啦'
: '想让你的视频内容更吸睛、更有故事感吗?不妨试试从搜索图片入手吧!\n\n你可以先确定视频的主题——是治愈系的自然风景还是复古风的城市街景或是充满活力的生活瞬间然后根据主题去搜索相关的图片比如想做"春日限定"主题,就搜"樱花飘落""草地野餐""嫩芽初绽"之类的画面。\n\n这些图片能帮你快速理清视频的画面脉络甚至能激发新的创意——比如一张老照片里的复古物件或许能延伸出一段关于时光的故事一组星空图片说不定能串联成关于梦想与远方的叙事。把这些图片按你的想法串联起来配上合适的音乐和文案一段有温度的视频就诞生啦试试看吧'
},
role: 'Assistant',
timestamp: new Date().toISOString()
}
]))
};
return (
<View style={styles.container}>
<View className="relative w-full">
<ScrollView horizontal={true}>
<TouchableOpacity style={[styles.button, { borderColor: '#FFB645' }]}>
<TouchableOpacity style={[styles.button, { borderColor: '#FFB645' }]} onPress={() => handleQuitly('search')}>
<SunSvg width={18} height={18} />
<ThemedText></ThemedText>
</TouchableOpacity><TouchableOpacity style={[styles.button, { borderColor: '#E2793F' }]}>
</TouchableOpacity><TouchableOpacity style={[styles.button, { borderColor: '#E2793F' }]} onPress={() => handleQuitly('video')}>
<VideoSvg width={18} height={18} />
<ThemedText></ThemedText>
</TouchableOpacity>