diff --git a/src/views/AIchat.vue b/src/views/AIchat.vue index 3029fad..b8f2122 100644 --- a/src/views/AIchat.vue +++ b/src/views/AIchat.vue @@ -64,21 +64,46 @@ const showQuestions = async (questions) => { // 飘屏控制 const floatingTopMouseEnter = function () { + + const userAgent = navigator.userAgent.toLowerCase(); + const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; + const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); + if (isMobile) { + return + } console.log("鼠标指上去"); const floatTop = document.getElementById("top"); floatTop.style.animationPlayState = "paused"; } const floatingTopMouseLeave = function () { + const userAgent = navigator.userAgent.toLowerCase(); + const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; + const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); + if (isMobile) { + return + } console.log("鼠标指下去"); const floatTop = document.getElementById("top"); floatTop.style.animationPlayState = "running" } const floatingBottomMouseEnter = function () { + const userAgent = navigator.userAgent.toLowerCase(); + const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; + const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); + if (isMobile) { + return + } console.log("鼠标指上去"); const floatBottom = document.getElementById("bottom"); floatBottom.style.animationPlayState = "paused"; } const floatingBottomMouseLeave = function () { + const userAgent = navigator.userAgent.toLowerCase(); + const mobileKeywords = ['mobile', 'android', 'iphone', 'ipad', 'ipod']; + const isMobile = mobileKeywords.some(keyword => userAgent.includes(keyword)); + if (isMobile) { + return + } console.log("鼠标指下去"); const floatBottom = document.getElementById("bottom"); floatBottom.style.animationPlayState = "running" @@ -117,7 +142,7 @@ const playAudio = (url) => { ElMessage.error('音频播放失败,请检查网络连接'); } }); - if(audioStore.nowSound){ + if (audioStore.nowSound) { audioStore.nowSound.stop() } audioStore.nowSound = newSound;