fix(*): 全量 UI 审查与 undefined 展示异常修复
This commit is contained in:
@@ -16,7 +16,12 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
For commercial licensing, please contact support@quantumnous.com
|
||||
*/
|
||||
import { formatUserReference } from '../../helpers/safeDisplay';
|
||||
import {
|
||||
formatCurrency,
|
||||
formatNumber,
|
||||
formatUserReference,
|
||||
toFiniteNumber,
|
||||
} from '../../helpers/safeDisplay';
|
||||
|
||||
import { Trans } from 'react-i18next';
|
||||
import {
|
||||
@@ -269,7 +274,7 @@ const AdminInvoice = () => {
|
||||
displayName ||
|
||||
username || (
|
||||
<span className='text-gray-400'>
|
||||
{t('用户 #{{id}}', { id: record.user_id })}
|
||||
{formatUserReference(null, record.user_id)}
|
||||
</span>
|
||||
)
|
||||
);
|
||||
@@ -292,7 +297,7 @@ const AdminInvoice = () => {
|
||||
title: t('金额'),
|
||||
dataIndex: 'amount',
|
||||
width: 90,
|
||||
render: (v) => `¥${Number(v).toFixed(2)}`,
|
||||
render: (v) => formatCurrency(v),
|
||||
},
|
||||
{
|
||||
title: t('状态'),
|
||||
@@ -542,7 +547,7 @@ const AdminInvoice = () => {
|
||||
<div>
|
||||
<Text className='text-gray-400 text-sm'>{t('开票金额')}</Text>
|
||||
<div className='font-bold text-amber-600'>
|
||||
¥{Number(detailData.amount).toFixed(2)}
|
||||
{formatCurrency(detailData.amount)}
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@@ -600,9 +605,15 @@ const AdminInvoice = () => {
|
||||
i18nKey='关联充值记录 ({{length}} 笔,合计 ¥{{value}})'
|
||||
values={{
|
||||
length: detailData.topup_list.length,
|
||||
value: detailData.topup_list
|
||||
.reduce((s, item) => s + (item.money || 0), 0)
|
||||
.toFixed(2),
|
||||
value: formatNumber(
|
||||
detailData.topup_list.reduce(
|
||||
(sum, item) =>
|
||||
sum + (toFiniteNumber(item.money) ?? 0),
|
||||
0,
|
||||
),
|
||||
2,
|
||||
'0.00',
|
||||
),
|
||||
}}
|
||||
/>
|
||||
</Text>
|
||||
@@ -629,7 +640,7 @@ const AdminInvoice = () => {
|
||||
title: t('金额'),
|
||||
dataIndex: 'money',
|
||||
width: 90,
|
||||
render: (v) => `¥${Number(v).toFixed(2)}`,
|
||||
render: (v) => formatCurrency(v),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
Reference in New Issue
Block a user