微信小程序获取当前窗口的宽高

var w = wx.getSystemInfoSync().windowWidth;
var h = wx.getSystemInfoSync().windowHeight;

原文地址:https://www.cnblogs.com/shaozhu520/p/13112236.html