更新记录
1.0.0(2026-04-26)
平台兼容性
uni-app(4.87)
| Vue2 |
Vue3 |
Chrome |
Safari |
app-vue |
app-nvue |
Android |
iOS |
鸿蒙 |
| - |
- |
- |
- |
√ |
√ |
5.0 |
- |
- |
| 微信小程序 |
支付宝小程序 |
抖音小程序 |
百度小程序 |
快手小程序 |
京东小程序 |
鸿蒙元服务 |
QQ小程序 |
飞书小程序 |
小红书小程序 |
快应用-华为 |
快应用-联盟 |
| - |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
- |
uni-app x(4.87)
| Chrome |
Safari |
Android |
iOS |
鸿蒙 |
微信小程序 |
| - |
- |
- |
- |
- |
- |
概述
温馨提示 如何调用插件
import {
checkPermissions,
applyPermissons,
checkOpenRecord,
openRecord,
getCallRecordAudio,
getCallPhoneLog,
startCallService,
stopCallService
} from "@/uni_modules/yuange-recordaudio"
检查权限
checkPermissions({
onCallback(res) {
console.log(JSON.stringify(res));
}
});
申请权限
applyPermissons({
onCallback(res) {
console.log(JSON.stringify(res));
}
});
检查打开录音设置
checkOpenRecord({
onCallback(res) {
console.log(JSON.stringify(res));
}
});
打开录音设置
openRecord({
onCallback(res) {
console.log(JSON.stringify(res));
}
});
获取录音记录
//分页查询page 1, pageSize 10
getCallRecordAudio(1, 10, {
onCallback(res) {
console.log(JSON.stringify(res));
}
});
获取通话记录
//分页查询page 1, pageSize 10
getCallPhoneLog(1, 10, {
onCallback(res) {
console.log(JSON.stringify(res));
}
});
启动来电服务
startCallService({
onCallback(res) {
console.log(JSON.stringify(res));
}
});
停止服务
stopCallService({
onCallback(res) {
console.log(JSON.stringify(res));
}
});
完整Demo示例
<template>
<view>
<button @click="checkPermissions_">检查权限</button>
<button @click="applyPermissons_">申请权限</button>
<button @click="checkOpenRecord_">检查打开录音设置</button>
<button @click="openRecord_">打开录音设置</button>
<button @click="getCallRecordAudio_">获取录音记录</button>
<button @click="getCallPhoneLog_">获取通话记录</button>
<button @click="startCallService_">启动来电服务</button>
<button @click="stopCallService_">停止服务</button>
<p>回调:{{result}}</p>
</view>
</template>
<script>
import {
checkPermissions,
applyPermissons,
checkOpenRecord,
openRecord,
getCallRecordAudio,
getCallPhoneLog,
startCallService,
stopCallService
} from "@/uni_modules/yuange-recordaudio"
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));
}
});
},
checkOpenRecord_() {
let that = this;
checkOpenRecord({
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
},
openRecord_() {
let that = this;
openRecord({
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
},
getCallRecordAudio_() {
let that = this;
//分页查询page 1, pageSize 10
getCallRecordAudio(1, 10, {
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
},
getCallPhoneLog_() {
let that = this;
//分页查询page 1, pageSize 10
getCallPhoneLog(1, 10, {
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
},
startCallService_() {
let that = this;
startCallService({
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
},
stopCallService_() {
let that = this;
stopCallService({
onCallback(res) {
that.result = JSON.stringify(res);
console.log(JSON.stringify(res));
}
});
}
}
}
</script>
<style>
</style>