Authored by 郝肖肖

筛选 折扣,价格区间 排序

... ... @@ -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;*/
};
/**
... ...