@{
    Layout = "../_QuickLayoutPage.cshtml";
}
<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 v-if="Open==0">对不起，找回密码功能未开放！</div>
            <div v-if="Open==1">
                <el-form ref="form" label-position="top" v-if="Open==1">
                    <el-form-item label="用户名*">
                        <el-input v-model="formData.Account" placeholder="用户名/绑定邮箱/绑定手机" v-validate="{data:formData.Account,dataType:'*',nullMsg:'请填写账号'}" maxlength="30"></el-input>
                        <span class="help-block validate-tips-box">请填写要找回的帐号、或账号绑定的邮箱或手机</span>
                    </el-form-item>
                    @if (ViewBag.VerificationCode == "1")
                    {
                        <el-form-item label="验证码*">
                            <el-input v-model="formData.VerificationCode" id="verificationCode" maxlength="4" placeholder="输入右侧的验证码" v-validate="{data:formData.VerificationCode,dataType:'*',minLength:4,minLengthErrorMsg:'验证码最少4个字符',focusTarget:'#verificationCode',nullMsg:'请填写验证码!'}">
                                <template slot="append">
                                    <ui-verification-code-image src="/E/VerificationCode/?width=100&height=30"></ui-verification-code-image>
                                </template>
                            </el-input>
                            <span class="help-block validate-tips-box"></span>
                        </el-form-item>
                    }
                    <el-form-item>
                        <div class="controls" style="padding-top:20px;">
                            <el-button type="primary" v-on:click="postSubmit">下一步</el-button>
                        </div>
                    </el-form-item>
                </el-form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
    var formData = { Account: "", VerificationCode:""};
    //vue实例化
    var vue = new Vue({
        el: "#findPassword",
        data: {
            formData: formData,
            Open:@ViewBag.Open,
        },
        methods: {
            postSubmit: function () {
                var validated = this.validateForm({ });//jquery表单验证
                if (validated) {
                    this.submit({ url: "@Url.ActionUrl("Index")", data: formData, showSuccessMsg: false, success: loginSuccess });
                }
            },
        },
    });
    function loginSuccess(result)
    {
        location.href = "@Url.ActionUrl("ConfirmQuick")";
    }
    addEvent(window, 'keyup', function (event) {
        if (event.keyCode == 13) {
            vue.postSubmit();
        }
    });
</script>
