Authored by 徐祁xuqi

Merge remote-tracking branch 'origin/release/4.6'

... ... @@ -172,7 +172,7 @@ exports.getOutletsChannelData = (params, channel) => {
}
// 限时嗨购
if (result[2].code === 200) {
if (result[2].code === 200 && !_.isEmpty(result[2].data)) {
channelData.nearOver = outletsProcess.handleOutletsActivityData(result[2].data, '限时嗨购');
}
... ...
... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2016-06-02 15:50:47
* @Last Modified by: Targaryen
* @Last Modified time: 2016-06-20 21:32:00
* @Last Modified time: 2016-06-22 18:36:26
*/
'use strict';
... ... @@ -39,15 +39,15 @@ const handleFilterUrl = (originParam, newParam) => {
const handleSaleNewSaleSortData = (params) => {
return [{
name: '1~3折',
href: handleFilterUrl(params, {p_d: '0.1,0.3'}),
href: handleFilterUrl(params, { p_d: '0.1,0.3' }),
checked: params.p_d === '0.1,0.3'
}, {
name: '4~6折',
href: handleFilterUrl(params, {p_d: '0.4,0.6'}),
href: handleFilterUrl(params, { p_d: '0.4,0.6' }),
checked: params.p_d === '0.4,0.6'
}, {
name: '7折以上',
href: handleFilterUrl(params, {p_d: '0.7,1'}),
href: handleFilterUrl(params, { p_d: '0.7,1' }),
checked: params.p_d === '0.7,1'
}];
};
... ... @@ -217,7 +217,7 @@ exports.handleSaleOptsData = (params, total, extra) => {
switch (i) {
case 0:
opt.href = handleFilterUrl(params, {order: 's_t_desc'});
opt.href = handleFilterUrl(params, { order: 's_t_desc' });
if (extra === 'discont') { // 如果是折扣专场
opt.name = '全部';
if (_.isEmpty(params.order) || params.order === 's_t_desc') {
... ... @@ -238,16 +238,16 @@ exports.handleSaleOptsData = (params, total, extra) => {
break;
case 1:
if (params.order !== 's_p_desc' && params.order !== 's_p_asc') {
opt.href = handleFilterUrl(params, {order: 's_p_desc'});
opt.href = handleFilterUrl(params, { order: 's_p_desc' });
opt.hasSortOrient = true;
} else {
opt.hasSortOrient = true;
opt.active = true;
if (params.order === 's_p_desc') {
opt.href = handleFilterUrl(params, {order: 's_p_asc'});
opt.href = handleFilterUrl(params, { order: 's_p_asc' });
opt.desc = false;
} else {
opt.href = handleFilterUrl(params, {order: 's_p_desc'});
opt.href = handleFilterUrl(params, { order: 's_p_desc' });
opt.desc = true;
}
}
... ... @@ -256,16 +256,16 @@ exports.handleSaleOptsData = (params, total, extra) => {
break;
case 2:
if (params.order !== 'p_d_desc' && params.order !== 'p_d_asc') {
opt.href = handleFilterUrl(params, {order: 'p_d_desc'});
opt.href = handleFilterUrl(params, { order: 'p_d_desc' });
opt.hasSortOrient = true;
} else {
opt.hasSortOrient = true;
opt.active = true;
if (params.order === 'p_d_desc') {
opt.href = handleFilterUrl(params, {order: 'p_d_asc'});
opt.href = handleFilterUrl(params, { order: 'p_d_asc' });
opt.desc = false;
} else {
opt.href = handleFilterUrl(params, {order: 'p_d_desc'});
opt.href = handleFilterUrl(params, { order: 'p_d_desc' });
opt.desc = true;
}
}
... ... @@ -274,16 +274,16 @@ exports.handleSaleOptsData = (params, total, extra) => {
break;
case 3:
if (params.order !== 's_n_desc' && params.order !== 's_n_asc') {
opt.href = handleFilterUrl(params, {order: 's_n_desc'});
opt.href = handleFilterUrl(params, { order: 's_n_desc' });
opt.hasSortOrient = true;
} else {
opt.hasSortOrient = true;
opt.active = true;
if (params.order === 's_n_desc') {
opt.href = handleFilterUrl(params, {order: 's_n_asc'});
opt.href = handleFilterUrl(params, { order: 's_n_asc' });
opt.desc = false;
} else {
opt.href = handleFilterUrl(params, {order: 's_n_desc'});
opt.href = handleFilterUrl(params, { order: 's_n_desc' });
opt.desc = true;
}
}
... ... @@ -299,13 +299,13 @@ exports.handleSaleOptsData = (params, total, extra) => {
// 上下翻页数据处理
dest.pageCounts = [{
href: handleFilterUrl(params, {limit: 200}),
href: handleFilterUrl(params, { limit: 200 }),
count: 200
}, {
href: handleFilterUrl(params, {limit: 100}),
href: handleFilterUrl(params, { limit: 100 }),
count: 100
}, {
href: handleFilterUrl(params, {limit: 60}),
href: handleFilterUrl(params, { limit: 60 }),
count: 60
}];
... ... @@ -322,17 +322,17 @@ exports.handleSaleOptsData = (params, total, extra) => {
// 上一页下一页
let preHref = (!_.isEmpty(params.page) && parseInt(params.page, 10) > 1) ?
parseInt(params.page, 10) - 1 : 1;
parseInt(params.page, 10) - 1 : 1;
let nextHref = (!_.isEmpty(params.page)) ? parseInt(params.page, 10) + 1 : 2;
if (dest.pageCount > 1 && (parseInt(params.page, 10) !== 1) &&
(parseInt(params.page, 10) !== dest.pageCount)) {
dest.preHref = handleFilterUrl(params, {page: preHref});
dest.nextHref = handleFilterUrl(params, {page: nextHref});
dest.preHref = handleFilterUrl(params, { page: preHref });
dest.nextHref = handleFilterUrl(params, { page: nextHref });
} else if (dest.pageCount > 1 && (parseInt(params.page, 10) === 1)) {
dest.nextHref = handleFilterUrl(params, {page: nextHref});
dest.nextHref = handleFilterUrl(params, { page: nextHref });
} else if (dest.pageCount > 1 && (parseInt(params.page, 10) === dest.pageCount)) {
dest.preHref = handleFilterUrl(params, {page: preHref});
dest.preHref = handleFilterUrl(params, { page: preHref });
}
// 全部商品数
... ... @@ -390,7 +390,7 @@ exports.handleSaleSortData = (origin, params, extra) => {
name: value.category_name,
num: value.node_count,
childList: [],
href: handleFilterUrl(params, {sort: value.relation_parameter.sort}),
href: handleFilterUrl(params, { sort: value.relation_parameter.sort }),
active: params.sort === value.relation_parameter.sort
};
... ... @@ -398,7 +398,7 @@ exports.handleSaleSortData = (origin, params, extra) => {
category.childList.push({
name: subValue.category_name,
num: subValue.node_count,
href: handleFilterUrl(params, {sort: subValue.relation_parameter.sort}),
href: handleFilterUrl(params, { sort: subValue.relation_parameter.sort }),
childActive: params.sort === subValue.relation_parameter.sort
});
if (params.sort === subValue.relation_parameter.sort) {
... ... @@ -424,16 +424,13 @@ exports.handleSaleFilterData = (origin, params) => {
brand: {
default: [],
brandsShow: [],
brandIndex: [
{
index: 'all',
name: '全部'
},
{
index: '0-9',
name: '0~9'
}
],
brandIndex: [{
index: 'all',
name: '全部'
}, {
index: '0-9',
name: '0~9'
}],
showMore: true,
showMulti: true
},
... ... @@ -468,7 +465,7 @@ exports.handleSaleFilterData = (origin, params) => {
checked: (typeof _.find(intBrands, o => {
return _.isEqual(o, value.id);
}) !== 'undefined'),
href: handleFilterUrl(params, {brand: value.id}),
href: handleFilterUrl(params, { brand: value.id }),
name: value.brand_name,
key: value.brand_domain,
id: value.id
... ... @@ -501,9 +498,12 @@ exports.handleSaleFilterData = (origin, params) => {
if (!_.isEmpty(origin.priceRange)) {
_.forEach(origin.priceRange, (value, key) => {
if (params.price === key) {
priceRangechecked = true;
}
let price = {
checked: params.price === key,
href: handleFilterUrl(params, {price: key}),
href: handleFilterUrl(params, { price: key }),
name: value
};
... ... @@ -515,29 +515,28 @@ exports.handleSaleFilterData = (origin, params) => {
if (!priceRangechecked && params.price) {
let customPrice = _.split(params.price, ',');
dest.customPrice = {
min: customPrice[0],
max: customPrice[1]
};
dest.checkedConditions.conditions.push({
name: '¥ ' + customPrice[0] + '-' + customPrice[1],
href: handleFilterUrl(params, {price: ''})
});
if (customPrice[1] !== '99999') {
dest.customPrice = {
min: customPrice[0],
max: customPrice[1]
};
dest.checkedConditions.conditions.push({
name: '¥ ' + customPrice[0] + '-' + customPrice[1],
href: handleFilterUrl(params, { price: '' })
});
}
}
// 处理性别数据
dest.gender = [
{
name: 'BOYS',
href: handleFilterUrl(params, {gender: '1,3'}),
checked: params.gender === '1,3'
},
{
name: 'GIRLS',
href: handleFilterUrl(params, {gender: '2,3'}),
checked: params.gender === '2,3'
}
];
dest.gender = [{
name: 'BOYS',
href: handleFilterUrl(params, { gender: '1,3' }),
checked: params.gender === '1,3'
}, {
name: 'GIRLS',
href: handleFilterUrl(params, { gender: '2,3' }),
checked: params.gender === '2,3'
}];
// 最新降价数据处理
if (parseInt(params.saleType, 10) === 3) {
... ... @@ -636,30 +635,25 @@ exports.handleBannerData = (origin) => {
* @type {[type]}
*/
exports.handlePathNavData = (data, params) => {
let pathNav = [
{
href: '/product/outlets', // TODO
name: 'OUTLET',
pathTitle: 'OUTLET'
}
];
let pathNav = [{
href: '/product/outlets', // TODO
name: 'OUTLET',
pathTitle: 'OUTLET'
}];
_.forEach(data, (sort) => {
if (!_.isEmpty(sort.sub)) {
_.forEach(sort.sub, misort => {
if (misort.relation_parameter.sort === params.sort || misort.category_id === params.misort) {
pathNav.push(
{
href: helpers.urlFormat('outlets/list', {sort: params.sort}),
name: sort.category_name,
pathTitle: sort.category_name
},
{
href: helpers.urlFormat('outlets/list', {sort: params.sort}),
name: misort.category_name,
pathTitle: misort.category_name
}
);
pathNav.push({
href: helpers.urlFormat('/product/outlets/list', { sort: params.sort }),
name: sort.category_name,
pathTitle: sort.category_name
}, {
href: helpers.urlFormat('/product/outlets/list', { sort: params.sort }),
name: misort.category_name,
pathTitle: misort.category_name
});
}
});
}
... ... @@ -696,7 +690,7 @@ exports.handlePagerData = (total, params) => {
// 当前页为 1,一定没有上一页
delete dest.prePage;
} else {
dest.prePage.url = handleFilterUrl(params, {page: currentPage - 1});
dest.prePage.url = handleFilterUrl(params, { page: currentPage - 1 });
}
if (currentPage === totalPage) {
... ... @@ -704,7 +698,7 @@ exports.handlePagerData = (total, params) => {
// 当前页为最后一页,一定没有下一页
delete dest.nextPage;
} else {
dest.nextPage.url = handleFilterUrl(params, {page: currentPage + 1});
dest.nextPage.url = handleFilterUrl(params, { page: currentPage + 1 });
}
// 页码临时数据
... ... @@ -713,7 +707,7 @@ exports.handlePagerData = (total, params) => {
if (currentPage > 2 && currentPage <= totalPage - 2) {
for (let i = currentPage - 2; i <= ((currentPage + 2) > totalPage ? totalPage : (currentPage + 2)); i++) {
pages.push({
url: handleFilterUrl(params, {page: i}),
url: handleFilterUrl(params, { page: i }),
num: i,
cur: currentPage === i
});
... ... @@ -723,7 +717,7 @@ exports.handlePagerData = (total, params) => {
} else if (currentPage <= 2) {
for (let i = 1; i <= (totalPage < 5 ? totalPage : 5); i++) {
pages.push({
url: handleFilterUrl(params, {page: i}),
url: handleFilterUrl(params, { page: i }),
num: i,
cur: currentPage === i
});
... ... @@ -731,7 +725,7 @@ exports.handlePagerData = (total, params) => {
} else if (currentPage > totalPage - 2) {
for (let i = totalPage; i >= totalPage - 4; i--) {
pages.push({
url: handleFilterUrl(params, {page: i}),
url: handleFilterUrl(params, { page: i }),
num: i,
cur: currentPage === i
});
... ... @@ -745,7 +739,7 @@ exports.handlePagerData = (total, params) => {
if (_.size(pages) === 5) {
if (currentPage > 4) {
prevPages.push({
url: handleFilterUrl(params, {page: 1}),
url: handleFilterUrl(params, { page: 1 }),
num: 1
});
prevPages.push({
... ... @@ -757,7 +751,7 @@ exports.handlePagerData = (total, params) => {
num: '...'
});
nextPages.push({
url: handleFilterUrl(params, {page: totalPage}),
url: handleFilterUrl(params, { page: totalPage }),
num: totalPage
});
}
... ...
... ... @@ -159,7 +159,9 @@ exports.getSaleIndexData = (channel) => {
// 折扣专场活动处理
if (result[1].code === 200) {
finalResult.brandSale = saleHandler.handleSaleActivityData(result[1].data, channel);
if (result[1].data.length > 0) {
finalResult.brandSale = saleHandler.handleSaleActivityData(result[1].data, channel);
}
} else {
logger.error('discount activities api code no 200');
}
... ...
... ... @@ -5,7 +5,7 @@
<label class="time" data-limit="{{limit}}"></label>
</div>
<div class="special-name">
<img src="{{image logo 100 40}}">
<img src="{{image logo 86 40}}">
{{special}}
<span><i>{{discount}}</i>{{discountText}}</span>
</div>
... ...
... ... @@ -4,7 +4,7 @@
<div class="tpl-nav">
<div class="tpl-keywords">
{{#each blocks}}
<a class="keywords{{@index}}" title="{{title}}" href="{{url}}" target= "_blank"><img src="{{image img 185 75}}"/></a>
<a class="keywords{{@index}}" title="{{title}}" href="{{url}}" target= "_blank"><img src="{{image img 185 76}}"/></a>
{{/each}}
</div>
<div class="tpl-category clearfix">
... ... @@ -15,13 +15,13 @@
</div>
<div class="tpl-brands imgopacity clearfix">
{{#each brands}}
<a title="{{title}}" href="{{url}}" target= "_blank"><img src="{{image img 375 505}}"/></a>
<a title="{{title}}" href="{{url}}" target= "_blank"><img src="{{image img 377 504}}"/></a>
{{/each}}
</div>
<div class="tpl-types imgopacity clearfix">
<ul>
{{#each types}}
<li><a title="{{title}}" href="{{url}}" target= "_blank"><img src="{{image img 185 245}}"/></a></li>
<li><a title="{{title}}" href="{{url}}" target= "_blank"><img src="{{image img 185 248}}"/></a></li>
{{/each}}
</ul>
</div>
... ...
... ... @@ -5,7 +5,7 @@
<div class="list-page">
{{# brands}}
<div class="brand-item">
<img class="lazy" data-original="{{image logo 112 77}}">
<img class="lazy" data-original="{{image logo 140 65}}">
</div>
{{/ brands}}
</div>
... ...
... ... @@ -22,7 +22,7 @@
</a>
<div class="item-info">
<a href="{{href}}" target="_blank">
<img class="logo-img" src="{{image logo 155 65}}">
<img class="logo-img" src="{{image logo 140 65}}">
<p class="discount"><i>{{discount}}</i>{{discountText}}</p>
<p class="title">{{title}}</p>
<label class="time" data-limit="{{limit}}" data-pre="仅剩"></label>
... ...
... ... @@ -10,7 +10,7 @@
</a>
<div class="item-info">
<a href="{{href}}" target="_blank">
<img src="{{image logo 150 50}}" class="brand-logo">
<img src="{{image logo 140 65}}" class="brand-logo">
</a>
<div class="activity-info">
<p>
... ...
<div class="brand-sale">
<div class="floor-title">
折扣专场 SALE
</div>
{{#brandSale}}
<div class="sale-group-big clearfix">
{{#big}}
<a class="item pull-left" href="{{link}}" target= "_blank">
<div class="pic">
<img src="{{image img 375 400}}">
<div class="time"><span class="time-span"><span class="iconfont">&#xe60a;</span>{{time}}</span></div>
</div>
<div class="detail">
<img class="brand pull-left" src="{{image brand 185 86}}">
<div class="text">
<div class="discount">
<span class="num">{{discount}}</span>
{{discountText}}
</div>
<div class="active-name">{{activityName}}</div>
<div class="title">
{{title}}
{{#if brandSale}}
{{#brandSale}}
<div class="floor-title">
折扣专场 SALE
</div>
<div class="sale-group-big clearfix">
{{#big}}
<a class="item pull-left" href="{{link}}" target= "_blank">
<div class="pic">
<img src="{{image img 375 375}}">
<div class="time"><span class="time-span"><span class="iconfont">&#xe60a;</span>{{time}}</span></div>
</div>
<div class="detail">
<img class="brand pull-left" src="{{image brand 185 86}}">
<div class="text">
<div class="discount">
<span class="num">{{discount}}</span>
{{discountText}}
</div>
<div class="active-name">{{activityName}}</div>
<div class="title">
{{title}}
</div>
</div>
</div>
</div>
</a>
{{/big}}
</div>
<div class="sale-group clearfix">
{{#normal}}
<a class="item pull-left" href="{{link}}" target= "_blank">
<img class="pic" src="{{image img 350 360}}">
<div class="detail">
<div class="title">{{title}}{{discount}}{{discountText}}</div>
<div class="time">{{time}}</div>
</div>
</a>
{{/normal}}
</div>
{{/brandSale}}
</a>
{{/big}}
</div>
<div class="sale-group clearfix">
{{#normal}}
<a class="item pull-left" href="{{link}}" target= "_blank">
<img class="pic" src="{{image img 350 350}}">
<div class="detail">
<div class="title">{{title}}{{discount}}{{discountText}}</div>
<div class="time">{{time}}</div>
</div>
</a>
{{/normal}}
</div>
{{/brandSale}}
{{/if}}
</div>
... ...
<div class="floor-header clearfix">
<h2 class="floor-title">{{name}}</h2>
{{# name}}
<h2 class="floor-title">{{.}}</h2>
{{/ name}}
{{#if navs}}
<ul class="header-navs">
{{# navs}}
... ...
This diff could not be displayed because it is too large.
... ... @@ -575,8 +575,8 @@
}
.tpl-brands {
width: 378px;
height: 512px;
width: 377px;
height: 504px;
li a {
height: 248px;
... ...
... ... @@ -56,8 +56,8 @@
}
.logo-img {
width: 79%;
height: 25%;
width: 140px;
height: auto;
margin: 25px 0 40px;
float: none;
}
... ... @@ -136,7 +136,7 @@
.brand-item img {
width: 90%;
margin-top: 6px;
margin-top: 19px;
}
}
... ... @@ -276,7 +276,8 @@
.brand-logo {
width: 120px;
float: right;
margin-top: 20px;
margin-top: 14px;
margin-right: 8px;
}
.activity-info {
... ...
... ... @@ -144,7 +144,7 @@
.pic {
position: relative;
height: 400px;
height: 375px;
}
.time {
... ...