前端语音提醒

<script>
var iNotify = new iNotify({
    message: '有消息了。',//标题
    effect: 'flash', // flash | scroll 闪烁还是滚动
    interval: 300,
    audio:{
        //file: ['/Public/sound/msg.mp4','/Public/sound/msg.mp3','/Public/sound/msg.wav']
        file:'http://tts.baidu.com/text2audio?lan=zh&ie=UTF-8&spd=5&text=有客户申请提现啦'
    }
});
<eq name="withdraw" value="1">
        setInterval(function() {

            $.ajax({
                type: "GET",
                url: "<{:U('Withdrawal/checkNotice')}>",
                cache: false,
                success: function (res) {
                    if (res.num>0) {
                        iNotify.setFavicon(res.num).setTitle('提现通知').notify({
                            title: "新通知",
                            body: "有客户,提现啦..."
                        }).player();
                    }
                }
            });
        },10000);

</eq>

        

</script>

iNotifyjs下载链接:https://www.oschina.net/p/iNotifyjs

posted @ 2019-07-20 20:31  PHPer100  阅读(467)  评论(0编辑  收藏  举报