import { formatNumber } from 'utils'
import { Button } from 'components'
import { useAppSelector } from 'hooks'
const CartInfo = props => {
//? Porps
const { handleRoute, cart } = props
//? Store
const { totalItems, totalPrice, totalDiscount } = useAppSelector(state => state.cart)
//? Render(s)
return (
{/* total cart price */}
商品价格({formatNumber(totalItems)}件商品)
{formatNumber(totalPrice)}
¥
{/* total cart items */}
总计购物车
{formatNumber(totalPrice - totalDiscount)}
¥
运费是根据您的货件的地址、交货时间、重量和体积计算的
{/* total cart profit */}
您从购买中省去的金额
({((totalDiscount / totalPrice) * 100).toFixed(1)}%)
{formatNumber(totalDiscount)}
¥
{cart && (
)}
)
}
export default CartInfo