|
@@ -100,7 +100,8 @@ export default {
|
|
duioCurrentTime: null, // 剩余时间
|
|
duioCurrentTime: null, // 剩余时间
|
|
count: 0,
|
|
count: 0,
|
|
loading: null,
|
|
loading: null,
|
|
- isClick: false
|
|
|
|
|
|
+ isClick: false,
|
|
|
|
+ timer: null // 计时器
|
|
};
|
|
};
|
|
},
|
|
},
|
|
// 计算属性 类似于data概念
|
|
// 计算属性 类似于data概念
|
|
@@ -179,6 +180,7 @@ export default {
|
|
// 方法集合
|
|
// 方法集合
|
|
methods: {
|
|
methods: {
|
|
PlayAudio() {
|
|
PlayAudio() {
|
|
|
|
+ let _this = this;
|
|
let audioId = this.audioId;
|
|
let audioId = this.audioId;
|
|
let audio = document.getElementsByTagName("audio");
|
|
let audio = document.getElementsByTagName("audio");
|
|
if (
|
|
if (
|
|
@@ -218,7 +220,25 @@ export default {
|
|
}
|
|
}
|
|
setTimeout(() => {
|
|
setTimeout(() => {
|
|
if (this.audio.currentTime === 0) {
|
|
if (this.audio.currentTime === 0) {
|
|
- this.$message.warning("音频正在加载中,请稍后重试");
|
|
|
|
|
|
+ if (!document.querySelector(".el-message")) {
|
|
|
|
+ _this.$message({
|
|
|
|
+ showClose: true,
|
|
|
|
+ message: "音频正在加载中,请等待",
|
|
|
|
+ type: "warning",
|
|
|
|
+ duration: 0
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ if (_this.timer) {
|
|
|
|
+ clearInterval(_this.timer);
|
|
|
|
+ }
|
|
|
|
+ _this.timer = setInterval(() => {
|
|
|
|
+ _this.PlayAudio();
|
|
|
|
+ }, 2000);
|
|
|
|
+ } else {
|
|
|
|
+ clearInterval(_this.timer);
|
|
|
|
+ _this.timer = null;
|
|
|
|
+ _this.$message.closeAll();
|
|
}
|
|
}
|
|
}, 300);
|
|
}, 300);
|
|
|
|
|
|
@@ -349,7 +369,10 @@ export default {
|
|
// 生命周期-更新之前
|
|
// 生命周期-更新之前
|
|
beforUpdate() {},
|
|
beforUpdate() {},
|
|
// 生命周期-销毁之前
|
|
// 生命周期-销毁之前
|
|
- beforeDestory() {},
|
|
|
|
|
|
+ beforeDestory() {
|
|
|
|
+ this.$message.closeAll();
|
|
|
|
+ clearInterval(this.timer);
|
|
|
|
+ },
|
|
// 生命周期-销毁完成
|
|
// 生命周期-销毁完成
|
|
destoryed() {}
|
|
destoryed() {}
|
|
};
|
|
};
|