新聞中心
這里有您想知道的互聯(lián)網(wǎng)營(yíng)銷(xiāo)解決方案
創(chuàng)新互聯(lián)小程序教程:微信小程序設(shè)備
微信小程序API設(shè)備概覽

讓客戶滿意是我們工作的目標(biāo),不斷超越客戶的期望值來(lái)自于我們對(duì)這個(gè)行業(yè)的熱愛(ài)。我們立志把好的技術(shù)通過(guò)有效、簡(jiǎn)單的方式提供給客戶,將通過(guò)不懈努力成為客戶在信息化領(lǐng)域值得信任、有價(jià)值的長(zhǎng)期合作伙伴,公司提供的服務(wù)項(xiàng)目有:域名注冊(cè)、網(wǎng)頁(yè)空間、營(yíng)銷(xiāo)軟件、網(wǎng)站建設(shè)、崇義網(wǎng)站維護(hù)、網(wǎng)站推廣。
- 系統(tǒng)信息——(wx.getSystemInfo、wx.getSystemInfoSync)
- 網(wǎng)絡(luò)狀態(tài)——(wx.getNetworkType)
- 重力感應(yīng)——(wx.onAccelerometerChange)
- 羅 盤(pán)——(wx.onCompassChange)
- 撥打電話——(wx.makePhoneCall)
- 掃 碼——(wx.scanCode)
wx.getSystemInfo(OBJECT)
獲取系統(tǒng)信息。
OBJECT參數(shù)說(shuō)明:
| 參數(shù) | 類(lèi)型 | 必填 | 說(shuō)明 |
|---|---|---|---|
| success | Function | 是 | 接口調(diào)用成功的回調(diào) |
| fail | Function | 否 | 接口調(diào)用失敗的回調(diào)函數(shù) |
| complete | Function | 否 | 接口調(diào)用結(jié)束的回調(diào)函數(shù)(調(diào)用成功、失敗都會(huì)執(zhí)行) |
success回調(diào)參數(shù)說(shuō)明:
| 屬性 | 說(shuō)明 |
|---|---|
| model | 手機(jī)型號(hào) |
| pixelRatio | 設(shè)備像素比 |
| windowWidth | 窗口寬度 |
| windowHeight | 窗口高度 |
| language | 微信設(shè)置的語(yǔ)言 |
| version | 微信版本號(hào) |
| system | 操作系統(tǒng)版本 |
| platform | 客戶端平臺(tái) |
示例代碼:
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.getSystemInfoSync()
獲取系統(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
}
文章標(biāo)題:創(chuàng)新互聯(lián)小程序教程:微信小程序設(shè)備
文章轉(zhuǎn)載:http://www.dlmjj.cn/article/cddeejh.html


咨詢
建站咨詢
