|
@@ -14,6 +14,7 @@
|
|
|
:class="[
|
|
|
audio.loading ? 'loadBtn' : audio.playing ? 'playBtn' : 'pauseBtn'
|
|
|
]"
|
|
|
+ :disabled="audio.loading"
|
|
|
@click="PlayAudio"
|
|
|
/>
|
|
|
<template v-if="!isRepeat">
|
|
@@ -119,7 +120,7 @@ export default {
|
|
|
// 监控data中数据变化
|
|
|
watch: {
|
|
|
stopAudio: {
|
|
|
- handler(val, oldVal) {
|
|
|
+ handler(val) {
|
|
|
const _this = this;
|
|
|
if (val) {
|
|
|
_this.$refs[_this.audioId].pause();
|
|
@@ -146,7 +147,7 @@ export default {
|
|
|
_this.$refs[audioId].addEventListener("play", function() {
|
|
|
_this.audio.playing = true;
|
|
|
_this.audio.isPlaying = true;
|
|
|
- _this.audio.loading = false;
|
|
|
+ // _this.audio.loading = false;
|
|
|
});
|
|
|
_this.$refs[audioId].addEventListener("pause", function() {
|
|
|
_this.audio.playing = false;
|
|
@@ -222,13 +223,12 @@ export default {
|
|
|
if (this.audio.currentTime === 0) {
|
|
|
if (!document.querySelector(".el-message")) {
|
|
|
_this.$message({
|
|
|
- showClose: true,
|
|
|
message: "音频正在加载中,请等待",
|
|
|
type: "warning",
|
|
|
duration: 0
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+ this.audio.loading = true;
|
|
|
if (_this.timer) {
|
|
|
clearInterval(_this.timer);
|
|
|
}
|
|
@@ -239,6 +239,7 @@ export default {
|
|
|
clearInterval(_this.timer);
|
|
|
_this.timer = null;
|
|
|
_this.$message.closeAll();
|
|
|
+ this.audio.loading = false;
|
|
|
}
|
|
|
}, 300);
|
|
|
|
|
@@ -256,7 +257,7 @@ export default {
|
|
|
oncanplaythrough() {
|
|
|
let _this = this;
|
|
|
// setTimeout(() => {
|
|
|
- _this.audio.loading = false;
|
|
|
+ // _this.audio.loading = false;
|
|
|
|
|
|
// }, 10000);
|
|
|
},
|
|
@@ -372,6 +373,7 @@ export default {
|
|
|
beforeDestory() {
|
|
|
this.$message.closeAll();
|
|
|
clearInterval(this.timer);
|
|
|
+ this.audio.loading = false;
|
|
|
},
|
|
|
// 生命周期-销毁完成
|
|
|
destoryed() {}
|