<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <meta http-equiv = "X-UA-Compatible" content = "IE=edge,chrome=1"/>
    <title>{$site.site_name}</title>
    <META name="keywords" content="{$site.site_keywords}" />
    <META name="description" content="{$site.site_desc}" />
    <link rel="stylesheet" href="/Public/Home/css/sign_in.css">
    <link rel="stylesheet" href="/Public/Home/css/bootstrap.min.css"/>
    <link rel="stylesheet" href="/Public/Home/css/home.css"/>
    <link rel="shortcut icon" href="/favicon.ico" type="image/x-icon"/>
    <link rel="stylesheet" href="/Public/Home/css/common.css"/>
    <link rel="stylesheet" href="/Public/Home/css/HomePage-p.css"/>
    <link rel="stylesheet" href="/Public/Home/css/Administration.css"/>
    <link rel="stylesheet" href="/Public/css/liMarquee.css"/>
    <link rel="stylesheet" href="/Public/Home/css/Apply_h.css"/>
    <link rel="stylesheet" href="/Public/Home/css/agent.css"/>
    <link rel="stylesheet" href="/Public/css/layer.css"/>


    <script src="/Public/Home/js/jquery-1.11.3.js"></script>
    <script src="/Public/js/jquery.liMarquee.js"></script>
   <script src="/Public/js/layer/layer.js"></script>
    <script src="/Public/js/laypage/laypage.js"></script>
    <script src="/Public/js/commons.js"></script>
    <script src="/Public/js/vue.min.js"></script>
    <script src="/Public/Home/js/headerlist.js"></script>

    <style>
        #message_tto{
            display: inline-block;
            padding-bottom: 5px;
            width: 20px;
            height: 20px;
            background-color: red;
            border-radius: 100%;
            color: white;
            text-align: center;
            font-size: 12px;
            font-style:normal;
            line-height: 20px;
        }
        #dowebok {
            width: 560px;margin-top: 5px;height: 30px;padding-top: 10px;
        height: 25px;
        /* top: -20px; */
        display: inline-block;
        line-height: 25px;
        vertical-align: middle;
        font-size: 14px;

        }

    </style>
</head>
<body>
<header class="co">
    <a name="top"></a>

    <div class="head">


        <div class="man oh clearfix" style="position: relative;">
            <div class="Prompt">
                hi，欢迎{$site.site_name}用户！
            </div>
            <div class="user clearfix">

                <div class="Prompt but">游客：
                    <a class="SignOut" href="/Home-Login/Index">请登录</a>
                    <a class="SignOut" href="/Home-testplay/testLogin">免费试玩</a>
                </div>
                <div class="Prompt but" style="display: none">
                    用户名：<span class="userName">xxx</span><a class="SignOut" href="javascript:logout()">退出</a>
                </div>
                <div class="Prompt red mk">
                    <p class="balance" style="margin: 0px;float:left;">我的余额：<span
                                class="money"></span> 元 <a
                                class="acn" href="javascript:hiddenAcn()">隐藏</a></p>
                   <p class="balance" style="margin: 0px; display: none">我的余额：<span
                                class="money"></span> 元 <a class="acn" href="#">显示</a></p>
                </div>
                <div class="Prompt News" id="information_newy">
                    消息 <i class="" style="color: red" id="charges" v-text='val.data'></i>
                    <ul id="information_y">
                        <li>
                            <h5>暂无消息！</h5>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>
{literal}
    <div class="man mar5 Eliminate webinfo">
        <div class="logo Prompt">
            <img  style="max-height: 55px" src="/Public/Home/img/xinlogo.png" alt=""/>
        </div>
        <div class="Noticess" style="width: 600px;float:left;margin-top: 20px;">
            <img src="/Public/Mobile/img/image_01.png" alt="" style="width: 20px;margin-bottom: -5px;">
            <div  id="dowebok" style="height:25px"></div>
        </div>
        <div class="user service Eliminate" >
            <div class="Prompt"><i class="icon icon-redPhone"></i><a href="http://wpa.qq.com/msgrd?v=3&uin={{webinfo.con_qq}}&site=qq&menu=yes" target="view_window">
                        <span >QQ客服</span></a></div>
            <div class="Prompt" ><i class="icon icon-service"></i><a
                        href="{{webinfo.con_onlines}}"
                        target="view_window">在线客服</a>
                        </div>
        </div>
    </div>
{/literal}

    <div class="Navigation">
        <div class=" man ">

            <div class="Prompt allGame ">
                <a href="#">全部游戏</a>

                <div class="gameName y_list">
                    <ul style="cursor: pointer;" class="gameList">

                    </ul>
                </div>

                <div class="kin">
                    <h4>所有游戏</h4>
                    <ul class="Eliminate gamehc">
                    </ul>
                </div>
            </div>

            <ul class="menu Eliminate Prompt" style="width: 840px;height: 40px;">
                <li class="active" style="width: 90px;">
                    <a href="/Home-Index/Index">首页</a></li>

                <li class="" style="width: 110px;">
                    <a href="/Home-Gamecenter/Index">游戏中心</a></li>

                <li class="" style="width: 110px;">
                    <a href="/home-active/index">优惠活动中心</a></li>

                <!--<li class="" style="width: 110px;">
                    <a href="/home-GameTrend/Index">走势图表</a></li>-->

                <li class="" style="width: 110px;">
                    <a id="dns" target="_blank" v-bind:href="webinfo.app_download+'dns/index.html'">DNS防劫持</a></li>

                <li class="" style="width: 110px;">
                    <a class="app_download" v-bind:href="webinfo.app_download" target="_blank">APP下载</a></li>
                <li class="" style="width: 100px;">
                    <a href="/Home-Account/Index">会员中心</a></li>
                <!-- <li class=""  id="asb" style="width: 100px; display: none;" >
                    <a href="/home-agent/index">代理中心</a> /home-agent/AgentDesc
                </li>-->
            </ul>

        </div>

    </div>

