Authored by 姜枫

Merge branch 'release/1.0' of http://git.yoho.cn/fe/yoho-blk into release/1.0

... ... @@ -272,12 +272,12 @@ const qq = {
login: (req, res) => {
let authState = req.session.authState = uuid.v4();
return res.redirect(`//www.yohobuy.com/passport/autosign/qq?type=yohoblk&state=${authState}`)
return res.redirect(`//www.yohobuy.com/passport/autosign/qq?type=yohoblk&state=${authState}`);
},
callback: (req, res, next) => {
if (req.session && req.session.authState && req.session.authState === req.query.state) {
if (req.query.err) {
log.error(`qq authenticate error : ${JSON.stringify(err)}`);
log.error(`qq authenticate error : ${JSON.stringify(req.query.err)}`);
return res.redirect(loginPageURL);
}
... ...
... ... @@ -67,7 +67,7 @@
<li>
<div>
<input id="reset-pwd-btn" class="reset-pwd-btn disable" type="submit" value="下一步" disabled>
<a id="reset-pwd-btn" class="reset-pwd-btn">下一步</a>
</div>
</li>
... ...
... ... @@ -29,7 +29,7 @@
<li>
<div>
<a id="next" class="btn btn-fixed-height disable">确认</a>
<a id="next" class="btn btn-fixed-height">确认</a>
</div>
</li>
</ul>
... ...
... ... @@ -3,6 +3,8 @@ var confirmReceive = require('./order/confirm-receive');
var editOrder = require('./order/edit-order');
var countDown = require('./order/countdown');
var Confirm = require('../plugins/dialog').Confirm;
var lazyLoad = require('yoho-jquery-lazyload');
// 个人中心共用代码加载
... ... @@ -32,6 +34,8 @@ $('.order .edit-btn').on('click', function() {
var mobile = $userInfo.find('.user-mo-sel').data('mobile');
var phone = $userInfo.find('.user-ph-sel').data('phone');
$this.removeClass('white'); // 我不知道为啥产品会有这样的需求,点一次按钮后颜色变掉,按钮颜色和可不可点状态一毛钱关系都没
editOrder.start({
data: {
orderCode: code,
... ... @@ -47,8 +51,12 @@ $('.order .edit-btn').on('click', function() {
$('.complete-btn').on('click', function() {
var code = $(this).closest('.order').data('code');
confirmReceive.done(code);
new Confirm({
content: '<h1 class="title">确认收货</h1><p>您确定要确认收货么?</p>',
cb: function() {
confirmReceive.done(code);
}
}).show();
});
if ($('.left-time').length) {
... ...
... ... @@ -7,6 +7,7 @@
var dialog = require('../plugins/dialog');
var _dialog = dialog.Dialog;
var _alert = dialog.Alert;
var _confirm = dialog.Confirm;
var expressTpl = require('../../tpl/me/express.hbs');
... ... @@ -335,7 +336,12 @@ function bindConfirmReceiveEvent() {
$('.confirm-receive').on('click', function() {
var code = $(this).closest('.order').data('code');
confirmReceive.done(code);
new _confirm({
content: '<h1 class="title">确认收货</h1><p>您确定要确认收货么?</p>',
cb: function() {
confirmReceive.done(code);
}
}).show();
});
}
... ...
... ... @@ -10,10 +10,6 @@ var $passwordInput = $('#pwd'),
$repasswordInput = $('#re-input'),
$next = $('#reset-pwd-btn');
var EventProxy = require('yoho-eventproxy');
var ep = new EventProxy();
var pwdRegx = require('../common/mail-phone-regx').pwdValidateRegx;
function errTip(ele, msg) {
... ... @@ -34,75 +30,65 @@ require('yoho-jquery-placeholder');
// IE8 placeholder
$('input').placeholder();
// 同时监听 pwd 和 repwd 事件
ep.tail('pwd', 'repwd', function(pwd, repwd) {
if (pwd && repwd) {
$next.removeClass('disable').prop('disabled', false);
} else {
$next.addClass('disable').prop('disabled', true);
}
});
$passwordInput.on('keyup blur', function() {
function validatePassword() {
var length = $passwordInput.val().length;
if (length === 0) {
errTip($passwordInput, '请输入密码');
ep.emit('pwd', false);
return;
return false;
}
if (length < 6 || length > 20) {
errTip($passwordInput, '密码只支持 6-20 位字符,建议字母+数字的组合');
ep.emit('pwd', false);
return;
return false;
}
if (!pwdRegx.test($passwordInput.val())) {
errTip($passwordInput, '密码只支持 6-20 位字符,建议字母+数字的组合');
ep.emit('pwd', false);
return;
return false;
}
ep.emit('pwd', true);
hideTip($passwordInput);
return true;
}
$passwordInput.on('blur', function() {
validatePassword();
}).on('focus', function() {
$passwordInput.addClass('focus');
hideTip($passwordInput);
}).on('blur', function() {
$passwordInput.removeClass('focus');
});
$repasswordInput.on('keyup blur', function() {
function validateRepassword() {
var length = $repasswordInput.val().length;
if (length === 0) {
errTip($repasswordInput, '请再次输入密码');
ep.emit('repwd', false);
return;
return false;
}
if ($passwordInput.val() !== $repasswordInput.val()) {
errTip($repasswordInput, '两次输入的密码不一致,请重新输入');
ep.emit('repwd', false);
return;
return false;
}
ep.emit('repwd', true);
hideTip($repasswordInput);
return true;
}
$repasswordInput.on('blur', function() {
validateRepassword();
}).on('focus', function() {
$repasswordInput.addClass('focus');
hideTip($repasswordInput);
}).on('blur', function() {
$repasswordInput.removeClass('focus');
});
// 监听 repwd 事件
ep.on('repwd', function(repwdAuth) {
if (repwdAuth) {
hideTip($repasswordInput);
}
});
// 监听 pwd 事件
ep.on('pwd', function(pwdAuth) {
if (pwdAuth) {
hideTip($passwordInput);
$next.click(function() {
if (validatePassword() && validateRepassword()) {
$('#reset-pwd-form').submit();
}
});
... ...
... ... @@ -16,10 +16,6 @@ var $mobile = $('#mobile');
var $area = $('#area');
var $next = $('#next');
var EventProxy = require('yoho-eventproxy');
var ep = new EventProxy();
require('yoho-jquery-placeholder');
function errTip(ele, msg) {
... ... @@ -34,62 +30,46 @@ function hideTip(ele) {
return ele.next('.tips').addClass('hide');
}
// 确保二次密码输入正确
ep.tail('pwd', 'repwd', function(pwd, repwd) {
if (pwd && repwd) {
$next.removeClass('disable');
} else {
$next.addClass('disable');
}
});
$passwordInput.on('keyup blur', function() {
$passwordInput.on('blur', function() {
var length = $passwordInput.val().length;
$passwordInput.removeClass('focus');
if (length === 0) {
errTip($passwordInput, '请输入密码');
ep.emit('pwd', false);
return;
}
if (length < 6 || length > 20) {
errTip($passwordInput, '密码只支持 6-20 位字符,建议字母+数字的组合');
ep.emit('pwd', false);
return;
}
if (!pwdRegx.test($passwordInput.val())) {
errTip($passwordInput, '密码只支持 6-20 位字符,建议字母+数字的组合');
ep.emit('pwd', false);
return;
}
ep.emit('pwd', true);
}).on('focus', function() {
hideTip($passwordInput);
$passwordInput.addClass('focus');
});
$repasswordInput.on('keyup blur', function() {
$repasswordInput.on('blur', function() {
var length = $repasswordInput.val().length;
$repasswordInput.removeClass('focus');
if (length === 0) {
errTip($repasswordInput, '请再次输入密码');
ep.emit('repwd', false);
return;
}
if ($passwordInput.val() !== $repasswordInput.val()) {
errTip($repasswordInput, '两次输入的密码不一致,请重新输入');
ep.emit('repwd', false);
return;
}
ep.emit('repwd', true);
}).on('focus', function() {
hideTip($repasswordInput);
$repasswordInput.addClass('focus');
... ... @@ -119,25 +99,10 @@ function nextPage() {
$('[placeholder]').placeholder();
$next.on('click', function() {
if ($next.hasClass('disable')) {
return;
}
if ($passwordInput.val() !== $repasswordInput.val()) {
if (($.trim($passwordInput.val()) === '') || ($passwordInput.val() !== $repasswordInput.val())) {
errTip($repasswordInput, '两次输入的密码不一致,请重新输入');
return;
}
nextPage();
});
ep.on('repwd', function(repwdAuth) {
if (repwdAuth) {
hideTip();
}
});
ep.on('pwd', function(pwdAuth) {
if (pwdAuth) {
hideTip();
}
});
... ...
<h1 class="dialog-title">订单修改</h1>
<h1 class="dialog-title">修改订单</h1>
{{# data}}
<div class="form" data-code={{orderCode}}>
... ...