|
@@ -123,7 +123,6 @@
|
|
let activeIndex = ref(0);
|
|
let activeIndex = ref(0);
|
|
|
|
|
|
// 查看所有聊天记录
|
|
// 查看所有聊天记录
|
|
- list();
|
|
|
|
function list() {
|
|
function list() {
|
|
loadingHistoryRecord.value = true
|
|
loadingHistoryRecord.value = true
|
|
let queryForm = {
|
|
let queryForm = {
|
|
@@ -136,6 +135,9 @@
|
|
setInterval(()=>{
|
|
setInterval(()=>{
|
|
scrollToBottom();
|
|
scrollToBottom();
|
|
}, 100);
|
|
}, 100);
|
|
|
|
+ if(resp.total == 0){
|
|
|
|
+ sayHi();
|
|
|
|
+ }
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
@@ -149,6 +151,16 @@
|
|
|
|
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ function sayHi() {
|
|
|
|
+ const botMsg = {
|
|
|
|
+ isUser: false,
|
|
|
|
+ content: '你好,我是来帮助你进行学习规划、选科辅导以及志愿填报的生涯教育专家。如果你有关于这些方面的问题,欢迎随时向我咨询!', // 增量填充
|
|
|
|
+ isTyping: false, // 显示加载动画
|
|
|
|
+ }
|
|
|
|
+ chatRecordList.value.push(botMsg)
|
|
|
|
+ }
|
|
|
|
+
|
|
const sendMessage = () => {
|
|
const sendMessage = () => {
|
|
if (inputMessage.value.trim()) {
|
|
if (inputMessage.value.trim()) {
|
|
sendRequest(inputMessage.value.trim())
|
|
sendRequest(inputMessage.value.trim())
|
|
@@ -531,7 +543,7 @@
|
|
nextTick(()=>{
|
|
nextTick(()=>{
|
|
initSpeechRecognition();
|
|
initSpeechRecognition();
|
|
initSpeechsynthesis();
|
|
initSpeechsynthesis();
|
|
- sendMessage()
|
|
|
|
|
|
+ list();
|
|
})
|
|
})
|
|
|
|
|
|
})
|
|
})
|