diff --git a/docs/README.md b/docs/README.md index 12019786e15c1cae9b7ecfa0cbfdf28b220222bc..a6415be6b80c8f8d66bc9fcd4a0dbf89da04fb5f 100644 --- a/docs/README.md +++ b/docs/README.md @@ -115,7 +115,7 @@ pageClass: custom-page-class
-## 看视频,快速了解uni-app +## 看视频,10分钟了解uni-app 我们精心准备了一个简单的十分钟介绍视频,方便你快速了解`uni-app`的主要特征: diff --git a/docs/api/system/getappauthorizesetting.md b/docs/api/system/getappauthorizesetting.md new file mode 100644 index 0000000000000000000000000000000000000000..7ce94531639e03dccb89bd3e7b0ce4a1fec2e2e5 --- /dev/null +++ b/docs/api/system/getappauthorizesetting.md @@ -0,0 +1,48 @@ +### uni.getAppAuthorizeSetting() +获取 APP 授权设置 + +**平台差异说明** + +|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序、飞书小程序|钉钉小程序|QQ小程序|快手小程序|京东小程序| +|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:| +|HBuilderX 3.5.2+|x|基础库 2.20.1+|x|x|x|x|x|x|x| + +**返回参数说明** + +|属性|类型|说明|平台差异说明| +|:-|:-|:-|:-| +|albumAuthorized|'authorized'/'denied'/'not determined'|允许使用相册的开关|App 端仅 iOS 有效| +|bluetoothAuthorized|'authorized'/'denied'/'not determined'|允许使用蓝牙的开关|App 端仅 iOS 有效| +|cameraAuthorized|'authorized'/'denied'/'not determined'|允许使用摄像头的开关|| +|locationAuthorized|'authorized'/'denied'/'not determined'|允许使用定位的开关|| +|locationReducedAccuracy|boolean|定位准确度。true 表示模糊定位,false 表示精确定位|App 端仅 iOS 有效| +|microphoneAuthorized|'authorized'/'denied'/'not determined'|允许使用麦克风的开关| +|notificationAuthorized|'authorized'/'denied'/'not determined'|允许通知的开关|| +|notificationAlertAuthorized|'authorized'/'denied'/'not determined'|允许通知带有提醒的开关|App 端仅 iOS 有效| +|notificationBadgeAuthorized|'authorized'/'denied'/'not determined'|允许通知带有标记的开关|App 端仅 iOS 有效| +|notificationSoundAuthorized|'authorized'/'denied'/'not determined'|允许通知带有声音的开关|App 端仅 iOS 有效| +|phoneCalendarAuthorized|'authorized'/'denied'/'not determined'|允许读写日历的开关|App 端不支持| + +**Tips:** + +`'authorized'` 表示已经获得授权,无需再次请求授权; +`'denied'` 表示请求授权被拒绝,无法再次请求授权;(此情况需要引导用户打开系统设置,在设置页中打开权限) +`'non determined'` 表示尚未请求授权,会在App下一次调用系统相应权限时请求;(仅 iOS 会出现。此种情况下引导用户打开系统设置,不展示开关) + +**示例** + +```javascript +const appAuthorizeSetting = uni.getAppAuthorizeSetting() + +console.log(appAuthorizeSetting.albumAuthorized) +console.log(appAuthorizeSetting.bluetoothAuthorized) +console.log(appAuthorizeSetting.cameraAuthorized) +console.log(appAuthorizeSetting.locationAuthorized) +console.log(appAuthorizeSetting.locationReducedAccuracy) +console.log(appAuthorizeSetting.microphoneAuthorized) +console.log(appAuthorizeSetting.notificationAlertAuthorized) +console.log(appAuthorizeSetting.notificationAuthorized) +console.log(appAuthorizeSetting.notificationBadgeAuthorized) +console.log(appAuthorizeSetting.notificationSoundAuthorized) +console.log(appAuthorizeSetting.phoneCalendarAuthorized) +``` diff --git a/docs/api/system/getsystemsetting.md b/docs/api/system/getsystemsetting.md new file mode 100644 index 0000000000000000000000000000000000000000..a3aef5117e19dd016f233789c00c6c1302c199bf --- /dev/null +++ b/docs/api/system/getsystemsetting.md @@ -0,0 +1,29 @@ +### uni.getSystemSetting() +获取设备设置 + +**平台差异说明** + +|App|H5|微信小程序|支付宝小程序|百度小程序|字节跳动小程序、飞书小程序|钉钉小程序|QQ小程序|快手小程序|京东小程序| +|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:|:-:| +|HBuilderX 3.5.2+|x|基础库 2.20.1+|x|x|x|x|x|x|x| + + +**返回参数说明** + +|属性|类型|说明| +|:-|:-|:-| +|bluetoothEnabled|boolean|蓝牙的系统开关| +|locationEnabled|boolean|地理位置的系统开关| +|wifiEnabled|boolean|Wi-Fi 的系统开关| +|deviceOrientation|string|设备方向。`竖屏:portrait`,`横屏:landscape`| + +**示例** + +```javascript +const systemSetting = uni.getSystemSetting() + +console.log(systemSetting.bluetoothEnabled) +console.log(systemSetting.deviceOrientation) +console.log(systemSetting.locationEnabled) +console.log(systemSetting.wifiEnabled) +``` diff --git a/docs/component/map.md b/docs/component/map.md index 6d584e9104e8fe4679ff7c59d27f5ad6b4655972..1e1a5a7815b387c4358ce7461234a3aae8edeaca 100644 --- a/docs/component/map.md +++ b/docs/component/map.md @@ -48,7 +48,7 @@ |show-location|Boolean||显示带有方向的当前定位点|微信小程序、H5、百度小程序、支付宝小程序、京东小程序| |polygons|Array.`