function regsubmit(coopForm){
    var username_='username',phone_='phone',email_="email",remarks_='remarks';

    var form = $("#" + coopForm);
    var username = form.find("input[name="+username_+"]");
    var phone = form.find("input[name="+phone_+"]");
    var email = form.find("input[name="+email_+"]");
    var remarks = form.find("textarea[name="+remarks_+"]");

    var status = 1;
    var num = $("#type");
    //检查昵称
    if (username.val() != undefined) {
        if (username.val() == "") {
            layer_tips("请输入您的姓名，如有疑问请咨询客服", username);
            username.focus();
            status = 0;
            return false;
        }

        if (username.val().match(regexEnum.chinese) == null) {
            layer_tips("姓名只能为汉字，如有疑问请咨询客服", username);
            username.focus();
            status = 0;
            return false;
        }
    }

    //检查手机号码
    if (phone.val() != undefined) {
        if (phone.val() == "") {
            layer_tips("请输入手机号码，如有疑问请咨询客服", phone);
            phone.focus();
            status = 0;
            return false;
        }

        if (phone.val().match(regexEnum.mobile) == null) {
            layer_tips("手机号码格式错误，如有疑问请咨询客服", phone);
            phone.focus();
            status = 0;
            return false;
        }
    }

    //检查邮箱
    if (email.val() != undefined) {
        if (email.val() == "") {
            layer_tips("请输入邮箱，如有疑问请咨询客服", email);
            email.focus();
            status = 0;
            return false;
        }

        if (email.val().match(regexEnum.email) == null) {
            layer_tips("邮箱格式错误，如有疑问请咨询客服", email);
            email.focus();
            status = 0;
            return false;
        }
    }

//提交表单的网址------------------------------------------------


    if (status == 1) {
        var posturl = "/api/save-partner-apply";//提交表单的网址
        var postparam = {
            "name": username.val(),
            "mobile": phone.val(),
            "email": email.val(),
            "memo": remarks.val(),
            "type":num.val()
        }
        $.ajax({
            type: "POST",
            data:postparam,
            url: posturl,
            async: false,
            dataType: "json",
            success: function(data) {
                if(data){
                    //清空表单
                    if (username.val() != undefined) {
                        username.val("");
                    }

                    if (phone.val() != undefined) {
                        phone.val("");
                    }

                    if (email.val() != undefined) {
                        email.val("");
                    }

                    layer.msg(
                        '恭喜您！您的申请已成功提交'+"<br>"+'请保持电话畅通，稍后我们会有客服为您提供服务。',
                        {time:4000},
                        function(){
                            window.location.href= ""+window.location.pathname+"";
                        }
                    );
                }
            }
        });
    }
}
