W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗(yàn)值獎勵
獲取系統(tǒng)信息。
OBJECT參數(shù)說明:
參數(shù) | 類型 | 必填 | 說明 |
---|---|---|---|
success | Function | 是 | 接口調(diào)用成功的回調(diào) |
fail | Function | 否 | 接口調(diào)用失敗的回調(diào)函數(shù) |
complete | Function | 否 | 接口調(diào)用結(jié)束的回調(diào)函數(shù)(調(diào)用成功、失敗都會執(zhí)行) |
success回調(diào)參數(shù)說明:
屬性 | 說明 |
---|---|
model | 手機(jī)型號 |
pixelRatio | 設(shè)備像素比 |
windowWidth | 窗口寬度 |
windowHeight | 窗口高度 |
language | 微信設(shè)置的語言 |
version | 微信版本號 |
system | 操作系統(tǒng)版本 |
platform | 客戶端平臺 |
示例代碼:
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)
}
})
獲取系統(tǒng)信息同步接口
示例代碼:
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
}
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: