修改url
This commit is contained in:
@@ -11,9 +11,9 @@
|
||||
</view> -->
|
||||
|
||||
<!-- 消息列表 -->
|
||||
<scroll-view scroll-y class="message-list" :scroll-top="scrollTop" scroll-with-animation="true"
|
||||
show-scrollbar="false" enhanced="true" bounces="true"
|
||||
@scroll="onScroll" @scrolltoupper="loadMoreHistory" upper-threshold="50">
|
||||
<scroll-view scroll-y class="message-list" :scroll-top="scrollTop" scroll-with-animation="true"
|
||||
show-scrollbar="false" enhanced="true" bounces="true" @scroll="onScroll" @scrolltoupper="loadMoreHistory"
|
||||
upper-threshold="50">
|
||||
<!-- 加载提示 -->
|
||||
<view v-if="isLoadingHistory" class="loading-history">
|
||||
<text>正在加载历史记录...</text>
|
||||
@@ -245,22 +245,25 @@
|
||||
if (res) {
|
||||
console.log('forceScrollToBottom: 获取到scrollOffset', res);
|
||||
console.log('forceScrollToBottom: 当前scrollTop', this.scrollTop);
|
||||
|
||||
|
||||
// 使用scrollHeight,如果没有则使用一个大值
|
||||
const scrollHeight = res.scrollHeight || 99999;
|
||||
const targetScrollTop = scrollHeight + 1000;
|
||||
|
||||
|
||||
// 先重置scrollTop,然后设置到底部
|
||||
this.scrollTop = 0;
|
||||
this.$nextTick(() => {
|
||||
this.scrollTop = targetScrollTop;
|
||||
console.log('forceScrollToBottom: 设置scrollTop为', targetScrollTop);
|
||||
|
||||
console.log('forceScrollToBottom: 设置scrollTop为',
|
||||
targetScrollTop);
|
||||
|
||||
// 延迟再次确保滚动到底部
|
||||
setTimeout(() => {
|
||||
const finalScrollTop = (res.scrollHeight || 99999) + 1000;
|
||||
const finalScrollTop = (res.scrollHeight ||
|
||||
99999) + 1000;
|
||||
this.scrollTop = finalScrollTop;
|
||||
console.log('forceScrollToBottom: 延迟设置scrollTop完成', finalScrollTop);
|
||||
console.log('forceScrollToBottom: 延迟设置scrollTop完成',
|
||||
finalScrollTop);
|
||||
}, 100);
|
||||
});
|
||||
} else {
|
||||
@@ -656,7 +659,7 @@
|
||||
});
|
||||
this.inputMessage = '';
|
||||
this.saveMessagesToLocal(); // 保存用户消息
|
||||
|
||||
|
||||
// 立即滚动到底部显示用户消息
|
||||
this.forceScrollToBottom();
|
||||
|
||||
|
Reference in New Issue
Block a user