function login_re(){
	var check=check_form();
	if(!check){
		//$.showErr('请填写正确的注册信息',0,'hc');
		return false;
	}
    var query= new Object();
    // query = $("form[name='form_register']").serialize();
    query.username=$("input[name='username']").val();
    query.password=$("input[name='password']").val();
    query.repassword=$("input[name='repassword']").val();
    query.mobile=$("input[name='mobile']").val();
    query.verify=$("input[name='verify']").val();
    query.mobilecode=$("input[name='mobilecode']").val();
    $.ajax({
        type: "POST",
        url: APP+"Home/Login/to_register",
        data: query,
        success: function(data){
            if(data.status == 1){
                $.showSuccess(data.info,0,'hc');
                // window.location.href=data.url;
                window.location.href=APP+"Shop/register/index";
                // go_steps_2();
            }else{
                $.showErr(data.info,0,'hc');
            }
        }
    });
}
function check_form(){
	var username=$("input[name='username']").val();
	if(!username){
		$.showErr('账号不能为空',0,'hc');
		return false;
	}
	var re1=/[a-zA-Z]|[0-9]/g;
	var re2=/[\u4e00-\u9fa5]/g;
	var length=0;
	var length2=0;
	if(username.match(re1)){
		var letter=username.match(re1);
		length+=letter.length;
		length2+=letter.length;
	}
	if (username.match(re2)) {
		var chinese = username.match(re2);
		length += chinese.length;
		length2 = length2+chinese.length*2;
	} 
	if (length == username.length) {
		if (length2<6 || length2>16) {
		      $.showErr('账号格式不正确',0,'hc');
		       return false;
		}      
	}else{
		      $.showErr('账号格式不正确',0,'hc');
		       return false;
	}
	var mobile=$("input[name='mobile']").val();
	if(mobile==''){
		$.showErr('手机号不能为空',0,'hc');
		return false;
	}
	if(!$.checkMobile(mobile)){$.showErr('手机号格式不正确',0,'hc');return false;}
	var ref_mobile=$("input[name='ref_mobile']").val();
	if(ref_mobile&&!$.checkMobile(ref_mobile)){$.showErr('推荐人手机号格式不正确',0,'hc');return false;}
	var password=$("input[name='password']").val();
	if(!password.match(/^[\w]{6,12}$/)){$.showErr('密码格式不正确',0,'hc');return false;}
	var repassword=$("input[name='repassword']").val();
	if(password!=repassword){$.showErr('两次密码不一致',0,'hc');return false;}
	return true;
}
function verify_mobile(phone){
    if(phone == ''){
        $.showErr('手机号不能为空',0,'hc');
        return false;
    }
    if(!$.checkMobile(phone)){
        $.showErr('手机号格式不正确',0,'hc');
        return false;
    }
}