Authored by 郭成尧

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

@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2016-05-19 10:20:08 3 * @Date: 2016-05-19 10:20:08
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2016-05-25 17:28:56 5 + * @Last Modified time: 2016-05-25 17:49:34
6 */ 6 */
7 7
8 'use strict'; 8 'use strict';
@@ -137,16 +137,25 @@ const handleSaleOptsData = () => { @@ -137,16 +137,25 @@ const handleSaleOptsData = () => {
137 const handleSaleSortData = (origin) => { 137 const handleSaleSortData = (origin) => {
138 var leftContent = {}; 138 var leftContent = {};
139 139
140 - leftContent.allDiscount = {};  
141 - leftContent.allDiscount.list = []; 140 + leftContent.allSort = {};
  141 + leftContent.allSort.list = [];
142 142
143 _.forEach(origin, function(value) { 143 _.forEach(origin, function(value) {
144 let category = {}; 144 let category = {};
145 145
146 category.name = value.category_name; 146 category.name = value.category_name;
147 - category.href = '';  
148 category.num = value.node_count; 147 category.num = value.node_count;
149 - leftContent.allDiscount.list.push(category); 148 + category.childList = [];
  149 +
  150 + _.forEach(value.sub, function(subValue) {
  151 + category.childList.push({
  152 + name: subValue.category_name,
  153 + num: subValue.node_count,
  154 + href: ''
  155 + });
  156 + });
  157 +
  158 + leftContent.allSort.list.push(category);
150 }); 159 });
151 160
152 161
@@ -154,7 +163,7 @@ const handleSaleSortData = (origin) => { @@ -154,7 +163,7 @@ const handleSaleSortData = (origin) => {
154 }; 163 };
155 164
156 /** 165 /**
157 - * 处理断码区页面左侧分类筛选数据 166 + * 处理断码区分类筛选数据 待处理
158 * @return {[type]} [description] 167 * @return {[type]} [description]
159 */ 168 */
160 const handleSalebreakingYardsSortData = (origin) => { 169 const handleSalebreakingYardsSortData = (origin) => {
@@ -299,7 +308,7 @@ const getSaleGoodsList = (params) => { @@ -299,7 +308,7 @@ const getSaleGoodsList = (params) => {
299 }; 308 };
300 309
301 /** 310 /**
302 - * 断码区获取左侧分类信息数据 promise 对象 311 + * 断码区分类信息数据 promise 对象
303 * @return {[type]} [description] 312 * @return {[type]} [description]
304 */ 313 */
305 const getSalebreakingYardsSortList = () => { 314 const getSalebreakingYardsSortList = () => {
@@ -426,7 +435,7 @@ exports.getSalebreakingYardsData = (params) => { @@ -426,7 +435,7 @@ exports.getSalebreakingYardsData = (params) => {
426 let finalResult = {}; 435 let finalResult = {};
427 436
428 if (result[0].code === 200) { 437 if (result[0].code === 200) {
429 - finalResult.leftContent = handleSalebreakingYardsSortData(result[0].data); 438 + finalResult.size = handleSalebreakingYardsSortData(result[0].data); //待处理
430 } 439 }
431 if (result[1].code === 200) { 440 if (result[1].code === 200) {
432 441
@@ -436,6 +445,7 @@ exports.getSalebreakingYardsData = (params) => { @@ -436,6 +445,7 @@ exports.getSalebreakingYardsData = (params) => {
436 445
437 if (!_.isEmpty(result[1].data.filter)) { 446 if (!_.isEmpty(result[1].data.filter)) {
438 finalResult.filters = handleSaleFilterData(result[1].data.filter); 447 finalResult.filters = handleSaleFilterData(result[1].data.filter);
  448 + finalResult.leftContent = handleSaleSortData(result[1].data.filter.group_sort);
439 } 449 }
440 } 450 }
441 finalResult.opts = handleSaleOptsData(); 451 finalResult.opts = handleSaleOptsData();