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
陈智峰
jinfa-platform
Commits
a3f2cc2d
Commit
a3f2cc2d
authored
Mar 30, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 商品属性选择问题
parent
2b5dc9d5
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
5 deletions
+4
-5
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+4
-5
No files found.
src/pages/lxMall/commodityDetail/index.tsx
View file @
a3f2cc2d
...
...
@@ -348,7 +348,6 @@ const CommodityDetail = (props) => {
setSelectCommodityUnitPriceId
(
null
)
}
}
},
[
selectAttrVal
,
commodityDetail
])
/**
...
...
@@ -874,15 +873,15 @@ const CommodityDetail = (props) => {
return
list
.
some
(
item
=>
item
.
id
===
attrId
)
}
const
judgeSelectAttrInList
=
(
list
,
attr
Id
,
key
)
=>
{
return
list
.
some
(
item
=>
item
[
key
]
===
attr
Id
)
const
judgeSelectAttrInList
=
(
list
,
attr
ValId
,
attrId
)
=>
{
return
list
.
some
(
item
=>
item
[
"attrId"
]
===
attrId
&&
item
[
"attrValId"
]
===
attrVal
Id
)
}
const
handleSelectAttrVal
=
(
attrId
:
number
,
attrValId
:
number
)
=>
{
// if (!judgeHasAttr(attrId, attrValId)) {
// return
// }
if
(
judgeSelectAttrInList
(
selectAttrVal
,
attrId
,
'attrId'
))
{
if
(
selectAttrVal
.
some
(
item
=>
item
[
"attrId"
]
===
attrId
))
{
const
result
=
[]
for
(
const
item
of
selectAttrVal
)
{
if
(
item
.
attrId
===
attrId
&&
item
.
attrValId
!==
attrValId
)
{
...
...
@@ -1062,7 +1061,7 @@ const CommodityDetail = (props) => {
<
div
key=
{
`product_info_line_list_item_${childItem.id}_${index}`
}
className=
{
cx
(
styles
.
product_info_line_list_item
,
judgeSelectAttrInList
(
selectAttrVal
,
childItem
.
id
,
'attrValId'
)
?
styles
.
active
:
''
,
judgeSelectAttrInList
(
selectAttrVal
,
childItem
.
id
,
item
.
customerAttribute
.
id
)
?
styles
.
active
:
''
,
)
}
onClick=
{
()
=>
handleSelectAttrVal
(
item
.
customerAttribute
.
id
,
childItem
.
id
)
}
>
{
...
...
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