支付宝小程序API 系统信息
my.getSystemInfo
获取系统信息。
入参
名称 | 类型 | 必填 | 描述 |
---|---|---|---|
success | Function | 否 | 调用成功的回调函数 |
fail | Function | 否 | 调用失败的回调函数 |
complete | Function | 否 | 调用结束的回调函数(调用成功、失败都会执行) |
success 返回值
名称 | 类型 | 描述 | 最低版本 |
---|---|---|---|
model | String | 手机型号 | - |
pixelRatio | Number | 设备像素比 | - |
windowWidth | Number | 窗口宽度 | - |
windowHeight | Number | 窗口高度 | - |
language | String | 支付宝设置的语言 | - |
version | String | 支付宝版本号 | - |
storage | String | 设备磁盘容量 | 1.1.1 |
currentBattery | String | 当前电量百分比 | 1.1.1 |
system | String | 系统版本 | 1.1.1 |
platform | String | 系统名:Android,iOS | 1.1.1 |
screeWidth | Number | 屏幕宽度 | 1.1.1 |
screenHeight | Number | 屏幕高度 | 1.1.1 |
代码示例
Page({
data: {
systemInfo: {}
},
getSystemInfoPage() {
my.getSystemInfo({
success: (res) => {
this.setData({
systemInfo: res
})
}
})
},
})
my.getSystemInfoSync
返回值同 getSystemInfo success 回调参数
代码示例
Page({
data: {
systemInfo: {}
},
getSystemInfoSyncPage() {
this.setData({
systemInfo: my.getSystemInfoSync()
})
}
})