Browse Source

录音过程中退出页面的情况

cxmo 2 years ago
parent
commit
4f55dc6e1e
1 changed files with 5 additions and 0 deletions
  1. 5 0
      pages-question/answerDetail.vue

+ 5 - 0
pages-question/answerDetail.vue

@@ -213,12 +213,17 @@ export default {
       isSlider: false,
       isSlider: false,
       scrollTop:0,
       scrollTop:0,
       isStart:false,//判断录音是否开始
       isStart:false,//判断录音是否开始
+      //globalRecorder:uni.getRecorderManager(),
     };
     };
   },
   },
   onLoad(options) {
   onLoad(options) {
     this.initAudio();
     this.initAudio();
     this.getQuestionItem(options.id);
     this.getQuestionItem(options.id);
   },
   },
+  onUnload() {
+    //录音时误操作退出页面的情况
+    this.globalRecorder.stop()
+  },
   methods: {
   methods: {
     //初始化audio
     //初始化audio
     initAudio() {
     initAudio() {