更新记录
1.0.0(2026-04-27)
平台兼容性
uni-app(4.87)
| Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
| - |
- |
- |
- |
√ |
√ |
5.0 |
- |
- |
| 微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
小红书小程序 |
快应用-华为 |
快应用-联盟 |
| - |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
概述
温馨提示 如何调用插件
import {
checkPermissions,
applyPermissons,
setInterceptSwitch
} from "@/uni_modules/yuange-callblock"
检查权限
checkPermissions({
onCallback(res) {
console.log(JSON.stringify(res));
}
});
申请权限
applyPermissons({
onCallback(res) {
console.log(JSON.stringify(res));
}
});
拦截开关
//true 打开 false 关闭
setInterceptSwitch(true, {
onCallback(res) {
console.log(JSON.stringify(res));
}
});
完整Demo示例
<template>
<view>
<button @click="checkPermissions_">检查权限</button>
<button @click="applyPermissons_">申请权限</button>
<button @click="setInterceptSwitch_">拦截开关</button>
<p>回调:{{result}}</p>
</view>
</template>
<script>
import {
checkPermissions,
applyPermissons,
setInterceptSwitch
} from "@/uni_modules/yuange-callblock"
export default {
data() {
return {
result: ''
}
},
methods: {
checkPermissions_() {
let that = this;
checkPermissions({
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
},
applyPermissons_() {
let that = this;
applyPermissons({
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
},
setInterceptSwitch_() {
let that = this;
setInterceptSwitch(true, {
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
}
}
}
</script>
<style>
</style>