增加客户端提示音

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="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="description" content=""> <meta name="description" content="">
<meta name="author" 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"> <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="/static/js/functions.js?v=0.1.1"></script>
<script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script> <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
@ -70,6 +70,9 @@
</div> </div>
</div> </div>
<!--//客服代码--> <!--//客服代码-->
<audio id="chatMessageAudio">
<source id="chatMessageAudioSource" src="/static/images/alert.mp3" type="audio/mpeg" />
</audio>
</template> </template>
</div> </div>
</body> </body>
@ -79,5 +82,5 @@
var KEFU_ID='{{.KEFU_ID}}'; var KEFU_ID='{{.KEFU_ID}}';
var REFER='{{.Refer}}'; var REFER='{{.Refer}}';
</script> </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> </html>

Binary file not shown.

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

Loading…
Cancel
Save