From ae42024ec03213e5ee39a9b83a60acd60ca377ad Mon Sep 17 00:00:00 2001 From: zdl <3489966805@qq.com> Date: Thu, 4 Dec 2025 17:26:16 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=B0=83=E6=95=B4=E5=AE=A2=E6=9C=8D?= =?UTF-8?q?=E5=BC=B9=E7=AA=97=20=E5=B0=86=20PC=20=E7=AB=AF=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E7=AA=97=E5=8F=A3=E4=BB=8E=20380=C3=97640=20=E8=B0=83?= =?UTF-8?q?=E6=95=B4=E4=B8=BA=20450=C3=97750=E3=80=82=20H5=20=E7=AB=AF?= =?UTF-8?q?=EF=BC=9A=E5=AE=BD=E5=BA=A6=E5=8D=A0=E6=BB=A1=EF=BC=8C=E9=AB=98?= =?UTF-8?q?=E5=BA=A6=E6=A0=B9=E6=8D=AE=E5=AE=BD=E5=BA=A6=E7=AD=89=E6=AF=94?= =?UTF-8?q?=E7=BC=A9=E6=94=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/bytedesk-integration/config/bytedesk.config.js | 7 +++++++ src/styles/bytedesk-override.css | 7 ++----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/bytedesk-integration/config/bytedesk.config.js b/src/bytedesk-integration/config/bytedesk.config.js index 9d12247e..f18ea799 100644 --- a/src/bytedesk-integration/config/bytedesk.config.js +++ b/src/bytedesk-integration/config/bytedesk.config.js @@ -55,10 +55,17 @@ export const bytedeskConfig = { t: '1', // 类型: 1=人工客服, 2=机器人 sid: 'df_wg_uid', // 工作组ID }, + + window: window.innerWidth <= 768 ? { + width: window.innerWidth - 1, + height: Math.min(window.innerWidth * 640/380, window.innerHeight - 200) + } : { width: 380, height: 640 } }; /** * 获取Bytedesk配置(根据环境自动切换) + * - H5 端:宽度占满,高度根据宽度等比缩放 + * - PC 端:固定宽高 380x640 * * @returns {Object} Bytedesk配置对象 */ diff --git a/src/styles/bytedesk-override.css b/src/styles/bytedesk-override.css index 884a6651..d2e1eea5 100644 --- a/src/styles/bytedesk-override.css +++ b/src/styles/bytedesk-override.css @@ -21,12 +21,9 @@ iframe[src*="bytedesk"], iframe[src*="/chat/"], iframe[src*="/visitor/"] { - position: fixed !important; z-index: 999999 !important; - max-height: 80vh !important; /* 限制最大高度为视口的80% */ - max-width: 40vh !important; /* 限制最大高度为视口的80% */ - bottom: 10px !important; /* 确保底部有足够空间 */ - right: 10px !important; /* 右侧边距 */ + width: 100% !important; /* 填满外层容器 */ + height: 100% !important; /* 填满外层容器 */ } /* Bytedesk 覆盖层(如果存在) */