Browse Source

去除情绪大模型自动滚动设置,只在夺宝奇兵大模型自动滚动。

dev
宋杰 2 days ago
parent
commit
7b4bdbc1e0
  1. 63
      src/views/AiEmotion.vue
  2. 6
      src/views/homePage.vue

63
src/views/AiEmotion.vue

@ -258,8 +258,6 @@ const hasTriggeredAudio = ref(false); // 是否已触发音频播放
const hasTriggeredTypewriter = ref(false); //
const intersectionObserver = ref(null); // observer
const isUserInitiated = ref(false); //
const isUserScrolling = ref(false); //
const scrollTimeout = ref(null); //
//
const displayedTexts = ref({
@ -846,10 +844,7 @@ function playAudio(url) {
isAudioPlaying.value = true;
emotionAudioStore.isPlaying = true;
console.log('开始播放场景应用语音');
//
// setTimeout(() => {
// scrollToBottom();
// }, 100);
//
},
onend: () => {
isAudioPlaying.value = false;
@ -1518,36 +1513,11 @@ function renderCharts(data) {
});
}
// const scrollToBottom = async () => {
// //
// if (isUserScrolling.value) {
// console.log('');
// return;
// }
// scrollToBottom
// const container = userInputDisplayRef.value;
// if (!container) return;
// await nextTick();
// console.log(container.scrollHeight, "container.scrollHeight");
// console.log(container.scrollTop, "container.scrollTop");
// console.log(container.offsetHeight, "container.offsetHeight");
// container.scrollTop = container.scrollHeight - container.offsetHeight;
// };
//
//
const handleUserScroll = () => {
isUserScrolling.value = true;
//
if (scrollTimeout.value) {
clearTimeout(scrollTimeout.value);
}
// 2
scrollTimeout.value = setTimeout(() => {
isUserScrolling.value = false;
console.log('用户滚动结束,重新允许自动滚动');
}, 2000);
//
};
//
@ -1589,16 +1559,11 @@ function isDataLoaded() {
return false;
}
console.log('所有数据和组件已加载完成,可以开始滚动');
console.log('所有数据和组件已加载完成');
return true;
}
//
function startAutoScroll() {
//
console.log('自动滚动功能已被禁用');
return;
}
//
// Intersection Observer
function setupIntersectionObserver() {
@ -1690,12 +1655,7 @@ function setupIntersectionObserver() {
intersectionObserver.value = observer;
}
//
function triggerAutoScroll() {
//
console.log('自动滚动功能已被禁用');
return;
}
//
//
const scrollToTop = () => {
@ -1911,11 +1871,7 @@ onUnmounted(() => {
window.removeEventListener('scroll', handlePageScroll);
document.removeEventListener('scroll', handlePageScroll);
//
if (scrollTimeout.value) {
clearTimeout(scrollTimeout.value);
scrollTimeout.value = null;
}
//
});
//
@ -1923,8 +1879,7 @@ const emit = defineEmits(['updateMessage', 'sendMessage', 'ensureAIchat']);
// 使
defineExpose({
handleSendMessage,
triggerAutoScroll
handleSendMessage
});
</script>

6
src/views/homePage.vue

@ -287,7 +287,10 @@ watch(
() => chatStore.messages,
() => {
// console.log('messages')
throttledSmoothScrollToBottom();
// AIchat
if (activeTab.value === "AIchat") {
throttledSmoothScrollToBottom();
}
// setTimeout(throttledSmoothScrollToBottom, 100);
},
{ deep: true, immediate: true }
@ -303,6 +306,7 @@ watch(
throttledSmoothScrollToBottom();
}, 100);
}
// AiEmotion
// setTimeout(throttledSmoothScrollToBottom, 100);
},
{ deep: true, immediate: true }

Loading…
Cancel
Save