Authored by htoooth

增加黑框代码

... ... @@ -11,7 +11,7 @@ const moment = require('moment');
const helpers = global.yoho.helpers;
const api = require('./back-api');
const UserService = require('./user-service');
const LoginService = require('./user-service');
const PassportHelper = require('./passport-helper');
const BackHelper = require('./back-helper');
... ... @@ -54,8 +54,8 @@ const findUserAsync = (type, phone, area) => {
};
const findBy = {
email: UserService.findByEmailAsync,
mobile: (phone1, area1) => UserService.findByMobileAsync(area1, phone1) // 交换参数
email: LoginService.findByEmailAsync,
mobile: (phone1, area1) => LoginService.findByMobileAsync(area1, phone1) // 交换参数
};
const OK = {code: 200, message: MESSAGE.ok};
... ...
... ... @@ -261,12 +261,18 @@ exports.init = function() {
$imgCaptchaInput.on('blur', function() {
validateImgCaptcha();
$imgCaptchaInput.removeClass('focus');
}).on('focus', function() {
hideTip($imgCaptchaInput);
$imgCaptchaInput.addClass('focus');
});
$phoneNumInput.on('focus', function() {
hideTip($phoneNumInput);
$('.phone').addClass('focus');
}).on('blur', function() {
$phoneNumInput.removeClass('focus');
$('.phone').removeClass('focus');
});
$nextBtn.on('click', function() {
... ...
... ... @@ -65,6 +65,10 @@ $passwordInput.on('keyup blur', function() {
}
ep.emit('pwd', true);
}).on('focus', function() {
$passwordInput.addClass('focus');
}).on('blur', function() {
$passwordInput.removeClass('focus');
});
$repasswordInput.on('keyup blur', function() {
... ... @@ -83,6 +87,10 @@ $repasswordInput.on('keyup blur', function() {
}
ep.emit('repwd', true);
}).on('focus', function() {
$repasswordInput.addClass('focus');
}).on('blur', function() {
$repasswordInput.removeClass('focus');
});
// 监听 repwd 事件
... ...
... ... @@ -91,6 +91,9 @@ $smsCaptchaInput.on('blur', function() {
}
}).on('focus', function() {
hideTip($smsCaptchaInput);
$smsCaptchaInput.addClass('focus');
}).on('blur', function() {
$smsCaptchaInput.removeClass('focus');
});
function init() {
... ...
... ... @@ -163,6 +163,7 @@ ep.tail('phoneNum', 'img-captcha', function(phoneAuth, imgAuth) {
$phoneNumInput.on('blur', function() {
var length = $phoneNumInput.val().length;
$('#phone').removeClass('focus');
if (length === 0) {
errTip($phoneNumInput, '请输入手机号码');
ep.emit('phoneNum', false);
... ... @@ -191,11 +192,14 @@ $phoneNumInput.on('blur', function() {
}
}).on('focus', function() {
hideTip($phoneNumInput);
$('#phone').addClass('focus');
});
$imgCaptchaInput.on('blur', function() {
var length = $imgCaptchaInput.val().length;
$imgCaptchaInput.removeClass('focus');
switch (length) {
case 4 :
break;
... ... @@ -221,6 +225,7 @@ $imgCaptchaInput.on('blur', function() {
});
}).on('focus', function() {
hideTip($imgCaptchaInput);
$imgCaptchaInput.addClass('focus');
});
$imgCaptchaCtrl.on('click', function() {
... ... @@ -230,6 +235,8 @@ $imgCaptchaCtrl.on('click', function() {
$smsCaptchaInput.on('blur', function() {
var length = $smsCaptchaInput.val().length;
$smsCaptchaInput.removeClass('focus');
switch (length) {
case 4:
break;
... ... @@ -253,6 +260,7 @@ $smsCaptchaInput.on('blur', function() {
});
}).on('focus', function() {
hideTip($smsCaptchaInput);
$smsCaptchaInput.addClass('focus');
});
$smsCaptchaCtrl.on('click', function() {
... ...
... ... @@ -46,6 +46,8 @@ ep.tail('pwd', 'repwd', function(pwd, repwd) {
$passwordInput.on('keyup blur', function() {
var length = $passwordInput.val().length;
$passwordInput.removeClass('focus');
if (length === 0) {
errTip($passwordInput, '请输入密码');
ep.emit('pwd', false);
... ... @@ -67,11 +69,14 @@ $passwordInput.on('keyup blur', function() {
ep.emit('pwd', true);
}).on('focus', function() {
hideTip($passwordInput);
$passwordInput.addClass('focus');
});
$repasswordInput.on('keyup blur', function() {
var length = $repasswordInput.val().length;
$repasswordInput.removeClass('focus');
if (length === 0) {
errTip($repasswordInput, '请再次输入密码');
ep.emit('repwd', false);
... ... @@ -87,6 +92,7 @@ $repasswordInput.on('keyup blur', function() {
ep.emit('repwd', true);
}).on('focus', function() {
hideTip($repasswordInput);
$repasswordInput.addClass('focus');
});
// 下一步
... ...
... ... @@ -452,15 +452,19 @@ exports.init = function() {
// 验证手机输入
$phoneNumInput.on('keyup blur', function() {
validatePhoneNum();
$('#phone').removeClass('focus');
}).on('focus', function() {
hideTip($phoneNumInput);
$('#phone').addClass('focus');
});
// 验证图形输入
$imgCaptchaInput.on('keyup blur', function() {
validateImgCaptcha();
$imgCaptchaInput.removeClass('focus');
}).on('focus', function() {
hideTip($imgCaptchaInput);
$imgCaptchaInput.addClass('focus');
});
// 图形验证通过时,发送短信按钮可点击
... ... @@ -475,8 +479,10 @@ exports.init = function() {
// 验证短信输入
$smsCaptchaInput.on('keyup blur', function() {
validateSMSCaptcha();
$smsCaptchaInput.removeClass('focus');
}).on('focus', function() {
hideTip($smsCaptchaInput);
$smsCaptchaInput.addClass('focus');
});
// 验证密码输入
... ... @@ -488,6 +494,9 @@ exports.init = function() {
});
}).on('focus', function() {
hideTip($passwordInput);
$passwordInput.addClass('focus');
}).on('blur', function() {
$passwordInput.removeClass('focus');
});
// 服务条款
... ...
... ... @@ -13,23 +13,15 @@
}
.country-code {
@mixin country-code ;
@mixin country-code;
}
.country-list {
@mixin region ;
@mixin region;
}
.phone {
@mixin phone ;
&.focus-gain {
border: 2px solid #000;
}
&.focus-lost {
border: 1px solid #dbdbdb;
}
@mixin phone;
}
.input {
... ... @@ -40,21 +32,13 @@
display: block;
float: left;
border: none !important;
height: 40px !important;
}
&.captcha {
width: $captcha;
float: left;
&.focus-gain {
border: 2px solid #000;
}
&.focus-lost {
border: 1px solid #dbdbdb;
}
}
}
.captcha-component {
... ...
$theme-color: #1d1d1d;
$item-height: 40px;
$item-height: 44px;
$item-width: 340px;
$bord-color: #dbdbdb;
$bord-color: #eee;
$margin-left: 15px;
$margin-top: 110px;
$red: #e01;
... ... @@ -15,7 +15,7 @@ $input-button: 125px;
$err-tips-width: 348px;
$blue: #379ed6;
$inactive-color: #555;
$option-color:#f8f8f8;
$option-color: #f8f8f8;
@define-mixin li-setting {
margin-bottom: 20px;
... ... @@ -55,19 +55,21 @@ $option-color:#f8f8f8;
@define-mixin phone {
width: 225px;
height: $item-height;
margin-left: $margin-left;
border: 1px solid $bord-color;
border: 2px solid $bord-color;
display: inline-block;
}
@define-mixin input {
height: $item-height;
width: 100%;
line-height: 43px;
line-height: @height;
font-size: 16px;
border: 1px solid $bord-color;
border: 2px solid $bord-color;
text-indent: 10px;
color: #9a9a9a;
color: #000;
font-weight: bold;
padding: 0;
}
... ...
... ... @@ -134,7 +134,7 @@
.country-select-header {
height: $item-height;
width: 100px;
border: 1px solid #eee;
border: 2px solid #eee;
font-size: 16px;
float: left;
cursor: pointer;
... ...
... ... @@ -40,6 +40,7 @@
display: block;
float: left;
border: none !important;
height: 40px !important;
}
&.captcha {
... ...
... ... @@ -20,6 +20,7 @@
&.phone-num {
width: 160px;
height: 40px !important;
display: block;
float: left;
border: none !important;
... ...
... ... @@ -6,6 +6,11 @@ $btn-height: 50px;
$btn-width: 180px;
.bind-wrapper {
.focus {
border: 2px solid #000 !important;
}
.auth-page,
.pwd-page,
.relate-success-page {
... ... @@ -84,6 +89,7 @@ $btn-width: 180px;
.input {
@mixin input;
font-weight: bold;
}
.bind-confirm-page {
... ... @@ -166,7 +172,7 @@ $mobile-phone: calc($item-width - $mobile-margin - $mobile-region - $mobile-code
}
.ctrl {
border: 1px solid $bord-color;
border: 2px solid $bord-color;
width: $mobile-mobile;
margin-left: $mobile-margin;
height: $item-height;
... ... @@ -176,12 +182,14 @@ $mobile-phone: calc($item-width - $mobile-margin - $mobile-region - $mobile-code
}
.phone-num {
width: $mobile-phone;
height: calc($item-height - 2px);
width: calc($mobile-phone - 4px);
height: calc($item-height - 4px);
border: none !important;
line-height: calc($item-height - 2px);
line-height: calc($item-height - 4px);
font-size: 16px;
padding: 0;
color: #000;
font-weight: bold;
}
}
... ... @@ -220,7 +228,7 @@ $mobile-phone: calc($item-width - $mobile-margin - $mobile-region - $mobile-code
.country-select-header {
height: $item-height;
width: 100px;
border: 1px solid #eee;
border: 2px solid #eee;
font-size: 16px;
float: left;
cursor: pointer;
... ...