...
|
...
|
@@ -2,7 +2,7 @@ |
|
|
* @Author: Targaryen
|
|
|
* @Date: 2016-06-02 15:50:47
|
|
|
* @Last Modified by: Targaryen
|
|
|
* @Last Modified time: 2016-06-08 16:51:55
|
|
|
* @Last Modified time: 2016-06-08 17:04:40
|
|
|
*/
|
|
|
|
|
|
'use strict';
|
...
|
...
|
@@ -83,8 +83,8 @@ const handleSalebreakingYardsSortData = (origin, params) => { |
|
|
|
|
|
// 判断是否在这组数据里面
|
|
|
if (!_.isEmpty(_.find(value.sort_id.split(','), o => {
|
|
|
return o === sortParam;
|
|
|
}))) {
|
|
|
return o === sortParam;
|
|
|
}))) {
|
|
|
|
|
|
// 如果在某组数据里面,组合数据退出循环
|
|
|
_.forEach(value.sub, function(subValue) {
|
...
|
...
|
@@ -241,6 +241,8 @@ exports.handleSaleOptsData = (params, total) => { |
|
|
|
|
|
dest.sortType = [];
|
|
|
|
|
|
|
|
|
|
|
|
for (let i = 0; i < 4; i++) {
|
|
|
let opt = {};
|
|
|
|
...
|
...
|
@@ -252,24 +254,36 @@ exports.handleSaleOptsData = (params, total) => { |
|
|
case 1:
|
|
|
if (params.order === 's_p_desc') {
|
|
|
opt.href = handleFilterUrl(params, { order: 's_p_asc' });
|
|
|
opt.hasSortOrient = false;
|
|
|
opt.active = false;
|
|
|
} else {
|
|
|
opt.href = handleFilterUrl(params, { order: 's_p_desc' });
|
|
|
opt.hasSortOrient = true;
|
|
|
opt.active = true;
|
|
|
}
|
|
|
opt.name = '价格';
|
|
|
break;
|
|
|
case 2:
|
|
|
if (params.order === 'p_d_desc') {
|
|
|
opt.href = handleFilterUrl(params, { order: 'p_d_asc' });
|
|
|
opt.hasSortOrient = false;
|
|
|
opt.active = false;
|
|
|
} else {
|
|
|
opt.href = handleFilterUrl(params, { order: 'p_d_desc' });
|
|
|
opt.hasSortOrient = true;
|
|
|
opt.active = true;
|
|
|
}
|
|
|
opt.name = '折扣';
|
|
|
break;
|
|
|
case 3:
|
|
|
if (params.order === 's_n_desc') {
|
|
|
opt.href = handleFilterUrl(params, { order: 's_n_asc' });
|
|
|
opt.hasSortOrient = false;
|
|
|
opt.active = false;
|
|
|
} else {
|
|
|
opt.href = handleFilterUrl(params, { order: 's_n_desc' });
|
|
|
opt.hasSortOrient = true;
|
|
|
opt.active = true;
|
|
|
}
|
|
|
opt.name = '销量';
|
|
|
break;
|
...
|
...
|
@@ -277,10 +291,6 @@ exports.handleSaleOptsData = (params, total) => { |
|
|
break;
|
|
|
}
|
|
|
|
|
|
opt.hasSortOrient = {};
|
|
|
opt.hasSortOrient.active = {};
|
|
|
opt.hasSortOrient.active.desc = {};
|
|
|
|
|
|
dest.sortType.push(opt);
|
|
|
}
|
|
|
|
...
|
...
|
|