Authored by xuqi

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

... ... @@ -13,16 +13,16 @@ const brand = require('../models/brand');
* @param res
*/
const index = (req, res, next) => {
let channel = req.cookies._Channel || 'men';
let channel = req.cookies._Channel || '301';
let contentCode = '';
let name = '';
let link = '';
if (channel === 'women') {
if (channel === '302') {
contentCode = '527079e6c46d0f125eb46b835968971b';
name = 'WOMEN首页';
link = 'http://www.yohoblk.com/women';
} else if (channel === 'lifestyle') {
} else if (channel === '303') {
contentCode = '94b5ed607b6d565ffc29c2c04be121dc';
name = 'LIFT STYLE首页';
link = 'http://www.yohoblk.com/lifestyle';
... ...
... ... @@ -20,16 +20,16 @@ const index = (req, res, next) => {
let limit = req.query.limit || 20;
let appType = 1;
let udid = md5(req.ip);
let channel = req.cookies._Channel || 'women';
let channel = req.cookies._Channel || '301';
let gender = '';
let name = '';
let link = '';
if (channel === 'men') {
if (channel === '301') {
gender = '1,3';
name = 'MEN首页';
link = 'http://www.yohoblk.com';
} else if (channel === 'women') {
} else if (channel === '302') {
gender = '2,3';
name = 'WOMEN首页';
link = 'http://www.yohoblk.com/women';
... ... @@ -85,17 +85,17 @@ const list = (req, res) => {
let tag = req.query.query;
let authorId = req.query.authorId;
let udid = md5(req.ip);
let channel = req.cookies._Channel || 'men';
let channel = req.cookies._Channel || '301';
let gender = '';
let name = '';
let link = '';
let appType = 1;
if (channel === 'men') {
if (channel === '301') {
gender = '1,3';
name = 'MEN首页';
link = 'http://www.yohoblk.com';
} else if (channel === 'women') {
} else if (channel === '302') {
gender = '2,3';
name = 'WOMEN首页';
link = 'http://www.yohoblk.com/women';
... ... @@ -156,14 +156,14 @@ const detail = (req, res, next) => {
let appType = 1;
let uid = req.user.uid;
let udid = md5(req.ip);
let channel = req.cookies._Channel || 'men';
let channel = req.cookies._Channel || '301';
let name = '';
let link = '';
if (channel === 'men') {
if (channel === '301') {
name = 'MEN首页';
link = 'http://www.yohoblk.com';
} else if (channel === 'women') {
} else if (channel === '302') {
name = 'WOMEN首页';
link = 'http://www.yohoblk.com/women';
} else {
... ...
... ... @@ -2,6 +2,7 @@
<h4>
<span class="comment-num">{{total}}</span>
条评论
<b></b>
</h4>
<p class="comments-empty">还没有评论,快抢沙发吧</p>
<div class="commnets-resultwrapper">
... ...
... ... @@ -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}}
... ...
... ... @@ -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>
... ...
... ... @@ -756,6 +756,10 @@ const setSizeData = (sizeInfo) => {
size.param = sizeTable;
}
if (_.isEmpty(_.get(size, 'param.sizeTable.tbody', ''))) {
return {}; // 无尺码信息则不显示该块
}
if (!_.isEmpty(sizeInfo.modelBos)) {
let tasteTable = {};
... ...
... ... @@ -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 {
... ...
... ... @@ -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();
}
});
... ...
... ... @@ -74,7 +74,7 @@ function shareBase(options) {
sharebox = defOption.self.closest('.share-to').find('.weixin-share-box');
if (sharebox.length > 0) {
shareCon = '<i class="iconfont top ">&#xe617;</i><div class="con"><p class="pic"><img src="' +
shareCon = '<i class="top"></i><div class="con"><p class="pic"><img src="' +
openUrl + '" /></p><h2>分享到微信朋友圈</h2><p class="w">打开微信使用“扫一扫“<br/>即可将网页分享到我的朋友圈。</p></div>';
sharebox.find('div').length > 0 ? sharebox.show() : sharebox.html(shareCon).show();
}
... ...
... ... @@ -46,10 +46,13 @@
position: absolute;
color: #bbb;
background: #fff;
width: 18px;
left: 50px;
width: 12px;
left: 89px;
z-index: 100;
width: 18px;
height: 12px;
display: block;
background-image: resolve('layout/up.png');
top: 17px;
}
}
... ...
... ... @@ -461,10 +461,21 @@
position: relative;
line-height: 32px;
border-bottom: 1px solid #bbb;
position: relative;
.comment-num {
color: #379ed6;
}
b {
display: block;
width: 12px;
height: 7px;
background: #fff;
background-image: resolve('layout/down.png');
position: absolute;
left: 15px;
}
}
.comment-pager {
... ...
... ... @@ -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 {
... ...