From 267c002e0145144e9afdaff430599b81374b7830 Mon Sep 17 00:00:00 2001 From: CPunisher <1343316114@qq.com> Date: Mon, 1 Mar 2021 16:35:15 +0800 Subject: [PATCH] change download count display --- src/components/app/PartDownload.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/app/PartDownload.js b/src/components/app/PartDownload.js index 916d02d..6aa4da1 100644 --- a/src/components/app/PartDownload.js +++ b/src/components/app/PartDownload.js @@ -3,6 +3,11 @@ import './App.css'; import PropTypes from 'prop-types'; import {isWeiXin} from "../../utils/navigatorUtils"; +function parseValue(value) { + if (value < 10000) return value; + return (value / 10000).toFixed(1) + "万"; +} + const WxMessage = () => { if (isWeiXin()) { return ( @@ -37,7 +42,7 @@ const PartDownload = ({ value, downloadCount, onSvgDownload, onImgDownload }) =>
下载二维码 — {value} - {downloadCount} + {parseValue(downloadCount)}