Authored by yyq

人气sort

... ... @@ -333,7 +333,7 @@ exports.handleOptsData = (params, total, extra) => {
};
// 用来标记是否是折扣专场,折扣专场只需要前三个排序参数
let count = (extra === 'discont') ? 3 : 4;
let count = (extra === 'discont') ? 4 : 5;
for (let i = 0; i < count; i++) {
let opt = {};
... ... @@ -358,6 +358,24 @@ exports.handleOptsData = (params, total, extra) => {
}
break;
case 1:
if (params.order !== 'h_v_desc' && params.order !== 'h_v_asc') {
opt.href = handleFilterUrl(params, {order: 'h_v_desc'}, {page: true});
opt.hasSortOrient = true;
} else {
opt.hasSortOrient = true;
opt.active = true;
if (params.order === 'h_v_desc') {
opt.href = handleFilterUrl(params, {order: 'h_v_asc'}, {page: true});
opt.desc = false;
} else {
opt.href = handleFilterUrl(params, {order: 'h_v_desc'}, {page: true});
opt.desc = true;
}
}
opt.name = '人气';
break;
case 2:
if (params.order !== 's_t_desc' && params.order !== 's_t_asc') {
opt.href = handleFilterUrl(params, {order: 's_t_desc'}, {page: true});
opt.hasSortOrient = true;
... ... @@ -375,7 +393,7 @@ exports.handleOptsData = (params, total, extra) => {
opt.name = '最新';
break;
case 2:
case 3:
if (params.order !== 's_p_desc' && params.order !== 's_p_asc') {
opt.href = handleFilterUrl(params, {order: 's_p_desc'}, {page: true});
opt.hasSortOrient = true;
... ... @@ -393,7 +411,7 @@ exports.handleOptsData = (params, total, extra) => {
opt.name = '价格';
break;
case 3:
case 4:
if (params.order !== 'p_d_desc' && params.order !== 'p_d_asc') {
opt.href = handleFilterUrl(params, {order: 'p_d_desc'}, {page: true});
opt.hasSortOrient = true;
... ...