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
linweijiong
jinfa-platform
Commits
dad373bf
Commit
dad373bf
authored
Sep 22, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:去除商品详情重复的图片
parent
9984e307
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
index.tsx
src/pages/lxMall/commodityDetail/index.tsx
+15
-8
index.less
src/pages/lxMall/components/ShopHeader/index.less
+2
-2
No files found.
src/pages/lxMall/commodityDetail/index.tsx
View file @
dad373bf
...
...
@@ -371,9 +371,19 @@ const CommodityDetail = (props) => {
}
}
const
judegeImageExist
=
(
list
,
pic
)
=>
{
return
list
.
every
(
item
=>
item
.
commodityPic
!==
pic
.
commodityPic
)
/**
* 去除重复的图片
* @param list
* @param addList
*/
const
deleteRepeatImg
=
(
list
,
addList
)
=>
{
let
result
=
[...
list
]
for
(
let
addItem
of
addList
)
{
if
(
list
.
every
(
item
=>
item
.
commodityPic
!==
addItem
.
commodityPic
))
{
result
.
push
(
addItem
)
}
}
return
result
}
/**
...
...
@@ -399,12 +409,9 @@ const CommodityDetail = (props) => {
commodityPic
:
picItem
}
})
// if (judegeImageExist(tempImgList, tempCommodityPic)) {
// }
tempImgList
=
[...
tempImgList
,
...
tempCommodityPic
]
tempImgList
=
deleteRepeatImg
(
tempImgList
,
tempCommodityPic
)
}
console
.
log
(
tempImgList
,
""
)
for
(
let
attrListItem
of
item
.
attributeAndValueList
)
{
if
(
judgeAttrInList
(
tempAttrList
,
attrListItem
.
customerAttribute
.
id
))
{
let
tempAttrListIndex
=
0
...
...
src/pages/lxMall/components/ShopHeader/index.less
View file @
dad373bf
...
...
@@ -68,10 +68,10 @@
margin-top: 4px;
&_item {
flex: 1;
//
flex: 1;
display: flex;
align-items: center;
margin-right:
8
px;
margin-right:
16
px;
&>span {
font-size: 14px;
...
...
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