From fa99461b8406894d018c6c8dda1d63fe4a8924b5 Mon Sep 17 00:00:00 2001 From: no99 <17663930442@163.com> Date: Sat, 19 Apr 2025 10:35:37 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E6=AD=A2=E6=89=8B=E6=9C=BA=E9=A3=98?= =?UTF-8?q?=E5=B1=8F=E5=81=9C=E6=AD=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/AIchat.vue | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) 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;