Browse Source

禁止手机飘屏停止

hxl
no99 2 months ago
parent
commit
fa99461b84
  1. 27
      src/views/AIchat.vue

27
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;

Loading…
Cancel
Save