|
@@ -119,18 +119,11 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
watch: {
|
|
|
- 'audioData.list':{
|
|
|
- handler(nval,old){
|
|
|
- // console.log('watch',nval,old);
|
|
|
- if(nval.length>0){
|
|
|
- if(old){
|
|
|
- this.init('change')
|
|
|
- }else{
|
|
|
- this.init()
|
|
|
- }
|
|
|
- }
|
|
|
+ 'audioData.reportId':{
|
|
|
+ handler(nval,oval){
|
|
|
+ console.log('音频的报告id:',nval,oval);
|
|
|
+ this.init()
|
|
|
},
|
|
|
- deep:true,
|
|
|
immediate:true
|
|
|
}
|
|
|
},
|
|
@@ -146,28 +139,16 @@ export default {
|
|
|
},
|
|
|
methods: {
|
|
|
init(type){
|
|
|
- console.log('init',this.$store.state.report.audioData);
|
|
|
let curAudio=this.$store.state.report.audioData.list[this.$store.state.report.audioData.index]
|
|
|
- if(this.globalBgMusic.src){
|
|
|
- // console.log(this.globalBgMusic);
|
|
|
- console.log('type',type);
|
|
|
- if(type==='change'){
|
|
|
- this.globalBgMusic.src=curAudio.video_url
|
|
|
- this.globalBgMusic.title=curAudio.video_name
|
|
|
- }else{
|
|
|
- if(!this.globalBgMusic.paused){
|
|
|
- this.globalBgMusic.src=curAudio.video_url
|
|
|
- this.globalBgMusic.title=curAudio.video_name
|
|
|
- }
|
|
|
- this.currentTime=parseInt(this.globalBgMusic.currentTime)
|
|
|
- this.play=!this.globalBgMusic.paused
|
|
|
- }
|
|
|
- }else{
|
|
|
+ if(this.globalBgMusic.src!=curAudio.video_url){
|
|
|
this.globalBgMusic.src=curAudio.video_url
|
|
|
this.globalBgMusic.title=curAudio.video_name
|
|
|
}
|
|
|
+
|
|
|
this.title=curAudio.video_name
|
|
|
this.audioTime=curAudio.video_play_seconds
|
|
|
+ this.currentTime=parseInt(this.globalBgMusic.currentTime)
|
|
|
+ this.play=!this.globalBgMusic.paused
|
|
|
this.handleAudioFun()
|
|
|
},
|
|
|
|
|
@@ -223,13 +204,13 @@ export default {
|
|
|
if(temIndex>0){
|
|
|
let index=temIndex-1
|
|
|
this.$store.commit('updateAudioIndex', index)
|
|
|
- this.init('change')
|
|
|
+ this.init()
|
|
|
}
|
|
|
}else{
|
|
|
if(temIndex<this.$store.state.report.audioData.list.length-1){
|
|
|
let index=temIndex+1
|
|
|
this.$store.commit('updateAudioIndex', index)
|
|
|
- this.init('change')
|
|
|
+ this.init()
|
|
|
}
|
|
|
}
|
|
|
},
|