Showing
1 changed file
with
8 additions
and
4 deletions
@@ -21,10 +21,6 @@ const handleBrandList = origin => { | @@ -21,10 +21,6 @@ const handleBrandList = origin => { | ||
21 | indexList: [] | 21 | indexList: [] |
22 | }; | 22 | }; |
23 | 23 | ||
24 | - _.sortBy(origin, (o) => { | ||
25 | - return o.key; | ||
26 | - }); | ||
27 | - | ||
28 | _.forEach(origin, (value, key) => { | 24 | _.forEach(origin, (value, key) => { |
29 | let brands = []; | 25 | let brands = []; |
30 | 26 | ||
@@ -41,10 +37,18 @@ const handleBrandList = origin => { | @@ -41,10 +37,18 @@ const handleBrandList = origin => { | ||
41 | brands: brands | 37 | brands: brands |
42 | }); | 38 | }); |
43 | 39 | ||
40 | + _.sortBy(dest.brandList, o => { | ||
41 | + return o.index; | ||
42 | + }); | ||
43 | + | ||
44 | dest.indexList.push({ | 44 | dest.indexList.push({ |
45 | index: key, | 45 | index: key, |
46 | name: key === '0~9' ? '0' : key | 46 | name: key === '0~9' ? '0' : key |
47 | }); | 47 | }); |
48 | + | ||
49 | + _.sortBy(dest.indexList, o => { | ||
50 | + return o.index; | ||
51 | + }); | ||
48 | }); | 52 | }); |
49 | 53 | ||
50 | return dest; | 54 | return dest; |
-
Please register or login to post a comment