Authored by 陈轩

账户设置密码有货: 第三⽅绑定流程新⽤户输⼊新密码

... ... @@ -10,8 +10,14 @@
您以后还可以使手机号+密码的形式登录有货哦!
</div>
{{/if}}
<div class="input-container row has-eye">
<input id="pwd" class="input pwd" type="text" placeholder="请输入密码" autocomplete="off" maxlength="20">
<div class="row">
<div class="input-container row has-eye">
<input id="pwd" class="input pwd" type="text" placeholder="请输入密码" autocomplete="off" maxlength="20">
</div>
<div class="pwd-lint">
<i class="iconfont icon-tip">&#xE61A;</i>
<span class="pwd-lint-txt">由字母、数字组合,不能包含特殊字符</span>
</div>
</div>
<span id="btn-sure" class="btn btn-sure disable row">确定</span>
</div>
... ...
... ... @@ -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);
... ...