</header>
{literal}
<script>

    var asss=new Vue({
        el:'#asb',
        data:{
            val:[],
        }
    });

    $(document).ready(function(){
        $.getJSON('/api-other/Notice', {}, function(data) {
            if (!data) data = [];
            var url = data.data.remarks;
            if(url ==null){
                url ='#';
            }
            $('#dowebok').html('<a href="'+url+'">'+data.data.infocontent+'</a>');
             $('#dowebok').liMarquee({
                runshort: false,
                circular:false
            });
            $('#dowebok').css('height','25px');


        });

    });

    //新增新代理处理 2018-12-10 anton liu
    console.log('getUrlParam------',getUrlParam('invita'));
    if (getUrlParam('invita') != null) {
        localStorage.setItem('invita',getUrlParam('invita'))
    } else {
        let dom = window.location.origin
        apiAjax('/api-Nologin/getInviteByDom',{dom:dom},function (e) {
            console.log('data',e);
            if(e.status == 1){
                console.log('invita',e.data.invite);
                localStorage.setItem('invita',e.data.invite)
            }
        })
    }
    function getUrlParam(name) {
        var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); //构造一个含有目标参数的正则表达式对象
        var r = window.location.search.substr(1).match(reg);  //匹配目标参数
        if (r != null) return unescape(r[2]); return null; //返回参数值
    }

     apiAjax('/Api-Other/AgentList',{},function(data) {
         //console.log(data);
         asss.val=data.data;
         //console.log(asss.val['status'])
         if (asss.val['status'] !=0){
             $('#asb').show();
         }

     });
     var webQQ=new Vue({
        el:'#qq',
        data:{
            qqurl:[]
        }
     });
     $(function() {
         apiAjax('/api-other/getQQ',{},function(data) {
             webQQ.qqurl=data.data;
         });
     })
