@extends('base::frame')

@section('pageTitle','消息提示')

@section('headAppend')
    <style type="text/css">
        @font-face {
            font-weight: normal;
            font-style: normal;
            font-family: "uifont";
            src: url('data:application/octet-stream;base64,[encoded data, 6176 characters]') format('truetype');
        }
        [class^="ui-icon-"],
        [class*=" ui-icon-"] {
            display: inline-block;
            vertical-align: middle;
            font: normal normal normal 14px/1 "uifont";
            font-size: inherit;
            text-rendering: auto;
            -webkit-font-smoothing: antialiased;
        }
        [class^="ui-icon-"]:before,
        [class*=" ui-icon-"]:before {
            display: inline-block;
            margin-left: .2em;
            margin-right: .2em;
        }
        .ui-icon-success:before{content: "\EA06";}
        .ui-icon-warn:before{content: "\EA0B";}
        body, html {background: #EEE;font:13px/20px normal Helvetica, Arial,"微软雅黑",sans-serif;padding:0;margin:0;text-align:center;line-height:1.5em;}
        .icon{padding:30px 0 0 0;}
        .icon span{display:inline-block;font-size:90px;}
        .msg{font-size:14px;color:#333;margin:20px 0 0 0;}
        .redirect{padding:10px 0;color:#999;margin:10px 0 0 0;}
        .redirect a{color:#999;text-decoration:underline;}
        .data{background:#FFF;max-height:200px;text-align:left;max-width:500px;margin:0 auto;overflow:auto;padding:10px;border-radius:5px;}
    </style>
@endsection

@section('body')

    @if($code)
        <div class="icon">
            <span class="ui-icon-warn" style="color:#F76260;"></span>
        </div>
    @else
        <div class="icon">
            <span class="ui-icon-success" style="color:#09BB07;"></span>
        </div>
    @endif
    <div class="msg">
        {{$msg}}
    </div>
    @if (!empty($redirect))
        <div class="redirect">页面即将在<b id="wait">3</b>秒后<a id="href" class="am-link-muted" href="{{$redirect}}">跳转</a>...</div>
        <script type="text/javascript">
            (function(){
                var wait = document.getElementById('wait'), href = document.getElementById('href').href;
                var interval = setInterval(function(){
                    --wait.innerHTML;
                    if(wait.innerHTML <= 1) {
                        if('[back]'==href){
                            window.history.go(-1);
                        }else if('[reload]'==href){
                            window.history.go(-1);
                        }else{
                            location.href = href;
                        }
                        clearInterval(interval);
                    };
                }, 1000);
            })();
        </script>
    @endif
    @if (!empty($data))
        <pre class="data">{{print_r($data,true)}}</pre>
    @endif

@endsection

