<?php

\yii\web\YiiAsset::register($this);
?>
<?php $this->beginPage() ?>
<!DOCTYPE html>
<html lang="<?= Yii::$app->language; ?>">

<head>

    <meta charset="<?= Yii::$app->charset ?>">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta http-equiv="X-UA-Compatible" content="IE=edge">
    <?= \yii\helpers\Html::csrfMetaTags() ?>
    <title>找回密码</title>
    <?php $this->head() ?>
    <link href="<?= STATIC_URL ?>/ui/css/bootstrap.min.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/font-awesome/css/font-awesome.css" rel="stylesheet">

    <link href="<?= STATIC_URL ?>/ui/css/animate.css" rel="stylesheet">
    <link href="<?= STATIC_URL ?>/ui/css/style.css" rel="stylesheet">

    <link href="<?= STATIC_URL ?>/ui/css/plugins/toastr/toastr.min.css" rel="stylesheet">




</head>

<body class="gray-bg">
<?php $this->beginBody() ?>
<div class="loginColumns animated fadeInDown">
    <div class="row">
        <div class="col-md-3"></div>
        <div class="col-md-6">
            <h1 class="text-center">找回密码</h1>
            <hr/>
        </div>
        <div class="col-md-6"></div>
    </div>
    <div class="row">
        <div class="col-md-3"></div>
        <div class="col-md-6">
            <div class="ibox-title">
                请填写表单
            </div>
            <div class="ibox-content">
                <form id="form" class="m-t" role="form">
                    <input type="hidden" name="type" value="2">
                    <div class="input-group" style="margin-bottom:15px;">
							<span class="input-group-btn">
								<button type="button" class="btn btn-default">电子邮箱</button>
							</span>
                        <input type="text" id="username" name="username" class="form-control" placeholder="请输入您的电子邮箱" required="">
                    </div>
                    <button id="login" type="button" class="btn btn-primary block full-width m-b">下一步</button>
                </form>
            </div>
            <hr/>
        </div>
        <div class="col-md-3"></div>
    </div>
    <div class="row">
        <div class="col-md-3"></div>
        <div class="col-md-6 text-right">
            <small>©2016-2018 Fusian</small>
        </div>
        <div class="col-md-3"></div>
    </div>
</div>

<?php $this->endBody() ?>


<script src="<?= STATIC_URL ?>/ui/js/jquery.1.9.1.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/bootstrap.min.js"></script>
<script src="<?= STATIC_URL ?>/ui/js/plugins/toastr/toastr.min.js"></script>
<script type="text/javascript">

    $("#login").on("click",function(){
        $.ajax({
            type: "POST",
            url: "<?= \yii\helpers\Url::to(['pwd1']) ?>",
            data: $('#form').serialize(),
            dataType: "json",
            beforeSend: function() {},
            success: function(data) {
                if(data.isSuccess){
                    var url="<?= \yii\helpers\Url::to(['/account/modify-pwd?type=2&username=']) ?>"+$("#username").val();
                    window.location.href=url;
                }else{
                    toastr.error(data.msg, "提示");
                }
            },
            complete: function(XMLHttpRequest, textStatus) {},
            error: function() {}
        });
    });

</script>

</body>
</html>