Authored by 郭成尧

'上一页下一页'

@@ -25,21 +25,21 @@ const handleFilterUrl = (originParam, newParam) => { @@ -25,21 +25,21 @@ const handleFilterUrl = (originParam, newParam) => {
25 let newParamArray = _.keys(newParam); 25 let newParamArray = _.keys(newParam);
26 26
27 // 判断参数是否已经存在 27 // 判断参数是否已经存在
28 - let isExist = !_.isEmpty(_.find(originParamArray, function (o) { 28 + let isExist = !_.isEmpty(_.find(originParamArray, function(o) {
29 return o === newParamArray[0]; 29 return o === newParamArray[0];
30 })); 30 }));
31 31
32 if (isExist) { 32 if (isExist) {
33 tempOriginParam = Object.assign(tempOriginParam, originParam); 33 tempOriginParam = Object.assign(tempOriginParam, originParam);
34 34
35 - _.forEach(newParam, function (value, key) { 35 + _.forEach(newParam, function(value, key) {
36 tempOriginParam[key] = value; 36 tempOriginParam[key] = value;
37 }); 37 });
38 } else { 38 } else {
39 tempOriginParam = Object.assign(tempOriginParam, originParam, newParam); 39 tempOriginParam = Object.assign(tempOriginParam, originParam, newParam);
40 } 40 }
41 41
42 - _.forEach(tempOriginParam, function (value, key) { 42 + _.forEach(tempOriginParam, function(value, key) {
43 dest = dest + key + '=' + value + '&'; 43 dest = dest + key + '=' + value + '&';
44 }); 44 });
45 45
@@ -80,8 +80,8 @@ const handleSalebreakingYardsSortData = (origin, params) => { @@ -80,8 +80,8 @@ const handleSalebreakingYardsSortData = (origin, params) => {
80 if (!_.isEmpty(params.sort)) { 80 if (!_.isEmpty(params.sort)) {
81 81
82 // 是否有分类筛选参数,如果有 82 // 是否有分类筛选参数,如果有
83 - _.forEach(params.sort.split(','), function (sortParam) {  
84 - _.forEach(origin, function (value) { 83 + _.forEach(params.sort.split(','), function(sortParam) {
  84 + _.forEach(origin, function(value) {
85 85
86 // 判断是否在这组数据里面 86 // 判断是否在这组数据里面
87 if (!_.isEmpty(_.find(value.sort_id.split(','), o => { 87 if (!_.isEmpty(_.find(value.sort_id.split(','), o => {
@@ -89,7 +89,7 @@ const handleSalebreakingYardsSortData = (origin, params) => { @@ -89,7 +89,7 @@ const handleSalebreakingYardsSortData = (origin, params) => {
89 }))) { 89 }))) {
90 90
91 // 如果在某组数据里面,组合数据退出循环 91 // 如果在某组数据里面,组合数据退出循环
92 - _.forEach(value.sub, function (subValue) { 92 + _.forEach(value.sub, function(subValue) {
93 let size = {}; 93 let size = {};
94 94
95 size.checked = 95 size.checked =
@@ -104,8 +104,8 @@ const handleSalebreakingYardsSortData = (origin, params) => { @@ -104,8 +104,8 @@ const handleSalebreakingYardsSortData = (origin, params) => {
104 }); 104 });
105 }); 105 });
106 } else { // 如果没有筛选参数,返回所有分类 106 } else { // 如果没有筛选参数,返回所有分类
107 - _.forEach(origin, function (value) {  
108 - _.forEach(value.sub, function (subValue) { 107 + _.forEach(origin, function(value) {
  108 + _.forEach(value.sub, function(subValue) {
109 let size = {}; 109 let size = {};
110 110
111 size.checked = (parseInt(params.size, 10) === parseInt(subValue.size_id, 10)) ? true : false; 111 size.checked = (parseInt(params.size, 10) === parseInt(subValue.size_id, 10)) ? true : false;
@@ -352,6 +352,7 @@ exports.handleSaleOptsData = (params, total) => { @@ -352,6 +352,7 @@ exports.handleSaleOptsData = (params, total) => {
352 } else if (dest.pageCount > 1 && (parseInt(params.page, 10) === dest.pageCount)) { 352 } else if (dest.pageCount > 1 && (parseInt(params.page, 10) === dest.pageCount)) {
353 dest.preHref = handleFilterUrl(params, {page: preHref}); 353 dest.preHref = handleFilterUrl(params, {page: preHref});
354 } 354 }
  355 +
355 // 商品开始结束数 356 // 商品开始结束数
356 dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1; 357 dest.start = (!_.isEmpty(params.page) ? (params.page - 1) : 0) * paramsLimit + 1;
357 dest.end = (dest.pageCount === parseInt(params.page, 10)) ? 358 dest.end = (dest.pageCount === parseInt(params.page, 10)) ?
@@ -380,7 +381,7 @@ exports.handleSaleSortData = (origin, params, extra) => { @@ -380,7 +381,7 @@ exports.handleSaleSortData = (origin, params, extra) => {
380 leftContent.allSort.list.push(perAllSort); 381 leftContent.allSort.list.push(perAllSort);
381 382
382 383
383 - _.forEach(origin, function (value) { 384 + _.forEach(origin, function(value) {
384 385
385 let category = {}; 386 let category = {};
386 387
@@ -389,7 +390,7 @@ exports.handleSaleSortData = (origin, params, extra) => { @@ -389,7 +390,7 @@ exports.handleSaleSortData = (origin, params, extra) => {
389 category.childList = []; 390 category.childList = [];
390 category.href = handleFilterUrl(params, {sort: value.relation_parameter.sort}); 391 category.href = handleFilterUrl(params, {sort: value.relation_parameter.sort});
391 category.active = false; 392 category.active = false;
392 - _.forEach(value.sub, function (subValue) { 393 + _.forEach(value.sub, function(subValue) {
393 category.childList.push({ 394 category.childList.push({
394 name: subValue.category_name, 395 name: subValue.category_name,
395 num: subValue.node_count, 396 num: subValue.node_count,
@@ -457,7 +458,7 @@ exports.handleSaleFilterData = (origin, params) => { @@ -457,7 +458,7 @@ exports.handleSaleFilterData = (origin, params) => {
457 if (!_.isEmpty(origin.brand)) { 458 if (!_.isEmpty(origin.brand)) {
458 let count = 0; 459 let count = 0;
459 460
460 - _.forEach(origin.brand, function (value) { 461 + _.forEach(origin.brand, function(value) {
461 let brand = {}; 462 let brand = {};
462 463
463 brand.checked = (parseInt(params.brand, 10) === parseInt(value.id, 10)) ? true : false; 464 brand.checked = (parseInt(params.brand, 10) === parseInt(value.id, 10)) ? true : false;
@@ -483,13 +484,13 @@ exports.handleSaleFilterData = (origin, params) => { @@ -483,13 +484,13 @@ exports.handleSaleFilterData = (origin, params) => {
483 } 484 }
484 485
485 // 来排排序 486 // 来排排序
486 - dest.brand.brandsShow = _.sortBy(dest.brand.brandsShow, function (o) { 487 + dest.brand.brandsShow = _.sortBy(dest.brand.brandsShow, function(o) {
487 return o.index; 488 return o.index;
488 }); 489 });
489 490
490 // 处理 价格 筛选数据 491 // 处理 价格 筛选数据
491 if (!_.isEmpty(origin.priceRange)) { 492 if (!_.isEmpty(origin.priceRange)) {
492 - _.forEach(origin.priceRange, function (value, key) { 493 + _.forEach(origin.priceRange, function(value, key) {
493 let price = { 494 let price = {
494 checked: (params.price === key) ? true : false, 495 checked: (params.price === key) ? true : false,
495 href: handleFilterUrl(params, {price: key}), 496 href: handleFilterUrl(params, {price: key}),
@@ -573,9 +574,9 @@ exports.handleBannerData = (origin) => { @@ -573,9 +574,9 @@ exports.handleBannerData = (origin) => {
573 var dest = {}; 574 var dest = {};
574 575
575 dest.list = []; 576 dest.list = [];
576 - _.forEach(origin, function (value) { 577 + _.forEach(origin, function(value) {
577 if (value.template_name === 'focus') { 578 if (value.template_name === 'focus') {
578 - _.forEach(value.data, function (subValue) { 579 + _.forEach(value.data, function(subValue) {
579 let banner = {}; 580 let banner = {};
580 581
581 banner.bannerHeight = 450; 582 banner.bannerHeight = 450;