...
|
...
|
@@ -9,6 +9,8 @@ const _ = require('lodash'); |
|
|
|
|
|
const ServiceAPI = require(`${global.library}/api`).ServiceAPI;
|
|
|
const sign = require(`${global.library}/sign`);
|
|
|
const helpers = require(`${global.library}/helpers`);
|
|
|
|
|
|
|
|
|
const serviceApi = new ServiceAPI();
|
|
|
|
...
|
...
|
@@ -137,6 +139,30 @@ const getNewReportFloorData = args => { |
|
|
return floorDatas;
|
|
|
};
|
|
|
|
|
|
// 优选品牌
|
|
|
const getPreBrandTopData = args => {
|
|
|
let item = args[0].data;
|
|
|
|
|
|
const data = {
|
|
|
preferenceBrands: {
|
|
|
name: '优选品牌',
|
|
|
imgBrand: [],
|
|
|
brandUrl:helpers.urlFormat('getbrandFloorDataAjax')
|
|
|
}
|
|
|
};
|
|
|
|
|
|
_.forEach(item, (topData) => {
|
|
|
let o = {};
|
|
|
|
|
|
o.href = topData.url;
|
|
|
o.img = topData.src;
|
|
|
|
|
|
data.preferenceBrands.imgBrand.push(o);
|
|
|
});
|
|
|
|
|
|
return data;
|
|
|
};
|
|
|
|
|
|
// 热门品类
|
|
|
const getHotGoodsFloorData = (args) => {
|
|
|
let item = args[0];
|
...
|
...
|
@@ -266,8 +292,8 @@ const getSingleHotFloorData = args => { |
|
|
const requestContent = type => {
|
|
|
|
|
|
let data = sign.apiSign({
|
|
|
/* eslint-disable */
|
|
|
client_type: 'web',
|
|
|
/* eslint-disable */
|
|
|
client_type: 'web',
|
|
|
/* eslint-enable */
|
|
|
content_code: channelMap[type || 'boys'].code,
|
|
|
gender: channelMap[type || 'boys'].gender,
|
...
|
...
|
@@ -283,6 +309,7 @@ const floorMap = { |
|
|
hot: getHotGoodsFloorData,
|
|
|
最新速报: getNewReportFloorData,
|
|
|
人气单品: getSingleHotFloorData,
|
|
|
优选品牌: getPreBrandTopData,
|
|
|
ad: getadbannerData
|
|
|
};
|
|
|
|
...
|
...
|
@@ -335,3 +362,31 @@ exports.getContent = type => { |
|
|
}
|
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
// 优选品牌楼层floorData-ajax
|
|
|
exports.getbrandFloorDataAjax = type => {
|
|
|
return requestContent(type).then(res => {
|
|
|
if (res.code === 200) {
|
|
|
let contentData = res.data.list;
|
|
|
|
|
|
let data = {
|
|
|
'logoBrand':[],
|
|
|
'moreBrand':''
|
|
|
};
|
|
|
|
|
|
_.forEach(contentData[6].data, (floorData) => {
|
|
|
let o = {};
|
|
|
|
|
|
o.href = floorData.url;
|
|
|
o.img = helpers.image(floorData.src, 185, 86, 2);
|
|
|
|
|
|
data.logoBrand.push(o);
|
|
|
});
|
|
|
|
|
|
data.moreBrand = contentData[7].data[0].url;
|
|
|
|
|
|
return data;
|
|
|
}
|
|
|
});
|
|
|
}; |
...
|
...
|
|