客服端增加提示音

pull/23/head
taoshihan1991 4 years ago
parent 5cdfbdc8f9
commit c281baa42c

@ -199,8 +199,14 @@
<img src="/static/images/3.jpg"/> <img src="/static/images/3.jpg"/>
</div> </div>
<!--//图片放大--> <!--//图片放大-->
<audio id="chatMessageAudio">
<source id="chatMessageAudioSource" src="/static/images/alert2.ogg" type="audio/mpeg" />
</audio>
<audio id="chatMessageSendAudio">
<source id="chatMessageSendAudioSource" src="/static/images/sent.ogg" type="audio/mpeg" />
</audio>
</template> </template>
</div> </div>
</body> </body>
<script src="/static/js/chat-main.js?v=0.3.1"></script> <script src="/static/js/chat-main.js?v=0.3.4"></script>
</html> </html>

@ -89,6 +89,7 @@ var app=new Vue({
notification.close(); notification.close();
_this.talkTo(redata.data.uid,redata.data.username); _this.talkTo(redata.data.uid,redata.data.username);
}); });
_this.alertSound();
break; break;
case "userOffline": case "userOffline":
@ -154,6 +155,7 @@ var app=new Vue({
notification.close(); notification.close();
_this.talkTo(msg.id,msg.name); _this.talkTo(msg.id,msg.name);
}); });
_this.alertSound();
} }
}, },
//接手客户 //接手客户
@ -194,6 +196,7 @@ var app=new Vue({
}); });
} }
_this.messageContent = ""; _this.messageContent = "";
_this.sendSound();
}); });
// let content = {} // let content = {}
@ -576,6 +579,17 @@ var app=new Vue({
openUrl(url){ openUrl(url){
window.open(url); window.open(url);
}, },
//提示音
alertSound(){
var b = document.getElementById("chatMessageAudio");
var p = b.play();
p && p.then(function(){}).catch(function(e){});
},
sendSound(){
var b = document.getElementById("chatMessageSendAudio");
var p = b.play();
p && p.then(function(){}).catch(function(e){});
}
}, },
mounted() { mounted() {
document.addEventListener('paste', this.onPasteUpload) document.addEventListener('paste', this.onPasteUpload)

Loading…
Cancel
Save