Commit 42285e1b authored by GuanHua's avatar GuanHua

feat:修改评价好评率的计算

parent 54365ecc
......@@ -20,7 +20,6 @@ const Interested: React.FC<InterestedPropsType> = (props) => {
useEffect(() => {
if (shopInfo && priceType) {
console.log(props)
getchLatelyCommodity()
}
}, [shopInfo, priceType])
......
......@@ -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}>
......
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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment