Authored by yyq

list new time sort

... ... @@ -1053,6 +1053,7 @@ exports.handleSortAds = (data) => {
* @type {[type]}
*/
exports.handleWeekNew = (data, params) => {
let list = [];
let dest = {
newSales: {
name: '',
... ... @@ -1061,13 +1062,20 @@ exports.handleWeekNew = (data, params) => {
};
_.forEach(data.recent, function(value, key) {
dest.newSales.list.push({
name: key,
let t = _.split(key, '-');
list.push({
name: `${t[1] || ''}${t[2] || ''}日`,
href: handleFilterUrl(params, {shelveTime: key}),
active: key === params.shelveTime
active: key === params.shelveTime,
sort: +t.join('')
});
});
_.set(dest, 'newSales.list', _.sortBy(list, function(o) {
return -o.sort;
}));
return dest;
};
... ...