Authored by 郭成尧

热销推荐数据处理

... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2016-05-30 16:20:03
* @Last Modified by: Targaryen
* @Last Modified time: 2016-06-02 10:26:33
* @Last Modified time: 2016-06-02 10:38:10
*/
'use strict';
... ... @@ -63,16 +63,35 @@ const handleOutletsActivityData = (origin) => {
const handleOutletsBannersData = (origin) => {
var dest = {};
dest.mainBanner = {};
_.forEach(origin.list, value => {
// 处理焦点图数据
if (value.template_name === 'focus') {
dest.mainBanner = {};
dest.mainBanner.list = value.data;
}
// 处理三张小图数据
if (value.template_name === 'threePicture') {
dest.column = value.data;
}
// 处理热销推荐数据
if (value.template_name === 'recommendCategory') {
dest.hotType = {};
dest.hotType.title === _.isEmpty(value.data.title) ? '热销推荐' : value.data.title;
dest.hotType.classify = [];
_.forEach(value.data.categoryList, subValue => {
let category = {};
category.href = subValue.url;
category.name = subValue.navigateNamePC;
dest.hotType.classify.push(category);
});
}
});
return dest;
... ...