增加客户端提示音

pull/23/head
taoshihan1991 4 years ago
parent 39e46165b3
commit ae81ce0f85

@ -4,7 +4,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content="">
<meta name="author" content="陶士涵">
<title>GO-FLY咨询</title>
<title>GO-FLY在线咨询</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/element-ui@2.13.1/lib/theme-chalk/index.css">
<script src="/static/js/functions.js?v=0.1.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
@ -70,6 +70,9 @@
</div>
</div>
<!--//客服代码-->
<audio id="chatMessageAudio">
<source id="chatMessageAudioSource" src="/static/images/alert.mp3" type="audio/mpeg" />
</audio>
</template>
</div>
</body>
@ -79,5 +82,5 @@
var KEFU_ID='{{.KEFU_ID}}';
var REFER='{{.Refer}}';
</script>
<script src="/static/js/chat-page.js?v=0.2.4"></script>
<script src="/static/js/chat-page.js?v=0.2.5"></script>
</html>

Binary file not shown.

@ -71,6 +71,7 @@ new Vue({
//this.saveHistory(content);
this.scrollBottom();
flashTitle();//标题闪烁
this.alertSound();//提示音
}
if (redata.type == "close") {
this.chatTitle="连接关闭!请重新打开页面";
@ -365,6 +366,12 @@ new Vue({
console.log(data);
}
});
},
//提示音
alertSound(){
var b = document.getElementById("chatMessageAudio");
var p = b.play();
p && p.then(function(){}).catch(function(e){});
}
},
mounted() {
@ -377,7 +384,7 @@ new Vue({
this.getMesssagesByVisitorId();
//this.msgList=this.getHistory();
//滚动底部
this.scrollBottom();
//this.scrollBottom();
//获取欢迎
this.getNotice();

Loading…
Cancel
Save