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
9bf90d17
Commit
9bf90d17
authored
Sep 21, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:无属性商品购买
parent
e3e0109f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
4 deletions
+11
-4
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+11
-4
No files found.
src/pages/lxMall/commodityDetail/index.tsx
View file @
9bf90d17
...
...
@@ -189,12 +189,12 @@ const CommodityDetail = (props) => {
}
}
},
[
selectAttrVal
])
},
[
selectAttrVal
,
commodityDetail
])
const
getCommodityPriceRange
=
()
=>
{
if
(
commodityDetail
?.
unitPriceAndPicList
)
{
for
(
let
item
of
commodityDetail
?.
unitPriceAndPicList
)
{
let
temp
=
item
.
attributeAndValueList
.
map
(
attrItem
=>
{
return
{
attrId
:
attrItem
.
customerAttribute
.
id
,
...
...
@@ -371,6 +371,11 @@ const CommodityDetail = (props) => {
}
}
const
judegeImageExist
=
(
list
,
pic
)
=>
{
return
list
.
every
(
item
=>
item
.
commodityPic
!==
pic
.
commodityPic
)
}
/**
* 初始化商品详情数据
* @param unitPriceAndPicList
...
...
@@ -394,9 +399,11 @@ const CommodityDetail = (props) => {
commodityPic
:
picItem
}
})
if
(
!
judegeImageExist
(
tempImgList
,
tempCommodityPic
))
{
tempImgList
=
[...
tempImgList
,
...
tempCommodityPic
]
}
}
for
(
let
attrListItem
of
item
.
attributeAndValueList
)
{
if
(
judgeAttrInList
(
tempAttrList
,
attrListItem
.
customerAttribute
.
id
))
{
let
tempAttrListIndex
=
0
...
...
@@ -427,7 +434,7 @@ const CommodityDetail = (props) => {
}
}
setCurrentPriceRange
(
unitPriceAndPicList
[
0
].
unitPrice
)
setStockCount
(
unitPriceAndPicList
[
0
].
stockCount
)
setStockCount
(
unitPriceAndPicList
[
0
].
stockCount
||
200
)
setCommodityImgList
(
tempImgList
)
setAttributeList
(
tempAttrList
)
}
...
...
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