From 39223cad85315a691fb315deba4f072ab323f2ff Mon Sep 17 00:00:00 2001 From: Your Name Date: Wed, 1 Apr 2026 14:38:08 +0800 Subject: [PATCH] feat: always insert new welcome message when entering chat page --- src/pages/ai/chat.vue | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/pages/ai/chat.vue b/src/pages/ai/chat.vue index b22e1f5..f56c46a 100644 --- a/src/pages/ai/chat.vue +++ b/src/pages/ai/chat.vue @@ -1259,6 +1259,22 @@ onLoad(async (op) => { // 获取历史记录 getHistoryMessages(1) + + // 每次进入页面都新插入一条开场白信息 + setTimeout(() => { + if (quickQuestionsData.value.length > 0) { + const welcomeMessage: Message = { + role: 'ai', + content: '您好!我是物业客服,有什么可以帮助您的吗?', + quickQuestions: quickQuestionsData.value, + created_at: new Date().toISOString() + } + messages.value.unshift(welcomeMessage) + console.log('[Customer] 每次进入页面都插入开场白消息') + scrollToBottom() + } + }, 100) + if(op?.message){ handleQuickAction(op as QuickAction) }