Authored by 郭成尧

三个页面左侧分类数据处理

... ... @@ -2,7 +2,7 @@
* @Author: Targaryen
* @Date: 2016-05-19 10:20:08
* @Last Modified by: Targaryen
* @Last Modified time: 2016-05-25 17:28:56
* @Last Modified time: 2016-05-25 17:49:34
*/
'use strict';
... ... @@ -137,16 +137,25 @@ const handleSaleOptsData = () => {
const handleSaleSortData = (origin) => {
var leftContent = {};
leftContent.allDiscount = {};
leftContent.allDiscount.list = [];
leftContent.allSort = {};
leftContent.allSort.list = [];
_.forEach(origin, function(value) {
let category = {};
category.name = value.category_name;
category.href = '';
category.num = value.node_count;
leftContent.allDiscount.list.push(category);
category.childList = [];
_.forEach(value.sub, function(subValue) {
category.childList.push({
name: subValue.category_name,
num: subValue.node_count,
href: ''
});
});
leftContent.allSort.list.push(category);
});
... ... @@ -154,7 +163,7 @@ const handleSaleSortData = (origin) => {
};
/**
* 处理断码区页面左侧分类筛选数据
* 处理断码区分类筛选数据 待处理
* @return {[type]} [description]
*/
const handleSalebreakingYardsSortData = (origin) => {
... ... @@ -299,7 +308,7 @@ const getSaleGoodsList = (params) => {
};
/**
* 断码区获取左侧分类信息数据 promise 对象
* 断码区分类信息数据 promise 对象
* @return {[type]} [description]
*/
const getSalebreakingYardsSortList = () => {
... ... @@ -426,7 +435,7 @@ exports.getSalebreakingYardsData = (params) => {
let finalResult = {};
if (result[0].code === 200) {
finalResult.leftContent = handleSalebreakingYardsSortData(result[0].data);
finalResult.size = handleSalebreakingYardsSortData(result[0].data); //待处理
}
if (result[1].code === 200) {
... ... @@ -436,6 +445,7 @@ exports.getSalebreakingYardsData = (params) => {
if (!_.isEmpty(result[1].data.filter)) {
finalResult.filters = handleSaleFilterData(result[1].data.filter);
finalResult.leftContent = handleSaleSortData(result[1].data.filter.group_sort);
}
}
finalResult.opts = handleSaleOptsData();
... ...