Authored by 郭成尧

'断码区添加两个参数'

@@ -113,21 +113,21 @@ const handleFilterUrl = (originParam, newParam) => { @@ -113,21 +113,21 @@ const handleFilterUrl = (originParam, newParam) => {
113 let newParamArray = _.keys(newParam); 113 let newParamArray = _.keys(newParam);
114 114
115 // 判断参数是否已经存在 115 // 判断参数是否已经存在
116 - let isExist = !_.isEmpty(_.find(originParamArray, function (o) { 116 + let isExist = !_.isEmpty(_.find(originParamArray, function(o) {
117 return o === newParamArray[0]; 117 return o === newParamArray[0];
118 })); 118 }));
119 119
120 if (isExist) { 120 if (isExist) {
121 tempOriginParam = Object.assign(tempOriginParam, originParam); 121 tempOriginParam = Object.assign(tempOriginParam, originParam);
122 122
123 - _.forEach(newParam, function (value, key) { 123 + _.forEach(newParam, function(value, key) {
124 tempOriginParam[key] = value; 124 tempOriginParam[key] = value;
125 }); 125 });
126 } else { 126 } else {
127 tempOriginParam = Object.assign(tempOriginParam, originParam, newParam); 127 tempOriginParam = Object.assign(tempOriginParam, originParam, newParam);
128 } 128 }
129 129
130 - _.forEach(tempOriginParam, function (value, key) { 130 + _.forEach(tempOriginParam, function(value, key) {
131 dest = dest + key + '=' + value + '&'; 131 dest = dest + key + '=' + value + '&';
132 }); 132 });
133 133
@@ -201,16 +201,16 @@ const handleSalebreakingYardsSortData = (origin, params) => { @@ -201,16 +201,16 @@ const handleSalebreakingYardsSortData = (origin, params) => {
201 if (!_.isEmpty(params.sort)) { 201 if (!_.isEmpty(params.sort)) {
202 202
203 // 是否有分类筛选参数,如果有 203 // 是否有分类筛选参数,如果有
204 - _.forEach(params.sort.split(','), function (sortParam) {  
205 - _.forEach(origin, function (value) { 204 + _.forEach(params.sort.split(','), function(sortParam) {
  205 + _.forEach(origin, function(value) {
206 206
207 // 判断是否在这组数据里面 207 // 判断是否在这组数据里面
208 if (!_.isEmpty(_.find(value.sort_id.split(','), o => { 208 if (!_.isEmpty(_.find(value.sort_id.split(','), o => {
209 - return o === sortParam;  
210 - }))) { 209 + return o === sortParam;
  210 + }))) {
211 211
212 // 如果在某组数据里面,组合数据退出循环 212 // 如果在某组数据里面,组合数据退出循环
213 - _.forEach(value.sub, function (subValue) { 213 + _.forEach(value.sub, function(subValue) {
214 let size = {}; 214 let size = {};
215 215
216 size.checked = 216 size.checked =
@@ -225,8 +225,8 @@ const handleSalebreakingYardsSortData = (origin, params) => { @@ -225,8 +225,8 @@ const handleSalebreakingYardsSortData = (origin, params) => {
225 }); 225 });
226 }); 226 });
227 } else { // 如果没有筛选参数,返回所有分类 227 } else { // 如果没有筛选参数,返回所有分类
228 - _.forEach(origin, function (value) {  
229 - _.forEach(value.sub, function (subValue) { 228 + _.forEach(origin, function(value) {
  229 + _.forEach(value.sub, function(subValue) {
230 let size = {}; 230 let size = {};
231 231
232 size.checked = (parseInt(params.size, 10) === parseInt(subValue.size_id, 10)) ? true : false; 232 size.checked = (parseInt(params.size, 10) === parseInt(subValue.size_id, 10)) ? true : false;
@@ -291,7 +291,7 @@ exports.handleSaleFilterData = (origin, params) => { @@ -291,7 +291,7 @@ exports.handleSaleFilterData = (origin, params) => {
291 if (!_.isEmpty(origin.brand)) { 291 if (!_.isEmpty(origin.brand)) {
292 let count = 0; 292 let count = 0;
293 293
294 - _.forEach(origin.brand, function (value) { 294 + _.forEach(origin.brand, function(value) {
295 let brand = {}; 295 let brand = {};
296 296
297 brand.checked = (parseInt(params.brand, 10) === parseInt(value.id, 10)) ? true : false; 297 brand.checked = (parseInt(params.brand, 10) === parseInt(value.id, 10)) ? true : false;
@@ -318,13 +318,13 @@ exports.handleSaleFilterData = (origin, params) => { @@ -318,13 +318,13 @@ exports.handleSaleFilterData = (origin, params) => {
318 } 318 }
319 319
320 // 来排排序 320 // 来排排序
321 - dest.brand.brandsShow = _.sortBy(dest.brand.brandsShow, function (o) { 321 + dest.brand.brandsShow = _.sortBy(dest.brand.brandsShow, function(o) {
322 return o.index; 322 return o.index;
323 }); 323 });
324 324
325 // 处理 价格 筛选数据 325 // 处理 价格 筛选数据
326 if (!_.isEmpty(origin.priceRange)) { 326 if (!_.isEmpty(origin.priceRange)) {
327 - _.forEach(origin.priceRange, function (value, key) { 327 + _.forEach(origin.priceRange, function(value, key) {
328 let price = { 328 let price = {
329 checked: (params.price === key) ? true : false, 329 checked: (params.price === key) ? true : false,
330 href: handleFilterUrl(params, {price: key}), 330 href: handleFilterUrl(params, {price: key}),
@@ -541,7 +541,7 @@ exports.handleSaleSortData = (origin, params, extra) => { @@ -541,7 +541,7 @@ exports.handleSaleSortData = (origin, params, extra) => {
541 leftContent.allSort.list.push(perAllSort); 541 leftContent.allSort.list.push(perAllSort);
542 542
543 543
544 - _.forEach(origin, function (value) { 544 + _.forEach(origin, function(value) {
545 545
546 let category = {}; 546 let category = {};
547 547
@@ -550,7 +550,7 @@ exports.handleSaleSortData = (origin, params, extra) => { @@ -550,7 +550,7 @@ exports.handleSaleSortData = (origin, params, extra) => {
550 category.childList = []; 550 category.childList = [];
551 category.href = handleFilterUrl(params, {sort: value.relation_parameter.sort}); 551 category.href = handleFilterUrl(params, {sort: value.relation_parameter.sort});
552 category.active = false; 552 category.active = false;
553 - _.forEach(value.sub, function (subValue) { 553 + _.forEach(value.sub, function(subValue) {
554 category.childList.push({ 554 category.childList.push({
555 name: subValue.category_name, 555 name: subValue.category_name,
556 num: subValue.node_count, 556 num: subValue.node_count,
@@ -580,7 +580,7 @@ exports.handleSaleActivityData = (origin, channel) => { @@ -580,7 +580,7 @@ exports.handleSaleActivityData = (origin, channel) => {
580 580
581 dest.big = []; 581 dest.big = [];
582 dest.normal = []; 582 dest.normal = [];
583 - _.forEach(origin, function (value, key) { 583 + _.forEach(origin, function(value, key) {
584 let activity = {}; 584 let activity = {};
585 585
586 activity.link = 586 activity.link =
@@ -627,9 +627,9 @@ exports.handleSaleBannerData = (origin) => { @@ -627,9 +627,9 @@ exports.handleSaleBannerData = (origin) => {
627 var dest = {}; 627 var dest = {};
628 628
629 dest.list = []; 629 dest.list = [];
630 - _.forEach(origin, function (value) { 630 + _.forEach(origin, function(value) {
631 if (value.template_name === 'focus') { 631 if (value.template_name === 'focus') {
632 - _.forEach(value.data, function (subValue) { 632 + _.forEach(value.data, function(subValue) {
633 let banner = {}; 633 let banner = {};
634 634
635 banner.bannerHeight = 450; 635 banner.bannerHeight = 450;
@@ -654,9 +654,9 @@ exports.handleSaleBannerSmallData = (origin) => { @@ -654,9 +654,9 @@ exports.handleSaleBannerSmallData = (origin) => {
654 var dest = []; 654 var dest = [];
655 let count = 0; 655 let count = 0;
656 656
657 - _.forEach(origin, function (value) { 657 + _.forEach(origin, function(value) {
658 if (value.template_name === 'small_pic') { 658 if (value.template_name === 'small_pic') {
659 - _.forEach(value.data, function (picList) { 659 + _.forEach(value.data, function(picList) {
660 if (count++ < 3) { 660 if (count++ < 3) {
661 let smallPic = {}; 661 let smallPic = {};
662 662
@@ -834,6 +834,6 @@ exports.handleSaleBreakingSizeData = (origin) => { @@ -834,6 +834,6 @@ exports.handleSaleBreakingSizeData = (origin) => {
834 dest.breakSize += subValue.size_id + ','; 834 dest.breakSize += subValue.size_id + ',';
835 }); 835 });
836 }); 836 });
837 - 837 +
838 return dest; 838 return dest;
839 -};  
  839 +};