$(document).ready(function () {
    bindEvent();
});

function bindEvent(){
    $("#passwordDiv").hide();
    $("#verifiCode").parent().removeClass('col-xs-8');
    $("#verifiCode").parent().addClass('col-xs-5');
}

function getReportFormData(){
    var loginName = $("#loginName").val();
    var email = $("#email").val();
    var verifiCode = $("#verifiCode").val();
    var password = $("#password").val();
    return {
        loginName : loginName,
        email : email,
        verifiCode : verifiCode,
        password : password
    }
}

//发送验证码
function sendCode(){
    var reportForms = this.getReportFormData();
    Public.ajax(web_app.name + '/forget/sendVerifiCode.ajax',
        {
            loginName:reportForms.loginName,
            email : reportForms.email,
            verifiCode : reportForms.verifiCode
        },
        function(data) {
            if (data.caStatus==1){//发送验证码成功后显示密码输入框
                //Public.tip("验证码发送成功，请注意查收！");
                $("#passwordDiv").show();
                $("#password").attr("required",true);
                $("#password_label").addClass("required");
            }
            refreshFlag = true;
        }
    );
}