137-3385-8848(同微信)

小程序开发wx.getSystemInfo(OBJECT),获取系统信息

2022-04-21 管理员

获取系统信息。

OBJECT参数说明:

参数 类型 必填 说明
success Function 接口调用成功的回调
fail Function 接口调用失败的回调函数
complete Function 接口调用结束的回调函数(调用成功、失败都会执行)

success回调参数说明:

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

示例代码:

wx.getSystemInfo({
  success: function(res) {
    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)
  }
})
更多微信小程序开发教程,关注。
上一篇:小程序开发wx.getNetworkType(OBJECT),获取网络类型
下一篇:小程序开发wx.setStorage(OBJECT),覆盖掉原来该 key 对应的内容
相关资讯 Releva ntnews
解决方案 Solutions
相关热点 Hot spot
郑州做排名中正确使用关键词优化的方法
  1. 我们的优势
  2. 我们的实力
  3. 选择我们的理由
咨询电话(微信同号)

137-3385-8848(同微信)

豫ICP备16014343号-1

Copyright © 2017-2022 版权所有 酷微科技 Rights Reserved

电话咨询 在线咨询 服务项目 SEO优化