...
|
...
|
@@ -32,32 +32,16 @@ class RegisterNew { |
|
|
|
|
|
this.requested = false;
|
|
|
|
|
|
validate.init();
|
|
|
|
|
|
this.view.clearMobile.on('click', this.clearMobile.bind(this));
|
|
|
this.view.regBtn.on('click', this.register.bind(this));
|
|
|
this.view.mobileInput.bind('input', this.changeRegBtnStatus.bind(this));
|
|
|
this.view.inviteCodeInput.bind('input', this.changeRegBtnStatus.bind(this));
|
|
|
this.view.passwordInput.bind('input', this.changeRegBtnStatus.bind(this));
|
|
|
this.view.mobileInput.bind('input', this.changeBtnStatus.bind(this));
|
|
|
this.view.inviteCodeInput.bind('input', this.changeBtnStatus.bind(this));
|
|
|
this.view.passwordInput.bind('input', this.changeBtnStatus.bind(this));
|
|
|
this.view.passwordEyeIcon.on('click', this.passwordShowStatus.bind(this));
|
|
|
this.view.getVerifyCodeBtn.on('click', this.getVerifyCode.bind(this));
|
|
|
|
|
|
if ($captcha.data('geetest')) {
|
|
|
this.view.getVerifyCodeBtn.on('click', this.getVerifyCode.bind(this));
|
|
|
} else {
|
|
|
validate.init();
|
|
|
this.view.getVerifyCodeBtn.on('click', this.imgVerifyInit.bind(this));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 图片验证码初始化
|
|
|
*/
|
|
|
imgVerifyInit() {
|
|
|
if (!this.view.getVerifyCodeBtn.hasClass('active')) {
|
|
|
return;
|
|
|
}
|
|
|
validate.refresh();
|
|
|
$(document).off('click.refresh').on('click.refresh', '.img-check-refresh', this.imgVerifyInit.bind(this));
|
|
|
$captcha.removeClass('hide');
|
|
|
this.getVerifyCode();
|
|
|
}
|
|
|
|
|
|
/**
|
...
|
...
|
@@ -107,9 +91,17 @@ class RegisterNew { |
|
|
}
|
|
|
|
|
|
/**
|
|
|
* 改变登录按钮状态
|
|
|
* 输入监听,改变按钮状态
|
|
|
*/
|
|
|
changeRegBtnStatus() {
|
|
|
changeBtnStatus() {
|
|
|
// 获取验证码按钮
|
|
|
if (this.view.mobileInput.val()) {
|
|
|
this.view.getVerifyCodeBtn.addClass('active');
|
|
|
} else {
|
|
|
this.view.getVerifyCodeBtn.removeClass('active');
|
|
|
}
|
|
|
|
|
|
// 登录按钮
|
|
|
if (this.view.mobileInput.val() &&
|
|
|
this.view.passwordInput.val() &&
|
|
|
this.view.verifyCodeInput.val()) {
|
...
|
...
|
@@ -229,7 +221,6 @@ class RegisterNew { |
|
|
data: params,
|
|
|
success: postResult => {
|
|
|
validate.type === 2 && validate.refresh();
|
|
|
$captcha.addClass('hide');
|
|
|
if (postResult.code === 200) {
|
|
|
this.view.tokenInput.val(postResult.data.token);
|
|
|
this.countDown();
|
...
|
...
|
|