提交: 声音测试

This commit is contained in:
23688nl 2022-09-01 11:48:36 +08:00
parent 20873eab95
commit 84a66a1473
1 changed files with 9 additions and 4 deletions

View File

@ -6,8 +6,8 @@
autoplay
src="/images/alarm_tips.mp3"
ref="audio"
v-if="audioHidden"
></audio>
<el-button @click="handleTextSend">ws 告警通知</el-button>
<div class="e-dialog-div" v-show="dialogShow">
<div class="dialog-top">
<span class="info-title">报警提醒</span>
@ -69,6 +69,7 @@ export default {
socket_flag: true,
timeout_flag: null,
dialogShow: false,
audioHidden: false,
interval: null,
intervalTime: 10,
alarmInfo: {
@ -80,10 +81,11 @@ export default {
},
watch: {},
created() {
setTimeout(this.handleTextSend, 10000);
setTimeout(this.handleTextSend, 5000);
},
methods: {
handleTextSend() {
console.log('handleTextSend-')
this.dialogShow = true;
this.handlePlayAudio();
},
@ -98,12 +100,15 @@ export default {
if(this.interval) {
clearInterval(this.interval)
};
this.audioHidden = false;
setTimeout(this.handleTextSend, 5000);
};
},
//
handlePlayAudio() {
this.$refs.audio.currentTime = 0; //
this.$refs.audio.play(); //
// this.$refs.audio.currentTime = 0; //
// this.$refs.audio.play(); //
this.audioHidden = true;
if (this.interval) {
clearInterval(this.interval);
}