欧美日韩国产一区,亚洲一区视频,色综合久久久久,私密按摩师舌头伸进去了,99re6这里只有精品,夜夜性日日交xxx性hd

系統信息獲取API

本文編輯: 技術藍天 技術藍天瀏覽 5106 版權所有,嚴禁轉載

接口說明:

獲取系統信息接口和獲取系統同步信息接口。

接口 說明
wx.getSystemInfo(OBJECT) 獲取系統信息。
wx.getSystemInfoSync() 獲取系統信息同步接口

接口用法:

【代碼】

wxml

<button type="default" bindtap="getSystemInfo">獲取系統信息</button>
<button type="primary" bindtap="getSystemInfoSync">獲取系統信息同步</button>

js

  getSystemInfo : function(){
    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)
    }
  })
  }

【代碼】

wxml

<button type="default" bindtap="getSystemInfo">獲取系統信息</button>
<button type="primary" bindtap="getSystemInfoSync">獲取系統信息同步</button>

js

  getSystemInfoSync : function(){
    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)
  }

主要方法:

【wx.getSystemInfo(OBJECT)】:【獲取系統信息。】

【方法內容描述】

參數 類型 必填 描述
success Function 接口調用成功的回調
fail Function 接口調用失敗的回調函數
fail Function 接口調用結束的回調函數(調用成功、失敗都會執行)

success返回參數說明:

屬性 說明
model 手機型號
pixelRatio 設備像素比
windowWidth 窗口寬度
windowHeight 窗口高度
language 微信設置的語言
version 微信版本號
system 操作系統版本
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)
  }
})

【wx.getSystemInfoSync()】:【獲取系統信息同步接口。】

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
}
如有技術問題或對本文有反饋,請加入QQ群:
微信小程序實戰5營: 微信小程序Club實戰5營