//    function getMyMsg() {
//        apiAjax('/Api-Other/Message',{},function (data) {
//            console.log(data);
//            if(data.status==1&&data.data>0){
//                $('.warning').show();
//            }else{
//                $('.warning').hide();
//            }
//        });
//    }




    function getMyMsgtwo() {
         var arr=[];

        apiAjax('/api/other/AllMessagetwo',{},function (data) {
            if(data.status==1){
                var id='';
                $('.warning').show();
                val=data.data.data;
                val.forEach(function (e) {
                    if(e.hasread !='1'){
                        arr.push(e);
                    }

                });

                console.log(arr);

                    if (arr.length > 0){

                        var content ="<div style='padding: 20px 80px;'>"+arr[0].content+"</div>"

                        layer.open({
                            type: 1
                            ,offset: 'rb' //具体配置参考：offset参数项
                            ,area: ['356px', '219px']
                            ,content: content
                            ,btnAlign: 'c' //按钮居中
                            ,time: 5000
                            ,shade: 0 //不显示遮罩
                            ,yes: function(){
                                layer.closeAll();
                            }
                        });
                        aa(arr[0].id)

                }


            }
        })

    }

    function getMyMsgone() {
        var type_arr=[];
        var type_arr_two=[];

        apiAjax('/api/other/AllMessageOne',{},function (data) {
            let newdata=data.data.dataone;
            if(data.status==1){
                var id='';
                $('.warning').show();
                val=data.data.dataone;
                val.forEach(function (e) {
                        type_arr.push(e);
                });

                vals=data.data.datatwo;
                vals.forEach(function (e) {
                        type_arr_two.push(e);
                });


          


 let newData=[];
       for(let i=type_arr.length-1;i>0;i--){
           if(type_arr[i].add_status==1){
            newData.push(type_arr.splice(i, 1))
           }
       }


                for(let i of newdata){
                    console.log(newdata);
                if (i.add_status==1) {
                    if (type_arr.length > 0){

                            layer.open({
                                type: 1
                                ,offset: 'rb' //具体配置参考：offset参数项
                                ,area: ['356px', '219px']
                                ,content: '<div style="padding: 11px  80px 0 80px;">您有管理员发送的信息,请查收</div><br/><div style="color: red;text-align: center;">'+newData[0][0].title+'</div><br/><div style="text-align: center;">'+newData[0][0].add_time+'</div>'
                                ,btnAlign: 'c' //按钮居中
                                ,shade: 0 //不显示遮罩
                                ,time: 7000
                                ,yes: function(){
                                    layer.closeAll();
                                }
                                ,btn: ['点击查看']
                                ,yes: function(index, layero){
                                    aa(type_arr[0].id);
                                    window.location.href='/home/account/messge?id='+type_arr[0].id;
                                }
                                ,cancel: function(){
                                    //右上角关闭回调

                                    //return false 开启该代码可禁止点击该按钮关闭
                                }
                            });
                        }
                    }
                }


                if (data.data.data > 0){
                    $('#message_tto').text(data.data.data);
                    $('#message_tto').show();
                }else {
                    $('#message_tto').hide();
                }


                if (type_arr_two.length > 0){

                    var content ="<div style='padding: 20px 80px;'>"+type_arr_two[0].content+"</div>"

                    layer.open({
                        type: 1
                        ,offset: 'rb' //具体配置参考：offset参数项
                        ,area: ['356px', '219px']
                        ,content: content
                        ,btnAlign: 'c' //按钮居中
                        ,time: 5000
                        ,shade: 0 //不显示遮罩
                        ,yes: function(){
                            layer.closeAll();
                        }
                    });
                    aa(type_arr_two[0].id)

                }

            }else {
                $('.warning').hide();
            }
        })

    }

//    getMyMsgtwo();
//    getMyMsgone();
    function aa(id) {
        apiAjax('/Api-Other/MessageRed',{'id':id},function(data){
        });
    }

    apiAjax('/Api-Other/Message', {}, function (data) {
        if (data.status == 1 && data.data > 0){
            $('#message_tto').text(data.data);
            $('#message_tto').show();
        }else {
            $('#message_tto').hide();
        }
    });

    $(function () {
        setInterval("getMyMsgone()",10000);
    });

//    kaiYou.storage.getItem('message_id',1);
    function tiped(id) {
        apiAjax('/Api-Other/Tmessage',{'id':id},function(data){
        });
    }






</script>
{/literal}
