...
|
...
|
@@ -80,7 +80,7 @@ const handleFilterUrl = (originParam, newParam) => { |
|
|
|
|
|
tempOriginParam = Object.assign(tempOriginParam, originParam, newParam);
|
|
|
|
|
|
_.forEach(tempOriginParam, function(value, key) {
|
|
|
_.forEach(tempOriginParam, function (value, key) {
|
|
|
dest = dest + key + '=' + value + '&';
|
|
|
});
|
|
|
|
...
|
...
|
@@ -211,8 +211,8 @@ const handleSalebreakingYardsSortData = (origin, params) => { |
|
|
if (!_.isEmpty(params.sort)) {
|
|
|
|
|
|
// 是否有分类筛选参数,如果有
|
|
|
_.forEach(params.sort.split(','), function(sortParam) {
|
|
|
_.forEach(origin, function(value) {
|
|
|
_.forEach(params.sort.split(','), function (sortParam) {
|
|
|
_.forEach(origin, function (value) {
|
|
|
|
|
|
// 判断是否在这组数据里面
|
|
|
if (!_.isEmpty(_.find(value.sort_id.split(','), o => {
|
...
|
...
|
@@ -220,7 +220,7 @@ const handleSalebreakingYardsSortData = (origin, params) => { |
|
|
}))) {
|
|
|
|
|
|
// 如果在某组数据里面,组合数据退出循环
|
|
|
_.forEach(value.sub, function(subValue) {
|
|
|
_.forEach(value.sub, function (subValue) {
|
|
|
let size = {};
|
|
|
|
|
|
size.checked =
|
...
|
...
|
@@ -235,8 +235,8 @@ const handleSalebreakingYardsSortData = (origin, params) => { |
|
|
});
|
|
|
});
|
|
|
} else { // 如果没有筛选参数,返回所有分类
|
|
|
_.forEach(origin, function(value) {
|
|
|
_.forEach(value.sub, function(subValue) {
|
|
|
_.forEach(origin, function (value) {
|
|
|
_.forEach(value.sub, function (subValue) {
|
|
|
let size = {};
|
|
|
|
|
|
size.checked = (parseInt(params.size, 10) === parseInt(subValue.size_id, 10)) ? true : false;
|
...
|
...
|
@@ -301,7 +301,7 @@ exports.handleSaleFilterData = (origin, params) => { |
|
|
if (!_.isEmpty(origin.brand)) {
|
|
|
let count = 0;
|
|
|
|
|
|
_.forEach(origin.brand, function(value) {
|
|
|
_.forEach(origin.brand, function (value) {
|
|
|
let brand = {};
|
|
|
|
|
|
brand.checked = (parseInt(params.brand, 10) === parseInt(value.id, 10)) ? true : false;
|
...
|
...
|
@@ -328,13 +328,13 @@ exports.handleSaleFilterData = (origin, params) => { |
|
|
}
|
|
|
|
|
|
// 来排排序
|
|
|
dest.brand.brandsShow = _.sortBy(dest.brand.brandsShow, function(o) {
|
|
|
dest.brand.brandsShow = _.sortBy(dest.brand.brandsShow, function (o) {
|
|
|
return o.index;
|
|
|
});
|
|
|
|
|
|
// 处理 价格 筛选数据
|
|
|
if (!_.isEmpty(origin.priceRange)) {
|
|
|
_.forEach(origin.priceRange, function(value, key) {
|
|
|
_.forEach(origin.priceRange, function (value, key) {
|
|
|
let price = {
|
|
|
checked: (params.price === key) ? true : false,
|
|
|
href: handleFilterUrl(params, {price: key}),
|
...
|
...
|
@@ -408,15 +408,15 @@ exports.handleSaleActivityData = (origin, channel) => { |
|
|
|
|
|
dest.big = [];
|
|
|
dest.normal = [];
|
|
|
_.forEach(origin, function(value, key) {
|
|
|
let activity = {};
|
|
|
|
|
|
activity.link =
|
|
|
helpers.urlFormat('/product/sale/discount/detail', {productPool: value.product_pool, channel: channel});
|
|
|
activity.img = value.cover_url;
|
|
|
activity.time = processTime(parseInt(value.left_time, 10) * 1000);
|
|
|
activity.brand = value.logo_url;
|
|
|
activity.title = value.title;
|
|
|
_.forEach(origin, function (value, key) {
|
|
|
let activity = {
|
|
|
link: helpers.urlFormat('/product/sale/discount/detail', {id: value.id, channel: channel}),
|
|
|
img: value.cover_url,
|
|
|
time: processTime(parseInt(value.left_time, 10) * 1000),
|
|
|
brand: value.logo_url,
|
|
|
title: value.title
|
|
|
};
|
|
|
|
|
|
activity = Object.assign(activity, discountSplit(value.promotion_name));
|
|
|
|
|
|
if (key < 3) {
|
...
|
...
|
@@ -455,9 +455,9 @@ exports.handleSaleBannerData = (origin) => { |
|
|
var dest = {};
|
|
|
|
|
|
dest.list = [];
|
|
|
_.forEach(origin, function(value) {
|
|
|
_.forEach(origin, function (value) {
|
|
|
if (value.template_name === 'focus') {
|
|
|
_.forEach(value.data, function(subValue) {
|
|
|
_.forEach(value.data, function (subValue) {
|
|
|
let banner = {};
|
|
|
|
|
|
banner.bannerHeight = 450;
|
...
|
...
|
@@ -482,9 +482,9 @@ exports.handleSaleBannerSmallData = (origin) => { |
|
|
var dest = [];
|
|
|
let count = 0;
|
|
|
|
|
|
_.forEach(origin, function(value) {
|
|
|
_.forEach(origin, function (value) {
|
|
|
if (value.template_name === 'threePicture') {
|
|
|
_.forEach(value.data, function(picList) {
|
|
|
_.forEach(value.data, function (picList) {
|
|
|
if (count++ < 3) {
|
|
|
let smallPic = {};
|
|
|
|
...
|
...
|
|