fix: bug
This commit is contained in:
@@ -148,17 +148,25 @@ const initRecord = () => {
|
||||
let _recordPerm = uni.getAppAuthorizeSetting()
|
||||
let _state = _recordPerm.microphoneAuthorized
|
||||
if(_state === 'authorized'){
|
||||
showTalkingModel.value = true
|
||||
if(isStopNum.value === isStartNum.value){
|
||||
stopRecord()
|
||||
}else{
|
||||
showTalkingModel.value = true
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
const startFlag = ref(1)
|
||||
// const canStart = ref(true)
|
||||
const isStartNum = ref(0)
|
||||
const isStopNum = ref(0)
|
||||
const startRecord = () => {
|
||||
isStartNum.value += 1
|
||||
unref(recordObjCom).start({format:'mp3'})
|
||||
}
|
||||
|
||||
const stopRecord = () => {
|
||||
isStopNum.value = isStartNum.value
|
||||
try{
|
||||
if(unref(recordObjCom).stop){
|
||||
unref(recordObjCom).stop()
|
||||
|
||||
Reference in New Issue
Block a user