Authored by 郭成尧

首页分类数据取活

@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 * @Author: Targaryen 2 * @Author: Targaryen
3 * @Date: 2016-05-25 18:16:59 3 * @Date: 2016-05-25 18:16:59
4 * @Last Modified by: Targaryen 4 * @Last Modified by: Targaryen
5 - * @Last Modified time: 2016-06-06 17:06:34 5 + * @Last Modified time: 2016-06-06 17:28:21
6 */ 6 */
7 7
8 'use strict'; 8 'use strict';
@@ -179,8 +179,8 @@ const handleSalebreakingYardsSortData = (origin, params) => { @@ -179,8 +179,8 @@ const handleSalebreakingYardsSortData = (origin, params) => {
179 179
180 // 判断是否在这组数据里面 180 // 判断是否在这组数据里面
181 if (!_.isEmpty(_.find(value.sort_id.split(','), o => { 181 if (!_.isEmpty(_.find(value.sort_id.split(','), o => {
182 - return o === sortParam;  
183 - }))) { 182 + return o === sortParam;
  183 + }))) {
184 184
185 // 如果在某组数据里面,组合数据退出循环 185 // 如果在某组数据里面,组合数据退出循环
186 _.forEach(value.sub, function(subValue) { 186 _.forEach(value.sub, function(subValue) {
@@ -586,22 +586,27 @@ exports.handleSaleCategoryData = (origin, saleType, channel) => { @@ -586,22 +586,27 @@ exports.handleSaleCategoryData = (origin, saleType, channel) => {
586 dest.navItem[0].title = '今日推荐'; 586 dest.navItem[0].title = '今日推荐';
587 dest.navItem[0].vip = true; 587 dest.navItem[0].vip = true;
588 588
  589 + let urlLocation = {};
  590 +
589 // title urlLocation 处理 591 // title urlLocation 处理
590 switch (saleType) { 592 switch (saleType) {
591 case '1': 593 case '1':
592 dest.title = '断码区'; 594 dest.title = '断码区';
593 - dest.urlLocation = dest.navItem[0].urlLocation = '?saleType=' + saleType +  
594 - '&order=s_t_desc&limit=14&channel=' + channel; 595 + urlLocation.url = '?saleType=' + saleType + '&order=s_t_desc&channel=' + channel;
  596 + urlLocation.limit = 14;
  597 + dest.urlLocation = dest.navItem[0].urlLocation = urlLocation.url + `&limit=${urlLocation.limit}`;
595 break; 598 break;
596 case '2': 599 case '2':
597 dest.title = 'VIP会员专享'; 600 dest.title = 'VIP会员专享';
598 - dest.urlLocation = dest.navItem[0].urlLocation = '?saleType=' + saleType +  
599 - '&order=s_t_desc&limit=11&channel=' + channel; 601 + urlLocation.url = '?saleType=' + saleType + '&order=s_t_desc&channel=' + channel;
  602 + urlLocation.limit = 11;
  603 + dest.urlLocation = dest.navItem[0].urlLocation = urlLocation.url + `&limit=${urlLocation.limit}`;
600 break; 604 break;
601 case '3': 605 case '3':
602 dest.title = '最新降价'; 606 dest.title = '最新降价';
603 - dest.urlLocation = dest.navItem[0].urlLocation = '?saleType=' + saleType +  
604 - '&order=s_t_desc&limit=14&channel=' + channel; 607 + urlLocation.url = '?saleType=' + saleType + '&order=s_t_desc&channel=' + channel;
  608 + urlLocation.limit = 14;
  609 + dest.urlLocation = dest.navItem[0].urlLocation = urlLocation.url + `&limit=${urlLocation.limit}`;
605 break; 610 break;
606 default: 611 default:
607 break; 612 break;
@@ -614,7 +619,8 @@ exports.handleSaleCategoryData = (origin, saleType, channel) => { @@ -614,7 +619,8 @@ exports.handleSaleCategoryData = (origin, saleType, channel) => {
614 if (count++ < 4) { 619 if (count++ < 4) {
615 let nav = {}; 620 let nav = {};
616 621
617 - nav.urlLocation = dest.urlLocation + '&sort=' + value.relation_parameter.sort; 622 + nav.urlLocation = urlLocation.url + '&sort=' + value.relation_parameter.sort +
  623 + `&limit=${(urlLocation.limit + 1)}`;
618 nav.title = value.category_name; 624 nav.title = value.category_name;
619 nav.newDiscount = true; 625 nav.newDiscount = true;
620 626