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
42285e1b
Commit
42285e1b
authored
Oct 27, 2020
by
GuanHua
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:修改评价好评率的计算
parent
54365ecc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
8 deletions
+4
-8
index.tsx
...es/lxMall/commodityDetail/components/Interested/index.tsx
+0
-1
index.tsx
...omponents/ProductDescription/components/Comment/index.tsx
+3
-1
index.tsx
src/pages/lxMall/components/TopBar/index.tsx
+1
-6
No files found.
src/pages/lxMall/commodityDetail/components/Interested/index.tsx
View file @
42285e1b
...
...
@@ -20,7 +20,6 @@ const Interested: React.FC<InterestedPropsType> = (props) => {
useEffect
(()
=>
{
if
(
shopInfo
&&
priceType
)
{
console
.
log
(
props
)
getchLatelyCommodity
()
}
},
[
shopInfo
,
priceType
])
...
...
src/pages/lxMall/commodityDetail/components/ProductDescription/components/Comment/index.tsx
View file @
42285e1b
...
...
@@ -25,6 +25,7 @@ const Comment: React.FC<CommentPropsType> = (props) => {
const
[
commentCountList
,
setCommentCountList
]
=
useState
<
any
>
([])
const
[
commentType
,
setCommentType
]
=
useState
<
string
>
(
'all'
)
const
[
spinLoading
,
setSpinLoading
]
=
useState
<
boolean
>
(
true
)
const
[
goodRate
,
setGoodRate
]
=
useState
<
number
>
(
0
)
useEffect
(()
=>
{
if
(
productIds
&&
!
isEmpty
(
productIds
))
{
...
...
@@ -127,6 +128,7 @@ const Comment: React.FC<CommentPropsType> = (props) => {
}]
setCommentCountList
(
result
)
setCount
(
allCount
)
setGoodRate
(
Math
.
floor
((
goodCount
/
allCount
)
*
100
))
}
const
handleFilterCommentType
=
(
type
:
string
)
=>
{
...
...
@@ -143,7 +145,7 @@ const Comment: React.FC<CommentPropsType> = (props) => {
<
div
className=
{
styles
.
comment_title
}
>
交易评价
</
div
>
<
div
className=
{
styles
.
favorable_comments
}
>
<
div
className=
{
styles
.
favorable_comments_title
}
>
好评率
</
div
>
<
span
>
{
summaryInfo
?.
avgStar
||
0
}
</
span
>
<
span
>
{
goodRate
}
</
span
>
<
i
>
%
</
i
>
</
div
>
<
div
className=
{
styles
.
common_count
}
>
...
...
src/pages/lxMall/components/TopBar/index.tsx
View file @
42285e1b
import
React
,
{
useEffect
}
from
'react'
import
React
from
'react'
import
{
EnvironmentOutlined
,
CaretDownOutlined
}
from
'@ant-design/icons'
import
{
inject
,
observer
}
from
'mobx-react'
import
cx
from
'classnames'
...
...
@@ -27,10 +27,6 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
const
{
langComponent
,
name
,
type
,
shopUrlParam
}
=
props
const
{
userInfo
}
=
props
.
UserStore
useEffect
(()
=>
{
},
[])
const
getHomePath
=
()
=>
{
switch
(
type
)
{
case
LAYOUT_TYPE
.
shop
:
...
...
@@ -80,7 +76,6 @@ const TopBar: React.FC<TopBarPropsType> = (props) => {
<
div
className=
{
styles
.
userInfo_card_column
}
>
<
div
className=
{
styles
.
credit_count
}
>
信用积分:
<
span
>
{
numFormat
(
1278
)
}
</
span
></
div
>
<
div
className=
{
styles
.
user_type
}
>
VIP会员
</
div
>
{
/* <div className={cx(styles.userInfo_card_level, styles.level3)} /> */
}
</
div
>
<
div
className=
{
styles
.
sign_out_btn
}
onClick=
{
handleSignOut
}
>
退出账号
</
div
>
</
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