diff --git a/components/audio-player/audio-player.vue b/components/audio-player/audio-player.vue index 39beb18..97297b5 100644 --- a/components/audio-player/audio-player.vue +++ b/components/audio-player/audio-player.vue @@ -153,6 +153,8 @@ this.audioContext.play(); this.playing=true; this.currentTime=this.formatSeconds(second); + // 重新计时 + this.$emit("onPlay",this.audioContext); }, onPlayerPlay(){ //console.log('开始播放'); @@ -183,7 +185,11 @@ this.checkSecond=intTime; this.$emit("onPlaying",this.audioContext,intTime); } - + // 相等的时候,关闭计时 + if(this.currentTime == this.allTime){ + //图标变换 + this.onPlayerEnded() + } } }, onPlayerEnded(){