小程序開發wx.getSystemInfoSync,獲取系統信息同步接口
2017-12-11
導讀:獲取系統信息同步接口 同步返回參數說明: 參數 說明 最低版本 brand 手機品牌 1.5.0 model 手機型號 pixelRatio 設備像素比 screenWidth 屏幕寬度 1.1.0 screenHeight 屏幕高度 1.1.0 windowWidth 可使用窗...
獲取系統信息同步接口
同步返回參數說明:
參數 | 說明 | 最低版本 |
---|---|---|
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 |
示例代碼:
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
}
更多微信小程序開發教程,關注hi小程序。
第二部分:如何開通一個小商店
您可能感興趣: