...
|
...
|
@@ -2,17 +2,9 @@ import $ from 'yoho-jquery'; |
|
|
import tip from 'plugin/tip';
|
|
|
import Page from 'yoho-page';
|
|
|
import api from '../api';
|
|
|
import Validate from 'plugin/validata';
|
|
|
import dialog from 'plugin/dialog';
|
|
|
import bindDialogHbs from 'passport/bind-dialog-tip.hbs';
|
|
|
|
|
|
const $captcha = $('#js-img-check');
|
|
|
const validate = new Validate($captcha, {
|
|
|
useREM: {
|
|
|
rootFontSize: 40,
|
|
|
picWidth: 150
|
|
|
}
|
|
|
});
|
|
|
const showErrTip = tip.show;
|
|
|
|
|
|
class EmailBindMobile extends Page {
|
...
|
...
|
@@ -33,10 +25,6 @@ class EmailBindMobile extends Page { |
|
|
}
|
|
|
|
|
|
init() {
|
|
|
if ($captcha.data('userverify')) {
|
|
|
validate.init();
|
|
|
}
|
|
|
|
|
|
this.bindEvents();
|
|
|
}
|
|
|
|
...
|
...
|
@@ -126,7 +114,6 @@ class EmailBindMobile extends Page { |
|
|
}, 1000);
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取验证码
|
|
|
*/
|
...
|
...
|
@@ -147,34 +134,27 @@ class EmailBindMobile extends Page { |
|
|
|
|
|
this.selector.verifyCodeBtn.data('oneClick', true);
|
|
|
|
|
|
validate.getResults().then(result => {
|
|
|
let params = {
|
|
|
area: area.replace('+', ''),
|
|
|
mobile: pn
|
|
|
};
|
|
|
|
|
|
$.extend(params, result);
|
|
|
let params = {
|
|
|
area: area.replace('+', ''),
|
|
|
mobile: pn
|
|
|
};
|
|
|
|
|
|
this.ajax({
|
|
|
url: '/passport/bind/forceSendMsg',
|
|
|
type: 'POST',
|
|
|
data: params
|
|
|
}).then(codeResult => {
|
|
|
this.selector.verifyCodeBtn.data('oneClick', false);
|
|
|
validate.type === 2 && validate.refresh();
|
|
|
if (codeResult.code === 200) {
|
|
|
this.countDown();
|
|
|
return;
|
|
|
} else {
|
|
|
showErrTip(codeResult.message);
|
|
|
}
|
|
|
this.ajax({
|
|
|
url: '/passport/bind/forceSendMsg',
|
|
|
type: 'POST',
|
|
|
data: params
|
|
|
}).then(codeResult => {
|
|
|
this.selector.verifyCodeBtn.data('oneClick', false);
|
|
|
|
|
|
(codeResult.changeCaptcha && validate.type !== 2) && validate.refresh();
|
|
|
}).catch(() => {
|
|
|
this.selector.verifyCodeBtn.data('oneClick', false);
|
|
|
showErrTip('出错了,请重试');
|
|
|
validate.refresh();
|
|
|
});
|
|
|
if (codeResult.code === 200) {
|
|
|
this.countDown();
|
|
|
return;
|
|
|
} else {
|
|
|
showErrTip(codeResult.message);
|
|
|
}
|
|
|
}).catch(() => {
|
|
|
this.selector.verifyCodeBtn.data('oneClick', false);
|
|
|
showErrTip('出错了,请重试');
|
|
|
});
|
|
|
}
|
|
|
|
...
|
...
|
|