Authored by 郭成尧

mobile-back-pass-event-bind

... ... @@ -9,7 +9,7 @@
<label for="mobile" class="iconfont">&#xe727;</label><button class="country-code">+86<i class="iconfont">&#xe72f;</i></button><i class="line">|</i><input type="number" name="mobile" placeholder="请输入手机号" class="mobile-input"><i class="iconfont clear">&#xe72a;</i>
</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 class="get-verify-code">获取验证码</button>
<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 class="form-group password">
<label for="password" class="iconfont">&#xe723;</label><input type="password" name="password" placeholder="请重置新密码"><span id="passwordEyeIcon" class="eye"><i class="iconfont eye-close">&#xe716;</i><i class="iconfont eye-open hide">&#xe714;</i></span>
... ...
require('passport/back-mobile-new.page.css');
import $ from 'yoho-jquery';
import MobileNew from './back/mobile-new';
$(() => {
new MobileNew();
});
... ...
import $ from 'yoho-jquery';
import Page from 'yoho-page';
class MobileNew extends Page {
constructor() {
super();
this.selector = {
mobileInput: $('input[name=mobile]'),
verifyCodeInput: $('input[name=verifyCode]'),
passwordInput: $('input[name=password]'),
getVerifyCodeBtn: $('#getVerifyCodeBtn'),
backMobileResetBtn: $('#backMobileResetBtn')
};
this.init();
}
init() {
this.selector.getVerifyCodeBtn.data('oneClick', false);
this.bindEvents();
}
bindEvents() {
this.selector.mobileInput.on('input', this.changeBtnStatus.bind(this));
this.selector.verifyCodeInput.on('input', this.changeBtnStatus.bind(this));
this.selector.passwordInput.on('input', this.changeBtnStatus.bind(this));
this.selector.getVerifyCodeBtn.on('click', this.getVerifyCode.bind(this));
this.selector.backMobileResetBtn.on('click', this.resetPassword.bind(this));
}
/**
* 监听输入,改变按钮状态
*/
changeBtnStatus() {
console.log(this);
}
/**
* 获取验证码
*/
getVerifyCode() {
console.log('1');
}
/**
* 重置密码
*/
resetPassword() {
console.log('2');
}
}
module.exports = MobileNew;
... ...