Parameters
| Property | Type | Required | Description |
|---|---|---|---|
| success | Function | No | Callback with system info |
| fail | Function | No | Callback on failure |
| complete | Function | No | Callback that always executes |
Success Callback
| Property | Type | Description |
|---|---|---|
| model | String | Cellphone model |
| pixelRatio | Number | Device pixel ratio |
| windowWidth | Number | Window width in px |
| windowHeight | Number | Window height in px |
| language | String | The language set by the user in the app. If the app does not support the language setting, returns the system language |
| version | String | App version number |
| storage | String | Device disk capacity |
| currentBattery | String | Current battery percentage |
| system | String | System version |
| platform | String | System name: Android or iOS |
| titleBarHeight | Number | Title bar height in px |
| statusBarHeight | Number | Status bar height in px |
| screenWidth | Number | Screen width in px |
| screenHeight | Number | Screen height in px |
| brand | String | Cellphone brand |
| fontSizeSetting | Number | User setting font size |
| app | String | The current client on which the Mini Program is running |
Code Example
Page({
data: {
systemInfo: {}
},
getSystemInfoPage() {
my.getSystemInfo({
success: (res) => {
this.setData({
systemInfo: res
})
}
})
},
})