Toggle navigation
Toggle navigation
This project
Loading...
Sign in
fe
/
yohobuywap-node
·
Commits
Go to a project
GitLab
Go to group
Project
Activity
Files
Commits
Pipelines
0
Builds
0
Graphs
Milestones
Issues
0
Merge Requests
0
Members
Labels
Wiki
Forks
Network
Create a new issue
Download as
Email Patches
Plain Diff
Browse Files
Authored by
郝肖肖
8 years ago
Commit
8556f9fb27e893c574780ccc0947f03a5c58dc23
1 parent
d5882aef
筛选 折扣,价格区间 排序
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletions
utils/product-process.js
utils/product-process.js
View file @
8556f9f
...
...
@@ -52,6 +52,12 @@ const toArray = (obj) => {
const
_sortListByField
=
(
list
,
key
,
desc
)
=>
{
let
array
=
toArray
(
list
);
return
array
.
sort
(
function
(
a
,
b
)
{
a
=
a
.
_key
.
split
(
','
)[
0
]
*
1
;
b
=
b
.
_key
.
split
(
','
)[
0
]
*
1
;
return
desc
?
a
<
b
:
a
>
b
;
});
/*
array = array.sort((a, b) => {
let matchNumber = /([\d]+)/g;
...
...
@@ -70,7 +76,7 @@ const _sortListByField = (list, key, desc) => {
return numA < numB ? -1 : 1;
});
return
array
;
return array;
*/
};
/**
...
...
Please
register
or
login
to post a comment