Authored by 郭成尧

Merge branch 'feature/loginview' into release/6.0.1

... ... @@ -17,7 +17,7 @@
</div>
<div class="form-group verify-code">
<label for="verifyCode" class="iconfont">&#xe71c;</label><input type="text" name="verifyCode" placeholder="请输入验证码"
class="verify-code-input"><button id="getVerifyCodeBtn" class="get-verify-code active">获取验证码</button>
class="verify-code-input"><button id="getVerifyCodeBtn" class="get-verify-code">获取验证码</button>
</div>
<div class="form-group password">
<label for="password" class="iconfont">&#xe723;</label><input type="password" name="password" placeholder="请输入密码">
... ... @@ -28,7 +28,7 @@
<label for="inviteCode" class="iconfont">&#xe71e;</label><input type="text" name="inviteCode" placeholder="邀请码(无邀请码非必填)">
</div>
<input name="token" type="hidden" value="{{token}}">
<div data-geetest="{{useGeetest}}" id="js-img-check"{{#unless useGeetest}} class="full-img-verify hide"{{/unless}}></div>
<div data-geetest="{{useGeetest}}" id="js-img-check"{{#unless useGeetest}} class="full-img-verify"{{/unless}}></div>
<button id="regBtn" class="reg-btn">注册</button>
</div>
</div>
\ No newline at end of file
... ...
... ... @@ -25,7 +25,7 @@
<label for="verifyCode" class="iconfont">&#xe71c;</label><input type="text" name="verifyCode" placeholder="请输入验证码"
class="verify-code-input"><button id="getVerifyCodeBtn" class="get-verify-code">获取验证码</button>
</div>
<div data-geetest="{{useGeetest}}" id="js-img-check" {{#unless useGeetest}} class="full-img-verify hide" {{/unless}}></div>
<div data-geetest="{{useGeetest}}" id="js-img-check" {{#unless useGeetest}} class="full-img-verify" {{/unless}}></div>
<button id="smsLoginBtn" class="sms-login-btn">登录</button>
<div class="other-info">
<a href="{{internationalUrl}}">海外账号</a>
... ...
... ... @@ -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));
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();
... ...
... ... @@ -35,6 +35,7 @@ class SmsLoginNew extends Page {
* 初始化
*/
init() {
validate.init();
this.bindEvents();
}
... ... @@ -49,13 +50,7 @@ class SmsLoginNew extends Page {
this.selector.getPswrdBtn.on('click', this.showGetPasswordBox.bind(this));
this.selector.getPasswordBox.on('click', this.hiddenGetPasswordBox.bind(this));
this.selector.showYohoFamilyTip.on('click', this.showYohoFamilyTip.bind(this));
if ($captcha.data('geetest')) {
this.selector.getVerifyCodeBtn.on('click', this.getVerifyCode.bind(this));
} else {
validate.init();
this.selector.getVerifyCodeBtn.on('click', this.imgVerifyInit.bind(this));
}
}
/**
... ... @@ -66,19 +61,6 @@ class SmsLoginNew extends Page {
}
/**
* 图片验证码初始化
*/
imgVerifyInit() {
if (!this.selector.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();
}
/**
* 获取验证码倒计时
*/
countDown(during) {
... ... @@ -177,7 +159,6 @@ class SmsLoginNew extends Page {
data: params
}).then(data => {
validate.type === 2 && validate.refresh();
$captcha.addClass('hide');
if (data.code === 200) {
checkPoint('YB_MOBILE_NEXT_C'); // 埋点
this.countDown();
... ...