feat: insert welcome message at front on every page entry

This commit is contained in:
Your Name 2026-04-01 14:41:56 +08:00
parent 39223cad85
commit b58f046d00

View File

@ -1260,20 +1260,21 @@ 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()
//
if (quickQuestionsData.value.length > 0) {
const welcomeMessage: Message = {
role: 'ai',
content: '您好!我是物业客服,有什么可以帮助您的吗?',
quickQuestions: quickQuestionsData.value,
created_at: new Date().toISOString()
}
}, 100)
//
nextTick(() => {
messages.value.unshift(welcomeMessage)
console.log('[Customer] 每次进入页面都在最前方插入新开场白消息')
scrollToBottom()
})
}
if(op?.message){
handleQuickAction(op as QuickAction)