...
|
...
|
@@ -90,19 +90,20 @@ const getNewReportFloorData = data => { |
|
|
const getHotGoodsFloorData = data => {
|
|
|
let list = [];
|
|
|
|
|
|
_.forEach(data, (item) => {
|
|
|
_.forEach(data, (item, index) => {
|
|
|
if (item.template_intro === '热门品类') {
|
|
|
let object = {},
|
|
|
keyword = [],
|
|
|
category = [],
|
|
|
brands = [],
|
|
|
types = [];
|
|
|
types = [],
|
|
|
navs = {},
|
|
|
products = [];
|
|
|
|
|
|
// product = [];
|
|
|
// console.log(item.data);
|
|
|
// console.log(item.data);
|
|
|
// console.log(item.data.menuNav);
|
|
|
// console.log(item.data.navs);
|
|
|
// return false;
|
|
|
|
|
|
|
|
|
_.forEach(item.data.menuNav.list, (it) => {
|
|
|
let obj = {};
|
...
|
...
|
@@ -121,24 +122,39 @@ const getHotGoodsFloorData = data => { |
|
|
keyword.push(obj);
|
|
|
});
|
|
|
|
|
|
_.forEach(item.data.imgs, (it, index) => {
|
|
|
_.forEach(item.data.imgs, (it, idx) => {
|
|
|
let obj = {};
|
|
|
|
|
|
obj.name = it.title;
|
|
|
obj.href = it.url;
|
|
|
obj.img = it.img;
|
|
|
|
|
|
if (index < 2) {
|
|
|
if (idx === 0 || idx === 4) {
|
|
|
brands.push(obj);
|
|
|
} else {
|
|
|
types.push(obj);
|
|
|
}
|
|
|
});
|
|
|
|
|
|
_.forEach(data[index + 1].data, (it) => {
|
|
|
let obj = {};
|
|
|
|
|
|
obj.name = it.title;
|
|
|
obj.href = it.url;
|
|
|
obj.img = it.src;
|
|
|
|
|
|
products.push(obj);
|
|
|
});
|
|
|
|
|
|
navs.name = item.data.navs.list[0].name;
|
|
|
navs.href = item.data.navs.list[0].url;
|
|
|
object.name = item.data.name;
|
|
|
object.keyword = keyword;
|
|
|
object.category = category;
|
|
|
object.brands = brands;
|
|
|
object.types = types;
|
|
|
object.navs = navs;
|
|
|
object.products = products;
|
|
|
list.push(object);
|
|
|
}
|
|
|
});
|
...
|
...
|
@@ -188,7 +204,8 @@ exports.getContent = (type) => { |
|
|
data.recommend = {
|
|
|
tplrecommend: getHotGoodsFloorData(contentData.list)
|
|
|
};
|
|
|
console.log(data.newReport);
|
|
|
|
|
|
// console.log(contentData.list);
|
|
|
return data;
|
|
|
});
|
|
|
}; |
...
|
...
|
|