Showing
1 changed file
with
11 additions
and
3 deletions
@@ -1053,6 +1053,7 @@ exports.handleSortAds = (data) => { | @@ -1053,6 +1053,7 @@ exports.handleSortAds = (data) => { | ||
1053 | * @type {[type]} | 1053 | * @type {[type]} |
1054 | */ | 1054 | */ |
1055 | exports.handleWeekNew = (data, params) => { | 1055 | exports.handleWeekNew = (data, params) => { |
1056 | + let list = []; | ||
1056 | let dest = { | 1057 | let dest = { |
1057 | newSales: { | 1058 | newSales: { |
1058 | name: '', | 1059 | name: '', |
@@ -1061,13 +1062,20 @@ exports.handleWeekNew = (data, params) => { | @@ -1061,13 +1062,20 @@ exports.handleWeekNew = (data, params) => { | ||
1061 | }; | 1062 | }; |
1062 | 1063 | ||
1063 | _.forEach(data.recent, function(value, key) { | 1064 | _.forEach(data.recent, function(value, key) { |
1064 | - dest.newSales.list.push({ | ||
1065 | - name: key, | 1065 | + let t = _.split(key, '-'); |
1066 | + | ||
1067 | + list.push({ | ||
1068 | + name: `${t[1] || ''}月${t[2] || ''}日`, | ||
1066 | href: handleFilterUrl(params, {shelveTime: key}), | 1069 | href: handleFilterUrl(params, {shelveTime: key}), |
1067 | - active: key === params.shelveTime | 1070 | + active: key === params.shelveTime, |
1071 | + sort: +t.join('') | ||
1068 | }); | 1072 | }); |
1069 | }); | 1073 | }); |
1070 | 1074 | ||
1075 | + _.set(dest, 'newSales.list', _.sortBy(list, function(o) { | ||
1076 | + return -o.sort; | ||
1077 | + })); | ||
1078 | + | ||
1071 | return dest; | 1079 | return dest; |
1072 | }; | 1080 | }; |
1073 | 1081 |
-
Please register or login to post a comment