wx.getSystemInfo({ success: function(res) { const screenWidth = res.screenWidth; // 屏幕宽度 const screenHeight = res.screenHeight; // 屏幕高度 wx.createSelectorQuery().selectViewport().boundingClientRect(function(rect) { const viewportWidth = rect.width; // 视口宽度 const viewportHeight = rect.height; // 视口高度 const fullScreenWidth = screenWidth * viewportWidth / rect.width; // 页面全屏宽度 const fullScreenHeight = screenHeight * viewportHeight / rect.height; // 页面全屏高度 console.log('页面全屏宽度:', fullScreenWidth); console.log('页面全屏高度:', fullScreenHeight); }).exec(); }, fail: function(error) { console.log('获取系统信息失败', error); } });