...
|
...
|
@@ -70,9 +70,7 @@ const goodsTabBar = (data, shopId) => { |
|
|
let dest = {
|
|
|
hot: [],
|
|
|
new: []
|
|
|
},
|
|
|
more = {name: 'MORE', href: shopListUrl + '?shopId=' + shopId};
|
|
|
|
|
|
};
|
|
|
|
|
|
_.forEach(data.hot, (value) => {
|
|
|
if (value.url) {
|
...
|
...
|
@@ -92,8 +90,8 @@ const goodsTabBar = (data, shopId) => { |
|
|
});
|
|
|
}
|
|
|
});
|
|
|
dest.hot.push(more);
|
|
|
dest.new.push(more);
|
|
|
dest.hot.push({name: 'MORE', url: `${shopListUrl}?navBar=2&order=s_n_desc&shopId=${shopId}`});
|
|
|
dest.new.push({name: 'MORE', url: `${shopListUrl}?navBar=3&order=s_t_desc&shopId=${shopId}`});
|
|
|
return dest;
|
|
|
};
|
|
|
|
...
|
...
|
@@ -144,11 +142,11 @@ const navigationBar = (data, shopId) => { |
|
|
},
|
|
|
{
|
|
|
name: '人气单品',
|
|
|
url: `${shopListUrl}/?navBar=2&shopId=${shopId}`
|
|
|
url: `${shopListUrl}/?navBar=2&order=s_n_desc&shopId=${shopId}`
|
|
|
},
|
|
|
{
|
|
|
name: '新品上架',
|
|
|
url: `${shopListUrl}/?navBar=3&shopId=${shopId}`
|
|
|
url: `${shopListUrl}/?navBar=3&order=s_t_desc&shopId=${shopId}`
|
|
|
}
|
|
|
];
|
|
|
|
...
|
...
|
@@ -162,13 +160,24 @@ const navigationBar = (data, shopId) => { |
|
|
* @param type $data
|
|
|
* @return type []
|
|
|
*/
|
|
|
const largeSlideImg = (data) => {
|
|
|
const largeSlideImg = (data, shopId) => {
|
|
|
let dest = [];
|
|
|
|
|
|
_.forEach(data, (value) => {
|
|
|
let url;
|
|
|
|
|
|
value = _.get(value, 'data[0]', {});
|
|
|
url = value.url;
|
|
|
|
|
|
if (+value.categoryId > 0) {
|
|
|
if (!url) {
|
|
|
url = `${shopListUrl}?shopId=${shopId}`;
|
|
|
}
|
|
|
url += `&productPool=${value.categoryId}`;
|
|
|
}
|
|
|
dest.push({
|
|
|
img: value.data[0].src,
|
|
|
url: helpers.urlFormat(value.data[0].url)
|
|
|
img: value.src,
|
|
|
url: url
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -180,13 +189,24 @@ const largeSlideImg = (data) => { |
|
|
* @param data 装修数据
|
|
|
* @returns {{}}
|
|
|
*/
|
|
|
const oneRowTwoColImages = (data) => {
|
|
|
const oneRowTwoColImages = (data, shopId) => {
|
|
|
let dest = [];
|
|
|
|
|
|
_.forEach(data, (value) => {
|
|
|
let url;
|
|
|
|
|
|
value = _.get(value, 'data[0]', {});
|
|
|
url = value.url;
|
|
|
|
|
|
if (+value.categoryId > 0) {
|
|
|
if (!url) {
|
|
|
url = `${shopListUrl}?shopId=${shopId}`;
|
|
|
}
|
|
|
url += `&productPool=${value.categoryId}`;
|
|
|
}
|
|
|
dest.push({
|
|
|
img: value.data[0].src,
|
|
|
url: helpers.urlFormat(value.data[0].url)
|
|
|
img: value.src,
|
|
|
url: url
|
|
|
});
|
|
|
});
|
|
|
return {oneRowTwoColImages: dest};
|
...
|
...
|
@@ -201,12 +221,17 @@ const recommend = (data, shopId) => { |
|
|
let dest = [];
|
|
|
|
|
|
_.forEach(data, (value) => {
|
|
|
let url = value.url || `${shopListUrl}?shopId=${shopId}`;
|
|
|
|
|
|
if (+value.categoryId > 0) {
|
|
|
url += `&productPool=${value.categoryId}`;
|
|
|
}
|
|
|
dest.push({
|
|
|
enName: value.enName,
|
|
|
name: value.name,
|
|
|
img: value.src,
|
|
|
title: value.title,
|
|
|
url: `${shopListUrl}?shopId=${shopId}&filter_poolId=${value.categoryId}`
|
|
|
url: url
|
|
|
});
|
|
|
});
|
|
|
|
...
|
...
|
@@ -301,7 +326,7 @@ exports.getShopDecorator = (data, params, shopId) => { |
|
|
Object.assign(dest.hotSingle, hotProducts(info));
|
|
|
break;
|
|
|
case 'goodsTabBar':
|
|
|
tabBar = goodsTabBar(info);
|
|
|
tabBar = goodsTabBar(info, shopId);
|
|
|
Object.assign(dest.newArrivel, {navs: tabBar.new});
|
|
|
Object.assign(dest.hotSingle, {navs: tabBar.hot});
|
|
|
break;
|
...
|
...
|
@@ -315,7 +340,7 @@ exports.getShopDecorator = (data, params, shopId) => { |
|
|
Object.assign(dest, navigationBar(info, shopId));
|
|
|
break;
|
|
|
case 'largeSlideImg':
|
|
|
Object.assign(dest, largeSlideImg(info));
|
|
|
Object.assign(dest, largeSlideImg(info, shopId));
|
|
|
break;
|
|
|
case 'oneRowTwoColImages':
|
|
|
Object.assign(dest, oneRowTwoColImages(info, shopId));
|
...
|
...
|
|