提一个bug,关于安卓手机调用wx.getSystemInfo的问题
首先这是一个随机bug,我们在华为荣耀9和金立上重现过. 在OnLoad的时候调用wx.getSystemInfo接口,代码如下: wx.getSystemInfo({ success: function(res) { self.data.screenWidth = res.windowWidth; self.data.screenHeight = res.windowHeight; console.log("onLoad getSystemInfo success!"); console.log("res.windowWidth:" + res.windowWidth); console.log("res.windowHeight:" + res.windowHeight); }, fail: function (res){ console.log("getSystemInfo fail!"); } }) 系统打印结果是 onLoad getSystemInfo success! res.windowWidth:0 res.windowHeight:0 换句话说就是:获取窗口的宽高失败了,但是却走了success回调.