...
|
...
|
@@ -159,12 +159,13 @@ const _getSlideData = srcData => { |
|
|
* @param {Object} srcData 原始数据
|
|
|
* @return {Object} 转换后的数据
|
|
|
*/
|
|
|
const _getNewReportFloorData = (args, type, code) => {
|
|
|
const _getNewReportFloorData = (args) => {
|
|
|
const title = args[0].data.text;
|
|
|
let item = args[1].data;
|
|
|
let secondItem = args[2].data;
|
|
|
let thirdItem = args[3].data;
|
|
|
let forthItem = args.length === 5 ? args[4] : {};
|
|
|
let forthItem = args[4] || {};
|
|
|
let brandLogos = {logoBrand: [], moreBrand: ''};
|
|
|
|
|
|
let list = [];
|
|
|
|
...
|
...
|
@@ -199,8 +200,20 @@ const _getNewReportFloorData = (args, type, code) => { |
|
|
|
|
|
// logo列表
|
|
|
if (forthItem.template_name && forthItem.template_name === 'floor') {
|
|
|
data.newReport.brandUrl = '/getbrandFloorDataAjax?channelType=' + type +
|
|
|
'&contentCode=' + code;
|
|
|
// 品牌数据
|
|
|
_.forEach(forthItem.data, (floorData) => {
|
|
|
let o = {};
|
|
|
|
|
|
o.href = floorData.url;
|
|
|
o.img = helpers.image(floorData.src, 185, 86, 2);
|
|
|
brandLogos.logoBrand.push(o);
|
|
|
});
|
|
|
|
|
|
if (args[5] && args[5].data[0] && args[5].data[0].url) {
|
|
|
brandLogos.moreBrand = args[5].data[0].url || '';
|
|
|
}
|
|
|
|
|
|
data.newReport.brandLogos = brandLogos;
|
|
|
}
|
|
|
return floorDatas;
|
|
|
};
|
...
|
...
|
@@ -224,16 +237,32 @@ const _setChannelType = (obj, type) => { |
|
|
*/
|
|
|
const _getPreBrandTopData = (args, type) => {
|
|
|
const title = args[0].data.text;
|
|
|
let item = args[1].data;
|
|
|
let item = args[1].data,
|
|
|
logoItems = args[2] || {},
|
|
|
brandLogos = {logoBrand: [], moreBrand: ''};
|
|
|
|
|
|
const data = {
|
|
|
preferenceBrands: {
|
|
|
name: title,
|
|
|
imgBrand: [],
|
|
|
brandUrl: '/getbrandFloorDataAjax?channelType=' + type
|
|
|
imgBrand: []
|
|
|
}
|
|
|
};
|
|
|
|
|
|
// logo列表
|
|
|
if (logoItems.template_name && logoItems.template_name === 'floor') {
|
|
|
// 品牌数据
|
|
|
_.forEach(args[2].data, (floorData) => {
|
|
|
let o = {};
|
|
|
|
|
|
o.href = floorData.url;
|
|
|
o.img = helpers.image(floorData.src, 185, 86, 2);
|
|
|
brandLogos.logoBrand.push(o);
|
|
|
});
|
|
|
if (args[3] && args[3].data[0] && args[3].data[0].url) {
|
|
|
brandLogos.moreBrand = args[3].data[0].url;
|
|
|
}
|
|
|
data.preferenceBrands.brandLogos = brandLogos;
|
|
|
}
|
|
|
data.preferenceBrands.imgBrand = item;
|
|
|
if (type === 'kids') {
|
|
|
data.preferenceBrands.sliderColor = '#7AD3F8';
|
...
|
...
|
@@ -798,7 +827,7 @@ const _processJKFloorData = (rawData, type, code) => { |
|
|
|
|
|
// 最新速报
|
|
|
if (text.indexOf('最新速报') >= 0) {
|
|
|
floorData = _getNewReportFloorData(rawData.slice(index, index + 5), type, code);
|
|
|
floorData = _getNewReportFloorData(rawData.slice(index, index + 6));
|
|
|
|
|
|
// 单个图作为最新速报模块用过的,标识一下,不作为广告位了
|
|
|
_.filter(rawData.slice(index, index + 5), function(o) {
|
...
|
...
|
@@ -1170,49 +1199,6 @@ const getJKContent = (req) => { |
|
|
});
|
|
|
};
|
|
|
|
|
|
|
|
|
// 品牌楼层floorData-ajax
|
|
|
const getbrandFloorDataAjax = (type, code) => {
|
|
|
let params = {new_device: 'Y'};
|
|
|
|
|
|
return _requestContent(type, params, code).then(res => {
|
|
|
let contentData = res.data ? res.data.list : [];
|
|
|
|
|
|
let data = {
|
|
|
logoBrand: [],
|
|
|
moreBrand: ''
|
|
|
};
|
|
|
|
|
|
_.forEach(contentData, (d, index) => {
|
|
|
let logoIndex = index;
|
|
|
|
|
|
// 频道页,有两处logo列表,一处优选品牌后面;一处最新速报后面,此处判断
|
|
|
if (d.data && d.data.text && d.data.text.indexOf('优选品牌') >= 0) {
|
|
|
logoIndex = index + 2;
|
|
|
} else if (d.data && d.data.text && d.data.text.indexOf('最新速报') >= 0) {
|
|
|
logoIndex = index + 4;
|
|
|
}
|
|
|
|
|
|
if (logoIndex !== index) {
|
|
|
_.forEach(contentData[logoIndex].data, (floorData) => {
|
|
|
let o = {};
|
|
|
|
|
|
o.href = floorData.url;
|
|
|
o.img = helpers.image(floorData.src, 185, 86, 2);
|
|
|
|
|
|
data.logoBrand.push(o);
|
|
|
});
|
|
|
data.moreBrand = contentData[logoIndex + 1].data[0].url;
|
|
|
|
|
|
return false;
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
return data;
|
|
|
});
|
|
|
};
|
|
|
|
|
|
const getResourceData = (formatData) => {
|
|
|
let promiseArr = [];
|
|
|
|
...
|
...
|
@@ -1273,7 +1259,6 @@ module.exports = { |
|
|
getNewArrival: getNewArrival,
|
|
|
getContent: getContent,
|
|
|
getJKContent: getJKContent,
|
|
|
getbrandFloorDataAjax: getbrandFloorDataAjax,
|
|
|
getIndexGuideData: getIndexGuideData,
|
|
|
formatIndexGuideData: formatIndexGuideData,
|
|
|
getResourceData: getResourceData,
|
...
|
...
|
|