From 8e5662c877d26ac5a666caf43a097b88f3a74476 Mon Sep 17 00:00:00 2001 From: fit2cloud-chenyw Date: Wed, 5 Nov 2025 17:49:36 +0800 Subject: [PATCH] style: Style adaptation for mobile layout --- frontend/src/utils/utils.ts | 12 ++++++++ frontend/src/views/chat/index.vue | 51 ++++++++++++++++++++----------- 2 files changed, 46 insertions(+), 17 deletions(-) diff --git a/frontend/src/utils/utils.ts b/frontend/src/utils/utils.ts index 082a3647..2b378326 100644 --- a/frontend/src/utils/utils.ts +++ b/frontend/src/utils/utils.ts @@ -238,3 +238,15 @@ export const cleanPlatformFlag = () => { wsCache.delete(platformKey) return false } +export function isTablet() { + const userAgent = navigator.userAgent + const tabletRegex = /iPad|Silk|Galaxy Tab|PlayBook|BlackBerry|(tablet|ipad|playbook)/i + return tabletRegex.test(userAgent) +} +export function isMobile() { + return ( + navigator.userAgent.match( + /(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i + ) && !isTablet() + ) +} diff --git a/frontend/src/views/chat/index.vue b/frontend/src/views/chat/index.vue index 3456c73c..184f4362 100644 --- a/frontend/src/views/chat/index.vue +++ b/frontend/src/views/chat/index.vue @@ -4,6 +4,7 @@ :width="280" placement="bottom-start" popper-class="popover-chat_history popover-chat_history_small" + :disabled="isPhone" >