...
|
...
|
@@ -6,10 +6,13 @@ |
|
|
var $ = require('yoho-jquery');
|
|
|
|
|
|
var $pwd = $('#pwd'),
|
|
|
$pwdLint = $('.pwd-lint'),
|
|
|
$pwdLintTxt = $pwdLint.find('.pwd-lint-txt'),
|
|
|
$btnSure = $('#btn-sure');
|
|
|
|
|
|
var api = require('../api');
|
|
|
var tip = require('../../plugin/tip');
|
|
|
var validatePWD = require('../password-check');
|
|
|
|
|
|
var trim = $.trim;
|
|
|
var showErrTip = tip.show;
|
...
|
...
|
@@ -53,11 +56,16 @@ api.bindEyesEvt({ |
|
|
});
|
|
|
|
|
|
$pwd.bind('input', function() {
|
|
|
if (trim($pwd.val()) === '') {
|
|
|
$btnSure.addClass('disable');
|
|
|
} else {
|
|
|
$btnSure.removeClass('disable');
|
|
|
}
|
|
|
var val = $.trim(this.value);
|
|
|
var bool = validatePWD(val, function(res) {
|
|
|
$pwdLint.css({visibility: res.valid ? 'hidden' : 'visible'});
|
|
|
|
|
|
if (!res.valid) {
|
|
|
$pwdLintTxt.text(res.msg);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
$btnSure.toggleClass('disable', !bool);
|
|
|
});
|
|
|
|
|
|
$btnSure.on('touchstart', function() {
|
...
|
...
|
@@ -67,7 +75,7 @@ $btnSure.on('touchstart', function() { |
|
|
return;
|
|
|
}
|
|
|
|
|
|
if (api.pwdValidate(pwd) === false) {
|
|
|
if (validatePWD(pwd) === false) {
|
|
|
showErrTip('密码6-20位,请重新输入');
|
|
|
} else {
|
|
|
startBind(pwd);
|
...
|
...
|
|