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
212f00dd
Commit
212f00dd
authored
Apr 13, 2021
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 商品详情评价接口修改传参
parent
aea99fa1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
8 deletions
+24
-8
index.tsx
...omponents/ProductDescription/components/Comment/index.tsx
+19
-5
index.tsx
...l/commodityDetail/components/ProductDescription/index.tsx
+5
-3
No files found.
src/pages/lxMall/commodityDetail/components/ProductDescription/components/Comment/index.tsx
View file @
212f00dd
...
...
@@ -4,6 +4,7 @@ import { Rate, Pagination, Spin } from 'antd'
import
ImageViewList
from
'../ImageViewList'
import
defaultAvatar
from
'@/assets/imgs/default_avatar.png'
import
{
PublicApi
}
from
'@/services/api'
import
{
LAYOUT_TYPE
}
from
'@/constants'
import
{
GetMemberCommentMallTradeHistoryPageResponseDetail
,
GetMemberCommentMallTradeSummaryResponse
}
from
'@/services/MemberApi'
import
isEmpty
from
'lodash/isEmpty'
import
NoData
from
'@/components/NoData'
...
...
@@ -13,11 +14,12 @@ import styles from './index.less'
interface
CommentPropsType
{
productIds
:
number
[],
setCount
:
Function
,
storeId
:
number
,
memberId
:
number
,
layoutType
:
LAYOUT_TYPE
}
const
Comment
:
React
.
FC
<
CommentPropsType
>
=
(
props
)
=>
{
const
{
productIds
,
setCount
,
storeId
}
=
props
const
{
productIds
,
setCount
,
memberId
,
layoutType
}
=
props
const
[
current
,
setCurrent
]
=
useState
<
number
>
(
1
)
const
[
pageSize
]
=
useState
<
number
>
(
10
)
const
[
totalCount
,
setTotalCount
]
=
useState
<
number
>
(
0
)
...
...
@@ -46,8 +48,7 @@ const Comment: React.FC<CommentPropsType> = (props) => {
const
param
:
any
=
{
current
,
pageSize
,
productIds
:
productIds
.
toString
(),
// '2339'
shopId
:
storeId
,
productIds
:
productIds
.
toString
(),
}
if
(
type
===
'good'
)
{
param
.
starLevel
=
3
...
...
@@ -56,6 +57,11 @@ const Comment: React.FC<CommentPropsType> = (props) => {
}
else
if
(
type
===
'bad'
)
{
param
.
starLevel
=
1
}
if
(
layoutType
===
LAYOUT_TYPE
.
channel
||
layoutType
===
LAYOUT_TYPE
.
ichannel
)
{
param
.
channelMemberId
=
memberId
}
setSpinLoading
(
true
)
PublicApi
.
getMemberCommentMallTradeHistoryPage
(
param
).
then
(
res
=>
{
...
...
@@ -70,7 +76,15 @@ const Comment: React.FC<CommentPropsType> = (props) => {
}
const
fetchCommentSummary
=
()
=>
{
PublicApi
.
getMemberCommentMallTradeSummary
({
productIds
:
productIds
.
toString
(),
shopId
:
String
(
storeId
)
}).
then
(
res
=>
{
const
param
:
any
=
{
productIds
:
productIds
.
toString
()
}
if
(
layoutType
===
LAYOUT_TYPE
.
channel
||
layoutType
===
LAYOUT_TYPE
.
ichannel
)
{
param
.
channelMemberId
=
memberId
}
PublicApi
.
getMemberCommentMallTradeSummary
(
param
).
then
(
res
=>
{
if
(
res
.
code
===
1000
)
{
setSummaryInfo
(
res
.
data
)
getCommentCountBySummary
(
res
.
data
.
rows
)
...
...
src/pages/lxMall/commodityDetail/components/ProductDescription/index.tsx
View file @
212f00dd
...
...
@@ -12,7 +12,7 @@ import Comment from './components/Comment'
import
Introduction
from
'./components/Introduction'
import
TradeRecord
from
'./components/TradeRecord'
import
Recommand
from
'./components/Recommand'
import
{
COMMODITY_TYPE
}
from
'@/constants'
import
{
COMMODITY_TYPE
,
LAYOUT_TYPE
}
from
'@/constants'
import
{
GetSearchShopStoreGetCommodityDetailResponse
}
from
'@/services/SearchApi'
import
cx
from
'classnames'
import
styles
from
'./index.less'
...
...
@@ -23,10 +23,12 @@ interface ProductDescriptionPropsType {
commodityDetail
:
GetSearchShopStoreGetCommodityDetailResponse
,
dataList
:
any
,
storeId
:
number
,
memberId
:
number
,
layoutType
:
LAYOUT_TYPE
,
}
const
ProductDescription
:
React
.
FC
<
ProductDescriptionPropsType
>
=
(
props
)
=>
{
const
{
commodityDetail
,
dataList
,
storeId
}
=
props
const
{
commodityDetail
,
dataList
,
storeId
,
memberId
,
layoutType
}
=
props
const
[
currentAnchor
,
setCurrentAnchor
]
=
useState
<
string
>
(
"#introduction"
)
const
[
productIds
,
setProductIds
]
=
useState
<
number
[]
>
([])
const
[
tradeRecordCount
,
setTradeRecordCount
]
=
useState
<
number
>
(
0
)
...
...
@@ -79,7 +81,7 @@ const ProductDescription: React.FC<ProductDescriptionPropsType> = (props) => {
</
Anchor
>
<
Introduction
commodityDetail=
{
commodityDetail
}
/>
<
TradeRecord
productIds=
{
productIds
}
storeId=
{
storeId
}
setCount=
{
(
count
)
=>
setTradeRecordCount
(
count
)
}
/>
<
Comment
productIds=
{
productIds
}
storeId=
{
storeId
}
setCount=
{
(
count
)
=>
setCommentCount
(
count
)
}
/>
<
Comment
productIds=
{
productIds
}
memberId=
{
memberId
}
layoutType=
{
layoutType
}
setCount=
{
(
count
)
=>
setCommentCount
(
count
)
}
/>
<
Recommand
dataList=
{
dataList
}
{
...
props
}
/>
</
div
>
)
...
...
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