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 覆盖层(如果存在) */