Auth()
//手机号码
var re_phone;
var reg5 = /^1(3|4|5|7|8|9)\d{9}$/;
var bol0 = false;
$("#username").on('blur', function() {
	if($("#username").val() == '') {
		tips('手机号不能为空');
		bol0 = false;
	} else if(reg5.test($("#username").val()) == false) {
		tips("手机号格式不正确");
		bol0 = false;
	} else {
		re_phone = $("#username").val();
		console.log(re_phone)
		bol0 = true;
	};
});
//密码
var passward;
var reg1 = /^(?![0-9]+$)(?![a-zA-Z]+$)[0-9A-Za-z]{6,16}$/
var bol1 = false;
$("#passward").on('blur', function() {
	if($("#passward").val() == '') {
		tips('密码不能为空');
		bol1 = false;
	} else if(reg1.test($("#passward").val()) == false) {
		tips('密码格式不能为空');
		bol1 = false;
	} else {
		passward = $("#passward").val();
		bol1 = true;
	};
});
//验证码
var re_code;
var reg5 = /^1(3|4|5|7|8|9)\d{9}$/;
var bol2 = false;
$("#code").on('blur', function() {
	if($("#code").val() == '') {
		tips('验证码不能为空');
		bol2 = false;
	} else if(reg5.test($("#code").val()) == false) {
		tips("验证码格式不正确");
		bol2 = false;
	} else {
		re_code = $("#code").val();
		console.log(re_code)
		bol2 = true;
	};
});
//发送验证码
var time = 60;
$('#sendCode').on('click', function() {
	if(bol0 && bol1 &&$('#sendCode').hasClass('sendCode')) {
		$.post(apicom + 'mobile/view/login/getSMSInfoCode', {
			phone: $('#username').val()
		}, function(res) {
			if(typeof res == 'string') {
				res = JSON.parse(res)
			}
			tips(res.msg);
			if(res.code == 1) {
				$('#sendCode').removeClass('sendCode')
				var timer = setInterval(function() {
					time--;
					if(time <= 0) {
						time = 60;
						$('#sendCode').html('发送验证码');
						clearInterval(timer);
						$('#sendCode').addClass('sendCode');
					} else {
						$('#sendCode').html(time + '秒')
					}
				}, 1000)

			}
		})
	}
})

//设置密码
$('#btn_tj').on('click',function(){
	var repsdObj = {};
	if(bol0&&bol1){
		$.ajax({
			type:"post",
			url:apicom+"",
			async:true,
			data:repsdObj
		});
	}
	
})
