@{
    Layout = "../_QuickLayoutPage.cshtml";
    CurrentUser findUser = (CurrentUser)ViewBag.FindUser;
}
<div class="container cxform" id="findPassword">
    <a class="closeBtn" href="javascript:closeSelf()">&#10005</a>
    <div class="loginBox">
        <div class="content-box">
            <div class="login-sign">重置密码</div>
            <div id="findBox">
                <el-form ref="form" label-position="top">
                    <el-form-item label="用户名：">
                        <el-input v-model="formData.Username" placeholder="用户名" disabled></el-input>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>
                    <el-form-item label="重设密码：">
                        <el-input v-model="formData.Password" type="password" autocomplete="off" placeholder="请填写密码" v-validate="{data:formData.Password,dataType:'password',nullMsg:'请填写密码!',errorMsg:'密码长度控制在2到16位字符之间！'}" maxlength="16"></el-input>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>
                    <el-form-item label="密码确认：">
                        <el-input v-model="formData.Password1" id="password1" autocomplete="off" type="password" placeholder="请填写确认密码" v-validate="{data:formData.Password1,focusTarget:'#password1',nullMsg:'请填写确认密码!',errorMsg:'两次输入的密码不一致!',compare:formData.Password}" maxlength="16"></el-input>
                        <span class="help-block validate-tips-box"></span>
                    </el-form-item>
                    <el-form-item>
                        <div class="controls button-spacing">
                            <el-button type="primary" v-on:click="postSubmit">下一步</el-button>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
        </div>
    </div>
</div>
<div class="login-sign"></div>
<script type="text/javascript">
    var formData = { Username: "@findUser.UserName", Password: "", Password1: "" };
    //vue实例化
    var vue = new Vue({
        el: "#findPassword",
        data: {
            formData: formData,
        },
        methods: {
            postSubmit: function () {
                var validated = this.validateForm({ });//jquery表单验证
                if (validated) {
                    this.submit({ url: "@Url.ActionUrl("ModifyPassword")", data: formData, showSuccessMsg: false, success: loginSuccess });
                }
            },
        },
    });
    function loginSuccess(result)
    {
        location.href = "@Url.ActionUrl("SuccessQuick")?username=" + urlEncode(result.Description);
    }
    addEvent(window, 'keyup', function (event) {
        if (event.keyCode == 13) {
            vue.postSubmit();
        }
    });
</script>