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
ee826c92
Commit
ee826c92
authored
Dec 21, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 修改商品详情->交易记录数据显示异常的问题
parent
1600b538
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
21 deletions
+27
-21
index.tsx
...nents/ProductDescription/components/TradeRecord/index.tsx
+27
-21
No files found.
src/pages/lxMall/commodityDetail/components/ProductDescription/components/TradeRecord/index.tsx
View file @
ee826c92
...
...
@@ -22,44 +22,50 @@ const TradeRecord: React.FC<TradeRecordPropsType> = (props) => {
if
(
productIds
&&
!
isEmpty
(
productIds
))
{
fetchRecordsList
()
}
},
[
productIds
])
useEffect
(()
=>
{
if
(
productIds
&&
!
isEmpty
(
productIds
))
{
fetchRecordsList
()
}
},
[
current
])
},
[
productIds
,
current
])
const
fetchRecordsList
=
()
=>
{
let
param
=
{
const
param
:
any
=
{
current
,
pageSize
,
productIds
:
productIds
.
toString
()
// '2339'
}
//@ts-ignore
PublicApi
.
getOrderTransactionRecordsList
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setTotalCount
(
res
.
data
.
totalCount
)
setRecordList
(
res
.
data
.
data
)
initData
(
res
.
data
.
data
)
setCount
(
res
.
data
.
totalCount
)
}
})
}
const
initData
=
(
data
)
=>
{
if
(
!
data
)
{
return
}
const
result
=
data
.
map
((
item
,
index
)
=>
{
item
.
id
=
current
*
10
+
index
return
item
})
console
.
log
(
result
,
"result"
)
setRecordList
(
result
)
}
const
columns
=
[
{
title
:
'买家'
,
width
:
'33%'
,
render
:
(
_
,
record
:
any
)
=>
{
return
(
<
div
className=
{
styles
.
columns_item
}
>
<
div
className=
{
styles
.
columns_item_name
}
>
{
record
.
memberName
}
</
div
>
{
record
.
levelTag
&&
<
div
className=
{
styles
.
columns_item_member
}
>
{
record
.
levelTag
}
</
div
>
}
</
div
>
)
}
// eslint-disable-next-line react/display-name
render
:
(
_
,
record
:
any
)
=>
(
<
div
className=
{
styles
.
columns_item
}
>
<
div
className=
{
styles
.
columns_item_name
}
>
{
record
.
memberName
}
</
div
>
{
record
.
levelTag
&&
<
div
className=
{
styles
.
columns_item_member
}
>
{
record
.
levelTag
}
</
div
>
}
</
div
>
)
},
{
title
:
'成交数量'
,
...
...
@@ -85,7 +91,7 @@ const TradeRecord: React.FC<TradeRecordPropsType> = (props) => {
</
div
>
<
div
className=
{
styles
.
trade_record_container
}
>
<
Table
rowKey=
"
orderI
d"
rowKey=
"
i
d"
columns=
{
columns
}
dataSource=
{
recordList
}
locale=
{
{
emptyText
:
'暂无交易记录'
}
}
...
...
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