@{
    Layout = null;
}<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>快捷登录窗口-PageAdmin网站管理系统</title>
    <meta name="author" content="PageAdmin CMS" data-url="http://www.pageadmin.net" />
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0,user-scalable=0,minimal-ui">
    <meta name="renderer" content="webkit" />
    <link rel="stylesheet" href="~/Incs/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="~/Incs/font-awesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="~/Areas/Member/Css/Login.css" type="text/css">
    <script src="/Js/jquery.min.js" type="text/javascript"></script>
    <!--[if lte IE 8]>
    <script src="/Js/jquery-1.12.4.min.js" type="text/javascript"></script>
    <![endif]-->
    <script src="/Incs/laydate/laydate.js" type="text/javascript"></script>
    <script src="/Js/basic.js" type="text/javascript"></script>
    <script src="~/Js/dialog.js" type="text/javascript"></script>
    <script src="/Js/UI/ui.js" type="text/javascript"></script>
    <script src="~/Js/ValidateForm/validateForm.js" type="text/javascript"></script>
    <!--[if lte IE 9]>
    <script src="/Incs/bootstrap/js/respond.min.js"></script>
    <script src="/Incs/bootstrap/js/html5.js"></script>
    <![endif]-->
    <script src="/Incs/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body class="qucik-login-win">
    <div class="container">
        <a class="closeBtn" id="closeBtn">&#10005</a>
        <div class="loginBox">
            <div class="content-box">
                <div class="login-sign">会员登录</div>
                <div id="LoginBox">
                    <form method="post" id="loginForm" data-validate-params="tipsStyle:3">
                        <div class="validate-all-tips-box"></div>
                        <div class="form-group">
                            <div class="controls ">
                                <input type="text" id="username" name="username" class="form-control" maxlength="50" placeholder="@ViewBag.PlaceHolder" data-validate="dataType:'*',nullMsg:'请填写登录账号'">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <div class="controls">
                                <input type="password" id="password" name="password" class="form-control" maxlength="50" placeholder="登录密码" data-validate="dataType:'password',nullMsg:'请填写登录密码'">
                                <span class="help-block"></span>
                            </div>
                        </div>
                        @if (ViewBag.VerificationCode == "1")
                        {
                            <div class="form-group">
                                <div class="controls">
                                    <div class="input-group">
                                        <input type="text" id="_VerificationCode" name="_VerificationCode" class="form-control" maxlength="4" placeholder="输入右侧的验证码" data-validate="dataType:'*',minLength:4,minLengthErrorMsg:'验证码最少4个字符',nullMsg:'请填写验证码',checkUrl:'/E/VerificationCode/Validate',checkError:'验证码填写错误'">
                                        <span class="input-group-btn">
                                            <a class="btn btn-default btn-verificationCodeImg"><img id="verificationCodeImg" src="/E/VerificationCode/?width=100&height=39" class="ui-verificationCodeImage" /></a>
                                        </span>
                                    </div>
                                    <span class="help-block" id="_ValidateTips__VerificationCode"></span>
                                </div>
                            </div>

                        }
                        <div class="form-group">
                            <div class="row">
                                <div class="col-md-6 col-xs-6">
                                    <span><input id="cookies" type="checkbox" name="cookies" value="1"></span>
                                    <label for="cookies" class="font-weight-normal">&nbsp;记住我的登录信息</label>
                                </div>
                                <div class="col-md-6 col-xs-6 text-right">
                                    <a href="@Url.ActionUrl("Index","Reg")" target="_blank">注册会员</a>&nbsp;&nbsp;<a href="@Url.ActionUrl("Index","FindPassword")" target="_blank">忘记密码?</a>
                                </div>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="controls controls-submit">
                                <button type="button" class="btn  btn-primary btn-lg col-xs-12 col-md-12  ui-pagePost" data-custom-params="url:'@Url.ActionUrl("Index")',callBack:'LoginSuccess',failCallBack:'FailCallBack',successMsg:''">登录</button>
                            </div>
                        </div>

                        <div class="form-group quickLogin hidden">
                            <h5>使用合作账户登录</h5>
                            <div>
                                <a class="quick-login-icon qq-icon" title="QQ登录"></a>
                                <a class="quick-login-icon weixin-icon" title="微信登录"></a>
                            </div>
                        </div>
                        @Html.AntiForgeryToken()
                    </form>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript">
        var open =@ViewBag.Open;
        var logined = "@ViewBag.Logined";
        var $form = $("#loginForm");
        var $verificationCode = $("#_VerificationCode");
    var $loginBox = $("#LoginBox");
    //保存登录信息到本地
    function SaveInfo()
    {
        if ($("#cookies").prop("checked")) {
            var serializerStr = $form .SerializeJson();
            serializerStr = JsonToString(serializerStr);
            SetLocalStorage("LoginUserInfo", serializerStr);
        }
        else
        {
           RemoveLocalStorage("LoginUserInfo");
        }
    }
    //初始化
    function Init()
    {
        var serializerStr = GetLocalStorage("LoginUserInfo");
        $form.FormBind({}, serializerStr);
        $verificationCode.val("");
        if (open == 0) {
            $loginBox.text("对不起，网站登录已经关闭！");
        }
    }
    Init();

   function LoginSuccess()
    {
            layer.msg('登录成功...', {
                icon: 16,
                time: 200000, //200秒
                shade: 0.01
       });
            SaveInfo();
            winClose();
    }
    var $tipsBox = $(".validate-all-tips-box");
    var $verificationCodeImg = $("#verificationCodeImg");

        function FailCallBack(data)
        {
            $tipsBox.text(data.Msg);
        }

        function winClose()
        {
            CloseDialog();
        }
        if (logined == "1")
        {
            //$loginBox.text("您已经登录了！");
            //winClose()
        }
        $("#closeBtn").on("click", function () { winClose(); });
    </script>
</body>
</html>