compare: function(key) {
return function(value1, value2) {
var val1 = value1.key;
var val2 = value2.key;
return val1 - val2;
}
},
调用 res.sort(that.compare('totalFee')) //排序从小到大
取最小值 var price = Math.min.apply(Math, res.map(function(o) { //取最小值 return o.totalFee }))
取最大值
let maxNumber = Math.max.apply(Math, this.data.branchAddressList.map(function(o) {
return o.sortIndex
}))