获取小程序设备宽高

33 阅读1分钟
	let res = my.getSystemInfoSync()
    let clientHeight = res.windowHeight;
    let clientWidth = res.windowWidth;
    let ratio = 750 / clientWidth;
    let height = clientHeight * ratio;
    let width = clientWidth * ratio;