|
@@ -327,6 +327,7 @@
|
|
|
}else{
|
|
|
this.changeHouse(houseIndex);
|
|
|
}
|
|
|
+ this.scrollToBottom();
|
|
|
return false;
|
|
|
}else{
|
|
|
houseIndex = this.extractNumber(text);//获取文字里面的数字 第三个 类似这样的
|
|
@@ -368,6 +369,7 @@
|
|
|
text: "没有匹配到,请再说一次",
|
|
|
}
|
|
|
this.messageList.push(message);
|
|
|
+ this.scrollToBottom();
|
|
|
return false;
|
|
|
}
|
|
|
if(houseIndex > this.houseList.length){
|
|
@@ -380,11 +382,23 @@
|
|
|
text: "没有匹配到,请再说一次!",
|
|
|
}
|
|
|
this.messageList.push(message);
|
|
|
+ this.scrollToBottom();
|
|
|
return false;
|
|
|
}
|
|
|
this.changeHouse(houseIndex);
|
|
|
+ this.scrollToBottom();
|
|
|
console.log("textChange:", houseIndex);
|
|
|
},
|
|
|
+ //滚动到底部
|
|
|
+ scrollToBottom() {
|
|
|
+ setTimeout(()=>{
|
|
|
+ // const scrollArea = this.$refs.scrollArea;
|
|
|
+ // scrollArea.scrollTop = scrollArea.scrollHeight;
|
|
|
+ const lastElement = this.$refs.lastElement;
|
|
|
+ // 将最后一个元素滚动到视口
|
|
|
+ lastElement.scrollIntoView({ behavior: 'smooth' });
|
|
|
+ },200)
|
|
|
+ },
|
|
|
//语音识别
|
|
|
speechRecognizer() {
|
|
|
this.touching = true;//用户开始触摸语音按钮
|