以Promise风格调用: 支持
获取系统信息。
属性 | 类型 | 默认值 | 必填 | 说明 |
|---|---|---|---|---|
| success | function | 否 | 接口调用成功的回调函数 | |
| fail | function | 否 | 接口调用失败的回调函数 | |
| complete | function | 否 | 接口调用结束的回调函数(调用成功、失败都会执行) |
属性 | 类型 | 说明 |
|---|---|---|
| brand | string | 设备品牌 |
| model | string | 设备型号 |
| pixelRatio | number | 设备像素比 |
| screenWidth | number | 屏幕宽度,单位px |
| screenHeight | number | 屏幕高度,单位px |
| windowWidth | number | 可使用窗口宽度,单位px |
| windowHeight | number | 可使用窗口高度,单位px |
| language | string | 小红书设置的语言 |
| version | string | 小红书版本号 |
| system | string | 操作系统及版本 |
| platform | string | 客户端平台 |
| SDKVersion | string | 客户端基础库版本 |
| albumAuthorized | boolean | 允许使用相册的开关(仅 iOS 有效) |
| cameraAuthorized | boolean | 允许使用摄像头的开关 |
| locationAuthorized | boolean | 允许使用定位的开关 |
| microphoneAuthorized | boolean | 允许使用麦克风的开关 |
| locationEnabled | boolean | 地理位置的系统开关 |
| host | host | 当前小程序运行的宿主环境 |
| notificationAlertAuthorized | boolean | 允许小红书通知带有提醒的开关(仅 iOS 有效) |
| notificationAuthorized | boolean | 允许小红书通知的开关 |
| notificationBadgeAuthorized | boolean | 允许通知带有标记的开关(仅 iOS 有效) |
| notificationSoundAuthorized | boolean | 允许小红书通知带有声音的开关(仅 iOS 有效) |
| safeArea | safeArea | 在竖屏正方向下的安全区域 |
| statusBarHeight | number | 状态栏的高度,单位px |
| theme | string | 系统当前主题,取值为light或dark(仅 iOS 有效) |
| wifiEnabled | boolean | Wi-Fi 的系统开关 |
| fontSizeSetting | number | 当前使用的字体级别(仅 Android 有效) |
| navigationBarHeight | number | 小程序对应ActionBar的高度(仅 Android 有效) |
| bluetoothEnabled | boolean | 蓝牙的系统开关(仅 Android 有效) |
| errMsg | string |
属性 | 类型 | 说明 |
|---|---|---|
| appId | string | 宿主 app 对应的 appId |
属性 | 类型 | 说明 |
|---|---|---|
| bottom | number | |
| height | number | |
| left | number | |
| right | number | |
| top | number | |
| width | number |
xhs.getSystemInfo({
success (res) {
console.log(res.model)
}
})