wx.getSystemInfoSync-获取系统信息同步接口

wx.getSystemInfoSync()

获取系统信息同步接口


同步返回参数说明:

参数说明最低版本
brand手机品牌1.5.0
model手机型号
pixelRatio设备像素比
screenWidth屏幕宽度1.1.0
screenHeight屏幕高度1.1.0
windowWidth可使用窗口宽度
windowHeight可使用窗口高度
language微信设置的语言
version微信版本号
system操作系统版本
platform客户端平台
fontSizeSetting用户字体大小设置。以“我-设置-通用-字体大小”中的设置为准,单位:px1.5.0
SDKVersion客户端基础库版本1.1.0


示例代码:

try {
    var res = wx.getSystemInfoSync()
    console.log(res.model)
    console.log(res.pixelRatio)
    console.log(res.windowWidth)
    console.log(res.windowHeight)
    console.log(res.language)
    console.log(res.version)
    console.log(res.platform)
} catch (e) {
    // Do something when catch error
}