|
@@ -8,6 +8,7 @@
|
|
|
import {
|
|
|
Toast,Indicator
|
|
|
} from 'mint-ui';
|
|
|
+ import { Loading } from 'element-ui';
|
|
|
import spaceTypes from '@/static/spaceTypesIE.js';
|
|
|
// import Bus from '@/common/bus';
|
|
|
// import commonMethod from '@/common/commonMethod.js';
|
|
@@ -53,6 +54,7 @@
|
|
|
recording: false, //语音识别是否开始
|
|
|
touching:false,
|
|
|
audioAuth:false, //录音权限
|
|
|
+ loadingInstance:null,
|
|
|
}
|
|
|
},
|
|
|
props: {
|
|
@@ -468,9 +470,15 @@
|
|
|
// word_info: 2
|
|
|
}
|
|
|
webAudioSpeechRecognizer = new WebAudioSpeechRecognizer(params);
|
|
|
- Indicator.open({
|
|
|
+ // Indicator.open({
|
|
|
+ // text: '正在链接...',
|
|
|
+ // spinnerType: 'fading-circle'
|
|
|
+ // });
|
|
|
+ this.loadingInstance = Loading.service({
|
|
|
+ lock: true,
|
|
|
text: '正在链接...',
|
|
|
- spinnerType: 'fading-circle'
|
|
|
+ spinner: 'el-icon-loading',
|
|
|
+ background: 'rgba(0, 0, 0, 0.7)'
|
|
|
});
|
|
|
// 开始识别
|
|
|
webAudioSpeechRecognizer.OnRecognitionStart = (res) => {
|
|
@@ -483,8 +491,9 @@
|
|
|
return false;
|
|
|
}else{//正常开始识别语句了
|
|
|
this.speechText = "";
|
|
|
- Indicator.close();
|
|
|
+ this.loadingInstance.close();
|
|
|
this.recording = true;//显示正在录音视图
|
|
|
+ this.$parent.showCareful = false;//隐藏
|
|
|
}
|
|
|
|
|
|
};
|
|
@@ -505,12 +514,14 @@
|
|
|
webAudioSpeechRecognizer.OnRecognitionComplete = (res) => {
|
|
|
console.log('识别结束', res);
|
|
|
this.recording = false; //录音结束
|
|
|
+ this.$parent.showCareful = true;//显示
|
|
|
};
|
|
|
// 识别错误
|
|
|
webAudioSpeechRecognizer.OnError = (res) => {
|
|
|
console.log('识别失败', res)
|
|
|
this.recording = false; //录音结束
|
|
|
- Indicator.close();
|
|
|
+ this.$parent.showCareful = true;//显示
|
|
|
+ this.loadingInstance.close();
|
|
|
};
|
|
|
// webAudioSpeechRecognizer = webAudioSpeechRecognizer;
|
|
|
// }
|
|
@@ -524,7 +535,8 @@
|
|
|
webAudioSpeechRecognizer.stop();//关闭
|
|
|
}
|
|
|
// webAudioSpeechRecognizer = null;
|
|
|
- Indicator.close();
|
|
|
+ this.loadingInstance.close();
|
|
|
+ this.$parent.showCareful = true;//显示
|
|
|
},
|
|
|
callBack(type){
|
|
|
console.warn("***viewlayout-callBack***",type)
|