Authored by yyq

Merge branch 'release/4.6' of git.yoho.cn:fe/yohobuy-node into release/4.6

... ... @@ -496,7 +496,9 @@ exports.handleSaleFilterData = (origin, params) => {
return o.index;
});
// 处理 价格 筛选数据
// 处理价格筛选数据
let priceRangechecked = false;
if (!_.isEmpty(origin.priceRange)) {
_.forEach(origin.priceRange, (value, key) => {
let price = {
... ... @@ -509,6 +511,20 @@ 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: ''})
});
}
// 处理性别数据
dest.gender = [
{
... ...
... ... @@ -83,7 +83,7 @@ exports.handleSaleActivityData = (origin, channel) => {
_.forEach(origin, function(value, key) {
let activity = {
link: helpers.urlFormat('/product/sale/discount/detail', {id: value.id, channel: channel}),
img: value.cover_url,
img: value.web_cover_url,
time: processTime(parseInt(value.left_time, 10) * 1000),
brand: value.logo_url,
title: value.title
... ...
... ... @@ -86,19 +86,27 @@ exports.getSaleGoodsData = (params) => {
switch (userInfo.curLevel) {
case '1':
finalResult.goods[key].salePrice = value.vip1Price;
finalResult.goods[key].vip1 = true;
finalResult.goods[key] = {
salePrice: value.vip1Price,
vip1: true
};
break;
case '2':
finalResult.goods[key].salePrice = value.vip2Price;
finalResult.goods[key].vip2 = true;
finalResult.goods[key] = {
salePrice: value.vip2Price,
vip2: true
};
break;
case '3':
finalResult.goods[key].salePrice = value.vip3Price;
finalResult.goods[key].vip3 = true;
finalResult.goods[key] = {
salePrice: value.vip3Price,
vip3: true
};
break;
default:
finalResult.goods[key].vip = true;
finalResult.goods[key] = {
vip: true
};
delete finalResult.goods[key].salesPrice;
break;
}
... ... @@ -285,6 +293,8 @@ exports.getSaleOthersData = (params, channel) => {
delete finalResult.goods[key].tags.isSale;// 屏蔽 sale 标签
delete finalResult.goods[key].discount; // 屏蔽折扣信息
});
} else {
logger.error('goods list api code no 200');
}
// 获取焦点图数据
... ... @@ -317,19 +327,27 @@ exports.getSaleOthersData = (params, channel) => {
switch (userInfo.curLevel) {
case '1':
finalResult.goods[key].salePrice = value.vip1_price;
finalResult.goods[key].vip1 = true;
finalResult.goods[key] = {
salePrice: value.vip1_price,
vip1: true
};
break;
case '2':
finalResult.goods[key].salePrice = value.vip2_price;
finalResult.goods[key].vip2 = true;
finalResult.goods[key] = {
salePrice: value.vip2_price,
vip2: true
};
break;
case '3':
finalResult.goods[key].salePrice = value.vip3_price;
finalResult.goods[key].vip3 = true;
finalResult.goods[key] = {
salePrice: value.vip3_price,
vip3: true
};
break;
default:
finalResult.goods[key].vip = true;
finalResult.goods[key] = {
vip: true
};
delete finalResult.goods[key].salesPrice;
break;
}
... ... @@ -378,10 +396,11 @@ exports.getSaleDiscountData = (params, channel) => {
finalResult.saleTitle = saleHandler.handleDiscountTitleData(result[2].data[0]);
if (result[2].data[0].web_url) {
finalResult.topBanner = {
list: []
};
finalResult.topBanner.list[0] = {
img: result[2].data[0].web_url
list: [
{
img: result[2].data[0].web_url
}
]
};
} else {
logger.error('discount activity data[0] web_url empty');
... ...