...
|
...
|
@@ -30,8 +30,6 @@ class RegisterNew { |
|
|
tokenInput: $('input[name=token]')
|
|
|
};
|
|
|
|
|
|
this.requested = false;
|
|
|
|
|
|
validate.init();
|
|
|
|
|
|
this.view.clearMobile.on('click', this.clearMobile.bind(this));
|
...
|
...
|
@@ -121,8 +119,14 @@ class RegisterNew { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (!validatePWD(password)) {
|
|
|
showErrTip('密码6-20位,请重新输入');
|
|
|
let validateResult = validatePWD(password, result => {
|
|
|
if (!result.valid) {
|
|
|
showErrTip(result.msg);
|
|
|
}
|
|
|
return result.valid;
|
|
|
});
|
|
|
|
|
|
if (!validateResult) {
|
|
|
return;
|
|
|
}
|
|
|
|
...
|
...
|
@@ -196,10 +200,6 @@ class RegisterNew { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (this.requested) {
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
let areaCode = this.view.countryCodeSelector.val();
|
|
|
let phoneNum = this.view.mobileInput.val();
|
|
|
|
...
|
...
|
@@ -211,10 +211,7 @@ class RegisterNew { |
|
|
|
|
|
if (api.phoneRegx[areaCode].test(phoneNum) || areaCode !== '+86') {
|
|
|
validate.getResults().then(result => {
|
|
|
this.requested = true;
|
|
|
|
|
|
$.extend(params, result);
|
|
|
|
|
|
$.ajax({
|
|
|
url: '/passport/reg/verifymobile',
|
|
|
type: 'POST',
|
...
|
...
|
@@ -228,13 +225,11 @@ class RegisterNew { |
|
|
(postResult.changeCaptcha && validate.type !== 2) && validate.refresh();
|
|
|
|
|
|
showErrTip(postResult.message);
|
|
|
this.requested = false;
|
|
|
}
|
|
|
},
|
|
|
error: () => {
|
|
|
showErrTip('出错了,请重试');
|
|
|
validate.refresh();
|
|
|
this.requested = false;
|
|
|
}
|
|
|
});
|
|
|
});
|
...
|
...
|
|