Authored by 郭成尧

排序效果处理

... ... @@ -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';
... ... @@ -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);
}
... ...