Commit afda6263 authored by GuanHua's avatar GuanHua

fix: 修改商品详情价格区间的判断

parent be399149
......@@ -917,7 +917,9 @@ const CommodityDetail = (props) => {
*/
const getMaxCountRange = () => {
const priceList = [...commodityPriceInfo]
const result = priceList.sort((a, b) => Math.abs(Number(b.max) - Number(buyCount)) < Math.abs(Number(a.min) - Number(buyCount)) ? 1 : -1 )
const result = priceList.sort((a, b) => (Number(b.max) < Number(buyCount) && Number(buyCount) < Number(a.min) ? 1 : -1))
// const result = priceList.sort((a, b) => Math.abs(Number(b.max) - Number(buyCount)) < Math.abs(Number(a.min) - Number(buyCount)) ? 1 : -1 )
return result[0]
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment