• 新订单提示效果


    <script>
        function remind() {
            // 新订单提醒
            $.ajax({
                type    :'POST',
                url     :'__APP__/Index/checkNewOrder',
                data    : {},
                dataType:'json',
                success:function(data){
                    console.log(data);
                    if (data.data == 1){
                        // 右下角弹框
                        layer.open({
                            type:0,
                            title: '提示',
                            content: '您有新的订单,请及时查看',
                            anim: 2,
                            shade:0,
                            offset:"rb"
                        });
                    }
                }
            });
    
    
            // 新订单提醒
            $.ajax({
                type    :'POST',
                url     :'__APP__/Index/checkNewGroupOrder',
                data    : {},
                dataType:'json',
                success:function(data){
                    console.log(data);
                    if (data.data == 1){
                        // 右下角弹框
                        layer.open({
                            type:0,
                            title: '提示',
                            content: '您有新的【拼团】订单,请及时查看',
                            anim: 2,
                            shade:0,
                            offset:"rb"
                        });
                    }
                }
            });
    
        }
        setInterval("remind()",10000);
    </script>
    
    

    增加提示音

    <script>
        function remind() {
            // 新订单提醒
            $.ajax({
                type: 'POST',
                url: '__APP__/Index/checkNewOrder',
                data: {},
                dataType: 'json',
                success: function (data) {
                    console.log(data);
                    if (data.data == 1) {
                        playSound();
                        // 右下角弹框
                        layer.open({
                            type: 0,
                            title: '提示',
                            content: '您有新的订单,请及时查看',
                            anim: 2,
                            shade: 0,
                            offset: "rb"
                        });
                    }
                }
            });
    
    
            // 新订单提醒
            $.ajax({
                type: 'POST',
                url: '__APP__/Index/checkNewGroupOrder',
                data: {},
                dataType: 'json',
                success: function (data) {
                    console.log(data);
                    if (data.data == 1) {
                        playSound();
                        // 右下角弹框
                        layer.open({
                            type: 0,
                            title: '提示',
                            content: '您有新的【拼团】订单,请及时查看',
                            anim: 2,
                            shade: 0,
                            offset: "rb"
                        });
                    }
                }
            });
    
        }
    
    
        let playSound = function () {
            let browser = window.navigator.userAgent.toLowerCase();
            if (browser.indexOf("ie") >= 0) {
                //IE内核浏览器
                let strEmbed = '<embed name="embedPlay" src="/admin/image/voice.mp3" autostart="true" hidden="true" loop="false"></embed>';
                if ($("body").find("embed").length <= 0)
                    $("body").append(strEmbed);
                let embed = document.embedPlay;
                embed.volume = 100;
            } else {
                //非IE内核浏览器
                let strAudio = "<audio id='audioPlay' src='/admin/image/voice.mp3' hidden='true'>";
    
                if ($("#audioPlay").length <= 0) {
                    $("body").append(strAudio);
                }
                let audio = document.getElementById("audioPlay");
                //浏览器支持 audio
                audio.play();
            }
        }
    
        setInterval("remind()", 10000);
    </script>
    
  • 相关阅读:
    Android API Guides---Storage Access Framework
    Memcache安装与使用
    Can a GridView have a footer and header just like ListView?
    【大话设计模式】——简单工厂模式
    三层架构—简析
    OpenStack 使用Ceph 配置指导
    mysql 8小时问题
    centos7 安装mysql
    mysql 创建用户
    Waiting for table metadata lock
  • 原文地址:https://www.cnblogs.com/jiqing9006/p/11857356.html
Copyright © 2020-2023  润新知