<?php 
    $web = DB::table('admin_site')->first();
?>
<!DOCTYPE html>
<html lang="{{ app()->getLocale() }}">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta http-equiv="X-UA-Compatible" content="IE=Edge,chrome=1">
    <title>{{$web->web_title}} - 商户面板</title>
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,minimum-scale=1,user-scalable=no">
    <meta name="keywords" content="{{$web->web_title}}">
    <meta name="description" content="{{$web->web_title}}">
    <link rel="shortcut icon" href="{{URL::asset('members/icon/icon.png')}}"  type="image/x-icon"/>
    <link href="{{URL::asset('members/css/app.css')}}" rel="stylesheet" type="text/css">
    </head>
    <body>
       <div id="backstage">
        <div class="ivu-layout ivu-layout-has-sider" style="min-height: 100vh;">
          <div class="ivu-layout-sider" style="width: 208px; min-width: 208px; max-width: 208px; flex: 0 0 208px;">
            <div class="ivu-layout-sider-children">
             <div class="left_backstage_box">
                <img src="{{$web->web_logo}}" class="logo" style="display: block;">
                <div class="suod" style="display: block;"><img src="/members/icon/suo.png"></div>
                <!---->
                <div class="backstage_option <?php if(request()->path() =='/' || request()->path() =='user_info' || request()->path() =='payment' || request()->path() =='withdraw' || request()->path() =='loginlog' || request()->path() =='capital_change'){echo 'backstage_option_zhan';}?>" <?php if(request()->path() =='/' || request()->path() =='user_info' || request()->path() =='payment' || request()->path() =='withdraw' || request()->path() =='loginlog' || request()->path() =='capital_change'){echo 'style="max-height:500px;"';}?>>
                    <div class="type_title">
                    <img class="icon" <?php if(request()->path() =='/' || request()->path() =='user_info' || request()->path() =='payment' || request()->path() =='withdraw' || request()->path() =='loginlog' || request()->path() =='capital_change'){echo 'src="/members/baseicon/1-s.png"';}else{echo 'src="/members/baseicon/1.png"';}?>>我的账户
                    <span></span>
                    <img src="/members/baseicon/ac.png" class="jiant">
                    </div>
                 <div class="type_dang" <?php if(request()->path() =='/'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/">信息总汇</div>
                 <div class="type_dang" <?php if(request()->path() =='user_info'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/user_info">个人信息</div>
                 <div class="type_dang"<?php if(request()->path() =='loginlog'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/loginlog">登录日志</div>
                 <div class="type_dang" <?php if(request()->path() =='capital_change'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/capital_change">资金变动</div>
                 <div class="type_dang" <?php if(request()->path() =='payment'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/payment">支付通道</div>
                 <div class="type_dang" <?php if(request()->path() =='withdraw'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/withdraw">申请提现</div>
                </div>
                <div class="backstage_option <?php if(request()->path() =='settlement_records' || request()->path() =='settlement_account'){echo 'backstage_option_zhan';}?>" <?php if(request()->path() =='settlement_records' || request()->path() =='settlement_account'){echo 'style="max-height:500px;"';}?>>
                    <div class="type_title">
                    <img class="icon" <?php if(request()->path() =='settlement_records' || request()->path() =='settlement_account'){echo 'src="/members/baseicon/2-s.png"';}else{echo 'src="/members/baseicon/2.png"';}?>>提款管理
                    <span></span>
                    <img src="/members/baseicon/ac.png" class="jiant">
                    </div>
                 <div class="type_dang" <?php if(request()->path() =='settlement_records'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/settlement_records">提款记录</div>
                 <div class="type_dang" <?php if(request()->path() =='settlement_account'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/settlement_account">提款账户</div>
                </div>
                <div class="backstage_option <?php if(request()->path() =='order_record'){ echo 'backstage_option_zhan';}?>" <?php if(request()->path() =='order_record'){echo 'style="max-height:500px;"';}?>>
                    <div class="type_title">
                    <img class="icon" <?php if(request()->path() =='order_record'){echo 'src="/members/baseicon/3-s.png"';}else{echo 'src="/members/baseicon/3.png"';}?>>交易数据
                    <span></span>
                    <img src="/members/baseicon/ac.png" class="jiant">
                    </div>
                 <div class="type_dang" <?php if(request()->path() =='order_record'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/order_record">交易记录</div>
                </div>
                <div class="backstage_option <?php if(request()->path() =='statistics'){ echo 'backstage_option_zhan';}?>" <?php if(request()->path() =='statistics'){echo 'style="max-height:500px;"';}?>>
                    <div class="type_title">
                    <img class="icon" <?php if(request()->path() =='statistics'){echo 'src="/members/baseicon/4-s.png"';}else{echo 'src="/members/baseicon/4.png"';}?>>数据统计
                    <span></span>
                    <img src="/members/baseicon/ac.png" class="jiant">
                    </div>
                 <div class="type_dang" <?php if(request()->path() =='statistics'){ echo 'style="color: rgb(56, 108, 250); font-weight: bold;"';}?> data-url="/statistics">订单统计</div>
                </div>
                <div class="backstage_option">
                    <div class="type_title">
                    <img class="icon" src="/members/baseicon/6.png">开发详情
                    <span></span>
                    <img src="/members/baseicon/ac.png" class="jiant">
                    </div>
                 <div class="type_dang" data-url="/static/1.docx">开发文档</div>
                 <div class="type_dang" data-url="/static/sdk1.zip">SDK下载</div>
                </div>
                <!---->
             </div>
            </div>
            <div class="ivu-layout-sider-trigger" style="width: 208px;"><i class="ivu-icon ivu-icon-ios-arrow-back ivu-layout-sider-trigger-icon"></i></div>
          </div>
          <div class="ivu-layout">
            <div class="hide">
                <div class="hide_z">
                <div class="coz_box">
                    <div class="bianjie" style="margin-right: 25px;" data-url="tencent://message/?uin={{$web->web_qq}}">
                    <img src="/members/baseicon/7.png" class="img_2">
                    <img src="/members/baseicon/7-s.png" class="img_1">
                    <span>联系客服</span>
                    </div>
                    <div class="bianjie" style="margin-right: 25px;">
                    <img src="/members/baseicon/8.png" class="img_2">
                    <img src="/members/baseicon/8-s.png" class="img_1">
                    <span>意见反馈</span>
                    </div>
                    <div class="bianjie">
                    <img src="/members/baseicon/9.png" class="img_2">
                    <img src="/members/baseicon/9-s.png" class="img_1">
                    <span>便捷操作</span>
                    </div>
                    <div class="bianjie_box">
                    <div data-url="/upgrade"><img src="/members/baseicon/12.png"><img src="/members/baseicon/12-s.png"><span>自助升级</span></div>
                    <div data-url="/withdraw"><img src="/members/baseicon/13.png"><img src="/members/baseicon/13-s.png"><span>申请提现</span></div>
                    <div data-url="/order_record"><img src="/members/baseicon/14.png"><img src="/members/baseicon/14-s.png"><span>交易记录</span></div>
                    </div>
                    <div class="lingd">
                    <img src="/members/baseicon/10.png">
                    </div>
                    <div class="urel_box">
                    <img src="/members/baseicon/11.png">
                    <span>{{session()->get('user')['phone']}}</span>
                    </div>
                    <div class="bianjie_box dengc">
                    <div data-url="/change_password"><img src="/members/baseicon/15.png"><img src="/members/baseicon/15-s.png"><span>修改密码</span></div>
                    <div data-url="/signout"><img src="/members/baseicon/16.png"><img src="/members/baseicon/16-s.png"><span>退出登录</span></div>
                    </div>
                    </div>
                </div>
            </div>
          @yield('content')
          </div>
        </div>
       </div>
    <script>
     function hasClass(element, cls) {
       var className = " " + cls + " ",
         rclass = /[\t\n\r\f]/g;
       if (element.nodeType === 1 
         && (" " + element.className + " ").replace(rclass, " ").indexOf(className) >= 0) {
         return true;
       } 
       return false;
     } 
     function addClass(elements, cName) {
        if (!hasClass(elements, cName)) {
            elements.className += " " + cName;
        };
    }
    function stopPropagation(e) {
            e = e || window.event;
            if(e.stopPropagation) { //W3C阻止冒泡方法
                e.stopPropagation();
            } else {
                e.cancelBubble = true; //IE阻止冒泡方法
            }
    }

    </script>
     <script>
     var divli =document.getElementsByClassName('backstage_option');
        for(var i = 0;i < divli.length;i++){ 
            divli[i].addEventListener('click',function(event){
                event.stopPropagation();
                if(hasClass(this,'backstage_option_zhan')){
                    this.classList.remove("backstage_option_zhan");
                    this.style.maxHeight='53px';
                    this.getElementsByClassName('icon')[0].setAttribute('src',this.getElementsByClassName('icon')[0].getAttribute("src").replace('-s.png','.png')) ;
                }else{
                    if(document.getElementsByClassName('backstage_option_zhan')[0]){
                        document.getElementsByClassName('backstage_option_zhan')[0].style.maxHeight='53px';
                        document.getElementsByClassName('backstage_option_zhan')[0].getElementsByClassName('icon')[0].setAttribute('src',document.getElementsByClassName('backstage_option_zhan')[0].getElementsByClassName('icon')[0].getAttribute("src").replace('-s.png','.png')) ;
                        document.getElementsByClassName('backstage_option_zhan')[0].classList.remove("backstage_option_zhan");
                    }
                    addClass(this,'backstage_option_zhan');
                    this.style.maxHeight='500px';
                    this.getElementsByClassName('icon')[0].setAttribute('src',this.getElementsByClassName('icon')[0].getAttribute("src").replace('.png','-s.png')) ;
                }
            },false);
            var divtype=divli[i].getElementsByClassName('type_dang');
            for(var s=0;s<divtype.length;s++){
                divtype[s].addEventListener('click',function(event){
                    event.stopPropagation();
                    if(this.getAttribute("data-url")!= null){
                        window.location.href=this.getAttribute("data-url");
                    }
                },false);
            }
        }
     var topdiv =  document.getElementsByClassName('bianjie_box');
     for(var i = 0;i < topdiv.length;i++){ 
        var topdivs=topdiv[i].getElementsByTagName('div');
        for(var n=0;n<topdivs.length;n++){
            topdivs[n].addEventListener('click',function(event){
                if(this.getAttribute("data-url")!= null){
                     window.location.href=this.getAttribute("data-url");
                 }
            });
        }
     }
     var bianjiediv = document.getElementsByClassName('bianjie');
     for(var i= 0;i<bianjiediv.length;i++){
          bianjiediv[i].addEventListener('click',function(event){
                if(this.getAttribute("data-url")!= null){
                     window.location.href=this.getAttribute("data-url");
                 }
          });
     }
     </script>
    </body>
</html>