Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
J
jinfa-platform
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
shenshaokai
jinfa-platform
Commits
afda6263
Commit
afda6263
authored
Jan 13, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改商品详情价格区间的判断
parent
be399149
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+3
-1
No files found.
src/pages/lxMall/commodityDetail/index.tsx
View file @
afda6263
...
...
@@ -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
]
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment