// 获取设备信息
wx.getSystemInfoSync()
// 返回的是对象
即: ↓↓↓
{
SDKVersion: "2.12.2"
batteryLevel: 100
benchmarkLevel: 1
brand: "devtools"
deviceOrientation: "portrait"
devicePixelRatio: 2
fontSizeSetting: 16
language: "zh_CN"
model: "iPhone 5"
pixelRatio: 2
platform: "devtools"
safeArea: {
right: 320,
bottom: 568,
left: 0,
top: 20,
width: 320
}
screenHeight: 568
screenWidth: 320
statusBarHeight: 20
system: "iOS 10.0.1"
version: "7.0.4"
windowHeight: 504 // 屏高
windowWidth: 320 // 屏宽
}
// 获取设备网络信息
wx.getNetworkType(OBJECT)
即:↓↓↓
Promise {
[[PromiseStatus]]: "resolved"
[[PromiseValue]]:{
errMsg: "getNetworkType:ok",
networkType: "wifi" // 网络状态
}
}
// 拨打电话
wx.makePhoneCall({
phoneNumber: '即将拨打的号码'
})