Showing
1 changed file
with
18 additions
and
18 deletions
@@ -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,8 +201,8 @@ const handleSalebreakingYardsSortData = (origin, params) => { | @@ -201,8 +201,8 @@ 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 => { |
@@ -210,7 +210,7 @@ const handleSalebreakingYardsSortData = (origin, params) => { | @@ -210,7 +210,7 @@ const handleSalebreakingYardsSortData = (origin, params) => { | ||
210 | }))) { | 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}), |
@@ -538,7 +538,7 @@ exports.handleSaleSortData = (origin, params, extra) => { | @@ -538,7 +538,7 @@ exports.handleSaleSortData = (origin, params, extra) => { | ||
538 | num: extra | 538 | num: extra |
539 | }; | 539 | }; |
540 | 540 | ||
541 | - _.forEach(origin, function (value) { | 541 | + _.forEach(origin, function(value) { |
542 | 542 | ||
543 | let category = {}; | 543 | let category = {}; |
544 | 544 | ||
@@ -547,7 +547,7 @@ exports.handleSaleSortData = (origin, params, extra) => { | @@ -547,7 +547,7 @@ exports.handleSaleSortData = (origin, params, extra) => { | ||
547 | category.childList = []; | 547 | category.childList = []; |
548 | category.href = handleFilterUrl(params, {sort: value.relation_parameter.sort}); | 548 | category.href = handleFilterUrl(params, {sort: value.relation_parameter.sort}); |
549 | category.active = false; | 549 | category.active = false; |
550 | - _.forEach(value.sub, function (subValue) { | 550 | + _.forEach(value.sub, function(subValue) { |
551 | category.childList.push({ | 551 | category.childList.push({ |
552 | name: subValue.category_name, | 552 | name: subValue.category_name, |
553 | num: subValue.node_count, | 553 | num: subValue.node_count, |
@@ -577,7 +577,7 @@ exports.handleSaleActivityData = (origin, channel) => { | @@ -577,7 +577,7 @@ exports.handleSaleActivityData = (origin, channel) => { | ||
577 | 577 | ||
578 | dest.big = []; | 578 | dest.big = []; |
579 | dest.normal = []; | 579 | dest.normal = []; |
580 | - _.forEach(origin, function (value, key) { | 580 | + _.forEach(origin, function(value, key) { |
581 | let activity = {}; | 581 | let activity = {}; |
582 | 582 | ||
583 | activity.link = | 583 | activity.link = |
@@ -624,9 +624,9 @@ exports.handleSaleBannerData = (origin) => { | @@ -624,9 +624,9 @@ exports.handleSaleBannerData = (origin) => { | ||
624 | var dest = {}; | 624 | var dest = {}; |
625 | 625 | ||
626 | dest.list = []; | 626 | dest.list = []; |
627 | - _.forEach(origin, function (value) { | 627 | + _.forEach(origin, function(value) { |
628 | if (value.template_name === 'focus') { | 628 | if (value.template_name === 'focus') { |
629 | - _.forEach(value.data, function (subValue) { | 629 | + _.forEach(value.data, function(subValue) { |
630 | let banner = {}; | 630 | let banner = {}; |
631 | 631 | ||
632 | banner.bannerHeight = 450; | 632 | banner.bannerHeight = 450; |
@@ -651,9 +651,9 @@ exports.handleSaleBannerSmallData = (origin) => { | @@ -651,9 +651,9 @@ exports.handleSaleBannerSmallData = (origin) => { | ||
651 | var dest = []; | 651 | var dest = []; |
652 | let count = 0; | 652 | let count = 0; |
653 | 653 | ||
654 | - _.forEach(origin, function (value) { | 654 | + _.forEach(origin, function(value) { |
655 | if (value.template_name === 'threePicture') { | 655 | if (value.template_name === 'threePicture') { |
656 | - _.forEach(value.data, function (picList) { | 656 | + _.forEach(value.data, function(picList) { |
657 | if (count++ < 3) { | 657 | if (count++ < 3) { |
658 | let smallPic = {}; | 658 | let smallPic = {}; |
659 | 659 |
-
Please register or login to post a comment