diff --git a/pages/home/index/index.vue b/pages/home/index/index.vue index f578a82..3b7a445 100644 --- a/pages/home/index/index.vue +++ b/pages/home/index/index.vue @@ -84,8 +84,6 @@ scroll-with-animation :scroll-top="scrollTop" :show-scrollbar="true" - @scrolltoupper="loadMoreMessages" - @scroll="onScroll" > @@ -380,16 +378,7 @@ export default { }, }, onLoad() {}, - mounted() { - this.$nextTick(() => { - this.scrollToBottom(); - }); - }, - updated() { - this.$nextTick(() => { - this.scrollToBottom(); - }); - }, + mounted() {}, methods: { handleLeftClick() { this.$u.api.GetConversationPage().then((res) => { @@ -415,16 +404,6 @@ export default { }); }, - selectChatItem(index) { - this.activeIndex = index; - }, - loadMoreMessages() { - // 加载更多历史消息的实现 - console.log("加载更多历史消息"); - }, - onScroll(event) { - // 滚动事件处理 - }, scrollToBottom() { // 使用nextTick确保DOM已更新 this.$nextTick(() => { @@ -434,6 +413,7 @@ export default { .select(".chat-content") .boundingClientRect((data) => { if (data) { + console.log("data", data); // 计算滚动到底部的位置 const scrollHeight = data.height; // 设置滚动位置,加100px确保滚动到底部 @@ -558,8 +538,6 @@ export default { // 否则按时间升序排列 return timeA - timeB; }); - - this.scrollToBottom(); }); }, @@ -588,7 +566,7 @@ page { background-repeat: no-repeat; background-size: 100% 100%; background-position: 0 88rpx; - // overflow: hidden; /* 改为 hidden 防止页面整体滚动 */ + background-attachment: fixed; } .home-container {