更新记录
1.1(2024-05-14) 下载此版本
示例无法运行修复
1.0(2024-04-30) 下载此版本
1.0发布
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
√ | × | - | - | - | √ | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
- | - | - | - | - | - | - | - | - | - | - |
1.页面引入组件,申请权限前调用组件showView方法 传入对应的权限值和回调函数 2.如果用户拒绝或取消就调用 clearPermissionStorageKey 方法删除本地是否已经授权的权限值
1.引入组件、注册组件
import Authorize from '@/components/authorize/index.vue'
<Authorize ref="authorize" />
import {
clearPermissionStorageKey
} from '@/components/authorize/index.js'
2.方法调用
handelAuthorize() {
this.$refs?.authorize?.showView('CAMERA_VIDEO_STORAGE', this.handelVideo)
},
3.回调函数
// 视频
handelVideo() {
uni.chooseVideo({
sourceType: ['camera', 'album'],
success: async (res) => {
},
fail: (err) => {
clearPermissionStorageKey('CAMERA_VIDEO_STORAGE', err, () => {
this.handelVideo()
})
}
});
},