// 获取手机验证码var phone = $(‘#phone‘);var mobileReg = /^(13[0-9]|14[0-9]|15[0-9]|17[0-9]|18[0-9])\d{8}$/;var getCode=$(‘#getCode‘);getCode.on(‘click‘, function () { if (allowGet) { if (!mobileReg.test(phone.val())) { alert(‘请输入正确格式的手机号~‘); return; } updateTime(); $.getJSON(‘/user.d?m=regetvcode_lottery&phone=‘ + phone.val() + ‘×=first‘, function (data) { var status = data.root.status; var message = data.root.message; alert(message); if (status !== ‘100‘) { clearInterval(timer); getCode.val(‘获取验证码‘).removeClass(‘getingCode‘); timeCount = 60; allowGet = true; } }); } else { return; }});// 提交验证码var loginBtn = $(‘#loginBtn‘);var inputCode = $(‘#inputCode‘);loginBtn.on(‘click‘, function () { if (!phone.val().trim()) { alert(‘手机号不能为空~‘); return; } if (!inputCode.val().trim()) { alert(‘验证码不能为空~‘); return; } login.hide().css(transInit); floatAlert.fadeOut(300); $.getJSON(‘/activity.d?m=checkVCode‘, {checkCode: inputCode.val(), phone: phone.val()}, function (data) { var checkStatus = data.root.status; if (checkStatus === ‘100‘) { alert(‘登录成功~‘); window.location.href = ‘/huodongAC.d?class=ChaiHongBaoHc&m=index‘; } else { alert(‘验证码错误,请重新输入~‘); showLogin(); } });});
时间: 2024-11-04 19:42:28