|
@@ -30,11 +30,18 @@ export default {
|
|
}
|
|
}
|
|
},
|
|
},
|
|
onLoad() {
|
|
onLoad() {
|
|
|
|
+ //this.initAudio()
|
|
|
|
+ },
|
|
|
|
+ onShow(){
|
|
this.initAudio()
|
|
this.initAudio()
|
|
},
|
|
},
|
|
- onUnload() {
|
|
|
|
|
|
+ onHide(){
|
|
|
|
+ this.resetAudio()
|
|
this.destroyAudio()
|
|
this.destroyAudio()
|
|
},
|
|
},
|
|
|
|
+ onUnload() {
|
|
|
|
+ //this.destroyAudio()
|
|
|
|
+ },
|
|
methods: {
|
|
methods: {
|
|
//初始化audio
|
|
//初始化audio
|
|
initAudio() {
|
|
initAudio() {
|
|
@@ -47,6 +54,23 @@ export default {
|
|
this.innerAudio.destroy()
|
|
this.innerAudio.destroy()
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ //重置音频播放信息
|
|
|
|
+ resetAudio(){
|
|
|
|
+ this.innerAudio.pause();
|
|
|
|
+ this.questionList.map((i) => {
|
|
|
|
+ if(i.id===this.currentAudioMsg.id){
|
|
|
|
+ i.answer.isplay = false
|
|
|
|
+ i.answer.ispause = false
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ this.changeCurrentAudio({
|
|
|
|
+ id: '',
|
|
|
|
+ answer: {
|
|
|
|
+ source: '',
|
|
|
|
+ audioTime: 0
|
|
|
|
+ }
|
|
|
|
+ })
|
|
|
|
+ },
|
|
//audio事件
|
|
//audio事件
|
|
handleAudioFun() {
|
|
handleAudioFun() {
|
|
this.innerAudio.onPlay(() => {
|
|
this.innerAudio.onPlay(() => {
|