更新记录
1.0.0(2024-08-30) 下载此版本
仿微信按住说话录音组件,效果基本还原
平台兼容性
uni-app
Vue2 | Vue3 | Chrome | Safari | app-vue | app-nvue | Android | iOS | 鸿蒙 |
---|---|---|---|---|---|---|---|---|
× | √ | - | - | √ | × | - | - | - |
微信小程序 | 支付宝小程序 | 抖音小程序 | 百度小程序 | 快手小程序 | 京东小程序 | 鸿蒙元服务 | QQ小程序 | 飞书小程序 | 快应用-华为 | 快应用-联盟 |
---|---|---|---|---|---|---|---|---|---|---|
√ | × | × | × | × | × | - | × | × | × | × |
1、组件参数说明
audioShow | boolean | false(用于控制弹框显示隐藏) |
---|---|---|
outShow | boolean | false(用于监听弹框显示隐藏) |
needCancel | boolean | false(用于监听手势滑动是否取消) |
needText | boolean | false(用于监听手势滑动是否编辑文字) |
needEdit | boolean | false(用于监听语音转文字功能) |
strTranslate | string | ''(用于监听语音发文字转化后接收结果回调) |
recordOptions | object | 默认录制语音配置参数 |
endRecord | function | 录制语音结束结果方法 |
endRecordFirst | function | 用于编辑时发生原语音回调方法 |
goSendText | function | 发送语音转文字后回调方法 |
2、页面中引用
<leo-recordvoice-popup :audio-show="audioShow" :outShow="outShow" :need-cancel="needCancel"
:need-text="needText" :need-edit="needEdit" :strTranslate="strQesTranslate" @goSendText="goSendText"
@endRecord="endRecord" @endRecordCancel="endRecordCancel"
@endRecordFirst="endRecordFirst"></leo-recordvoice-popup>
3、具体可参考示例项目演示