Browse Source

修改返回顶部逻辑

dongqian/feature-20251022181325-deepmate简版
dongqian 3 weeks ago
parent
commit
ebb17a4910
  1. 13
      pages/deepMate/deepMate.vue

13
pages/deepMate/deepMate.vue

@ -816,7 +816,17 @@ const scrollToBottom = () => {
});
};
const scrollToTop = () => {
// scroll-view
if (messages.value.length > 0) {
chatScrollTop.value = 0;
return;
}
//
try {
uni.pageScrollTo({ scrollTop: 0, duration: 200 });
} catch (e) {
//
}
};
//
const shouldAutoScroll = ref(true);
@ -830,6 +840,9 @@ const onChatScroll = (e) => {
const delta = st - lastScrollTop.value;
lastScrollTop.value = st;
//
chatScrollTop.value = st;
if (delta < 0) {
shouldAutoScroll.value = false;
return;

Loading…
Cancel
Save