Authored by zhangxiaoru

editorial

... ... @@ -80,6 +80,7 @@ const favorite = {
p.hideBtn = true;
} else if (p.storage === 0) {
p.stateText = '已售罄';
p.hideBtn = true;
}
p.url = `/product/pro_${p.productId}_${p.goodsId}/${p.cnAlphabet}.html`;
p.imageUrl = p.image.replace('imageMogr2', 'imageMogr1');
... ...
... ... @@ -63,7 +63,8 @@
<div class="refund-type">
<div>
{{# returnMode}}
<label class="type-item {{class}}{{#if cur}} cur{{/if}}" title="{{title}}" data-id="{{id}}">{{name}}</label>
{{!-- <label class="type-item {{class}}{{#if cur}} cur{{/if}}" title="{{title}}" data-id="{{id}}">{{name}}</label> --}}
<label class="type-item {{class}}{{#if cur}} cur{{/if}} zfb-icon" title="{{title}}" data-id="{{id}}"></label>
{{#if tip}}
<span class="type-tip">{{tip}}</span>
{{/if}}
... ...
... ... @@ -32,7 +32,7 @@ const _doPassportCallback = (req, res, user) => {
refer = !BlockRedirectFilter.test(decodeURI(refer)) ? decodeURI(refer) : config.siteUrl;
if (user.openId && user.nickname) {
if (user.openId) {
let signinByOpenID = LoginService.signinByOpenIDAsync(
_.trim(user.nickname), _.trim(user.openId),
_.trim(user.sourceType), _.trim(shoppingKey),
... ... @@ -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);
}
... ...
... ... @@ -36,19 +36,20 @@ const syncUserSession = (uid, req, res) => {
return UserService.profileAsync(uid).then((userInfo) => {
let token = sign.makeToken(uid);
let user = userInfo.data;
let name = user.nickname || user.profile_name || user.username;
if (!_.isEmpty(user)) {
let uidCookie = `${user.profile_name}::${crypto.encryption('', user.uid + '')}::${user.username}::${token}`;
let uidCookie = `${name}::${crypto.encryption('', user.uid + '')}::${user.username}::${token}`;
req.session._TOKEN = token;
req.session._LOGIN_UID = uid;
req.session._USERNAME = user.username;
req.session._USERNAME = name;
res.cookie('_UID', uidCookie, {
domain: config.cookieDomain
});
res.cookie('_USERNAME', user.username, {
res.cookie('_USERNAME', name, {
domain: config.cookieDomain
});
}
... ...
... ... @@ -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>
... ...
... ... @@ -17,7 +17,7 @@ exports.index = (req, res, next) => {
cartModel.getCartData(shoppingKey, uid).then((result) => {
if (result.code === 200) {
res.header('Cache-Control', 'no-cache');
res.header('Cache-Control', 'no-store');
res.display('cart', _.merge({
module: 'shopping',
... ...
... ... @@ -173,7 +173,7 @@ $(function() {
if (data.code === 200) {
info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
info.address_id = info.id;
$('#tr_' + info.id).parent().before(Bll.getHtml(info)).remove();
$('#tr_' + info.id).parents('tr').before(Bll.getHtml(info)).remove();
Bll.clearInput();
$('.tip em').html('新增地址');
} else {
... ... @@ -192,7 +192,7 @@ $(function() {
if (data.code === 200) {
info.mobile = info.mobile.substring(0, 3) + '****' + info.mobile.substring(7, 11);
info.address_id = info.id;
$('#tr_' + info.id).parent().before(Bll.getHtml(info)).remove();
$('#tr_' + info.id).parents('tr').before(Bll.getHtml(info)).remove();
Bll.clearInput();
$('.tip em').html('新增地址');
} else {
... ...
... ... @@ -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();
}
});
... ...
... ... @@ -239,7 +239,6 @@
.subtext {
font-size: 12px;
cursor: pointer;
color: #666;
}
.no-space {
... ... @@ -259,21 +258,26 @@
}
.msg {
margin-top: 50px;
margin-top: 45px;
text-align: center;
.msg-zh {
font-size: $bigSize;
margin-bottom: $space;
font-size: 20px;
line-height: 30px;
margin-bottom: 15px;
}
.msg-en {
margin-bottom: 40px;
font-size: 14px;
}
.btn {
display: inline-block;
width: 100px !important;
width: 130px !important;
height: 40px !important;
line-height: 40px !important;
font-size: 14px;
}
}
}
... ...
... ... @@ -160,7 +160,7 @@
.code-horn {
width: 7px;
height: 12px;
background: resolve('me/code-horn.png') no-repeat;
background: resolve("me/code-horn.png") no-repeat;
position: absolute;
left: -7px;
top: 6px;
... ... @@ -193,12 +193,13 @@
color: #999;
}
.zfb-icon,
.ali-item {
background: resolve('me/alipay.png') no-repeat center center;
background: resolve("me/alipay.png") no-repeat center center;
}
.union-item {
background: resolve('me/unionpay.png') no-repeat center center;
background: resolve("me/unionpay.png") no-repeat center center;
}
> dl {
... ...
<h1 class="dialog-title">订单修改</h1>
<h1 class="dialog-title">修改订单</h1>
{{# data}}
<div class="form" data-code={{orderCode}}>
... ...