|
@ -373,9 +373,9 @@ const aiEmotionScrollTimer = ref(null); // 滚动检测定时器 |
|
|
|
|
|
|
|
|
// 获取当前活动页面的滚动容器 |
|
|
// 获取当前活动页面的滚动容器 |
|
|
const getCurrentScrollContainer = () => { |
|
|
const getCurrentScrollContainer = () => { |
|
|
if (activeTab.value === 'AIchat') { |
|
|
|
|
|
|
|
|
if (activeTab.value === "AIchat") { |
|
|
return tabContentAIchat.value; |
|
|
return tabContentAIchat.value; |
|
|
} else if (activeTab.value === 'AiEmotion') { |
|
|
|
|
|
|
|
|
} else if (activeTab.value === "AiEmotion") { |
|
|
return tabContentAiEmotion.value; |
|
|
return tabContentAiEmotion.value; |
|
|
} |
|
|
} |
|
|
return null; |
|
|
return null; |
|
@ -406,7 +406,11 @@ const throttledSmoothScrollToBottom = _.throttle(smoothScrollToBottom, 300, { |
|
|
|
|
|
|
|
|
// AiEmotion页面自动滚动到底部的防抖函数 |
|
|
// AiEmotion页面自动滚动到底部的防抖函数 |
|
|
const debouncedAiEmotionScrollToBottom = _.debounce(() => { |
|
|
const debouncedAiEmotionScrollToBottom = _.debounce(() => { |
|
|
if (activeTab.value === 'AiEmotion' && isAiEmotionAutoScrollEnabled.value && !isAiEmotionUserScrolling.value) { |
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
activeTab.value === "AiEmotion" && |
|
|
|
|
|
isAiEmotionAutoScrollEnabled.value && |
|
|
|
|
|
!isAiEmotionUserScrolling.value |
|
|
|
|
|
) { |
|
|
const container = tabContentAiEmotion.value; |
|
|
const container = tabContentAiEmotion.value; |
|
|
if (container) { |
|
|
if (container) { |
|
|
container.scrollTop = container.scrollHeight - container.offsetHeight; |
|
|
container.scrollTop = container.scrollHeight - container.offsetHeight; |
|
@ -423,7 +427,7 @@ const startAiEmotionHeightObserver = () => { |
|
|
|
|
|
|
|
|
// 创建ResizeObserver监听页面内容变化 |
|
|
// 创建ResizeObserver监听页面内容变化 |
|
|
aiEmotionHeightObserver.value = new ResizeObserver((entries) => { |
|
|
aiEmotionHeightObserver.value = new ResizeObserver((entries) => { |
|
|
if (isAiEmotionAutoScrollEnabled.value && activeTab.value === 'AiEmotion') { |
|
|
|
|
|
|
|
|
if (isAiEmotionAutoScrollEnabled.value && activeTab.value === "AiEmotion") { |
|
|
debouncedAiEmotionScrollToBottom(); |
|
|
debouncedAiEmotionScrollToBottom(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -454,7 +458,11 @@ const startAiEmotionHeightObserver = () => { |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
|
if (shouldScroll && isAiEmotionAutoScrollEnabled.value && activeTab.value === 'AiEmotion') { |
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
shouldScroll && |
|
|
|
|
|
isAiEmotionAutoScrollEnabled.value && |
|
|
|
|
|
activeTab.value === "AiEmotion" |
|
|
|
|
|
) { |
|
|
debouncedAiEmotionScrollToBottom(); |
|
|
debouncedAiEmotionScrollToBottom(); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
@ -475,7 +483,9 @@ const startAiEmotionHeightObserver = () => { |
|
|
|
|
|
|
|
|
// 为AiEmotion页面的滚动容器添加滚动事件监听器 |
|
|
// 为AiEmotion页面的滚动容器添加滚动事件监听器 |
|
|
if (aiEmotionContainer) { |
|
|
if (aiEmotionContainer) { |
|
|
aiEmotionContainer.addEventListener('scroll', handleAiEmotionUserScroll, { passive: true }); |
|
|
|
|
|
|
|
|
aiEmotionContainer.addEventListener("scroll", handleAiEmotionUserScroll, { |
|
|
|
|
|
passive: true, |
|
|
|
|
|
}); |
|
|
// 保存滚动事件监听器引用以便清理 |
|
|
// 保存滚动事件监听器引用以便清理 |
|
|
aiEmotionHeightObserver.value.scrollListener = handleAiEmotionUserScroll; |
|
|
aiEmotionHeightObserver.value.scrollListener = handleAiEmotionUserScroll; |
|
|
} |
|
|
} |
|
@ -502,7 +512,7 @@ const handleAiEmotionUserScroll = () => { |
|
|
|
|
|
|
|
|
// 处理AiEmotion页面的滚动请求 |
|
|
// 处理AiEmotion页面的滚动请求 |
|
|
const handleAiEmotionScrollToBottom = () => { |
|
|
const handleAiEmotionScrollToBottom = () => { |
|
|
if (activeTab.value === 'AiEmotion') { |
|
|
|
|
|
|
|
|
if (activeTab.value === "AiEmotion") { |
|
|
const container = tabContentAiEmotion.value; |
|
|
const container = tabContentAiEmotion.value; |
|
|
if (container) { |
|
|
if (container) { |
|
|
// 使用nextTick确保DOM已更新 |
|
|
// 使用nextTick确保DOM已更新 |
|
@ -536,8 +546,14 @@ const stopAiEmotionHeightObserver = () => { |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// 清理滚动事件监听器 |
|
|
// 清理滚动事件监听器 |
|
|
if (aiEmotionHeightObserver.value.scrollListener && tabContentAiEmotion.value) { |
|
|
|
|
|
tabContentAiEmotion.value.removeEventListener('scroll', aiEmotionHeightObserver.value.scrollListener); |
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
aiEmotionHeightObserver.value.scrollListener && |
|
|
|
|
|
tabContentAiEmotion.value |
|
|
|
|
|
) { |
|
|
|
|
|
tabContentAiEmotion.value.removeEventListener( |
|
|
|
|
|
"scroll", |
|
|
|
|
|
aiEmotionHeightObserver.value.scrollListener |
|
|
|
|
|
); |
|
|
aiEmotionHeightObserver.value.scrollListener = null; |
|
|
aiEmotionHeightObserver.value.scrollListener = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
@ -807,7 +823,8 @@ const touchmoveHandler = (e) => { |
|
|
} |
|
|
} |
|
|
// 判断触摸目标是否在当前活动页面的可滚动区域内 |
|
|
// 判断触摸目标是否在当前活动页面的可滚动区域内 |
|
|
const currentContainer = getCurrentScrollContainer(); |
|
|
const currentContainer = getCurrentScrollContainer(); |
|
|
const isScrollableArea = currentContainer && currentContainer.contains(e.target); |
|
|
|
|
|
|
|
|
const isScrollableArea = |
|
|
|
|
|
currentContainer && currentContainer.contains(e.target); |
|
|
|
|
|
|
|
|
// 如果不在可滚动区域,则阻止滚动 |
|
|
// 如果不在可滚动区域,则阻止滚动 |
|
|
if (!isScrollableArea) { |
|
|
if (!isScrollableArea) { |
|
@ -925,6 +942,8 @@ const changeToken = () => { |
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
const goRecharge = () => { |
|
|
const goRecharge = () => { |
|
|
|
|
|
sessionStorage.setItem("rechargeFlag", "1"); |
|
|
|
|
|
|
|
|
if (isMobile.value) { |
|
|
if (isMobile.value) { |
|
|
console.log("用户是移动端"); |
|
|
console.log("用户是移动端"); |
|
|
} else { |
|
|
} else { |
|
@ -953,9 +972,7 @@ const goChange = () => { |
|
|
setTimeout(() => { |
|
|
setTimeout(() => { |
|
|
changeSuccessDialogVisible.value = false; |
|
|
changeSuccessDialogVisible.value = false; |
|
|
}, 3000); |
|
|
}, 3000); |
|
|
|
|
|
|
|
|
}; |
|
|
}; |
|
|
|
|
|
|
|
|
// 8.18金币兑换Token end |
|
|
// 8.18金币兑换Token end |
|
|
|
|
|
|
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
@ -984,12 +1001,12 @@ onMounted(async () => { |
|
|
// 添加原生事件监听器 |
|
|
// 添加原生事件监听器 |
|
|
window.addEventListener("resize", throttledJudgeDevice); |
|
|
window.addEventListener("resize", throttledJudgeDevice); |
|
|
|
|
|
|
|
|
if (getQueryVariable("successType") == "success") { |
|
|
|
|
|
|
|
|
if ( |
|
|
|
|
|
sessionStorage.getItem("rechargeFlag") == "1" && |
|
|
|
|
|
getQueryVariable("successType") == "success" |
|
|
|
|
|
) { |
|
|
dialogVisible.value = true; |
|
|
dialogVisible.value = true; |
|
|
window.parent.location.href = window.parent.location.href.replace( |
|
|
|
|
|
"successType=success", |
|
|
|
|
|
"" |
|
|
|
|
|
); |
|
|
|
|
|
|
|
|
sessionStorage.setItem("rechargeFlag", "0"); |
|
|
} |
|
|
} |
|
|
}); |
|
|
}); |
|
|
|
|
|
|
|
@ -1101,7 +1118,6 @@ onUnmounted(() => { |
|
|
<div class="pc-count-number">{{ UserCount }}</div> |
|
|
<div class="pc-count-number">{{ UserCount }}</div> |
|
|
</div> |
|
|
</div> |
|
|
<div class="pc-clickGetCount">点击获取Token</div> |
|
|
<div class="pc-clickGetCount">点击获取Token</div> |
|
|
|
|
|
|
|
|
</div> |
|
|
</div> |
|
|
<div class="pc-backToHomeBtn" @click="backToHome()"> |
|
|
<div class="pc-backToHomeBtn" @click="backToHome()"> |
|
|
<img |
|
|
<img |
|
|