fix: 金额显示问题
parent
355a2056f4
commit
21f2472561
|
@ -12,6 +12,7 @@ import {
|
|||
transferDemoWithdraw,
|
||||
} from '#/api/pay/demo/withdraw';
|
||||
import { $t } from '#/locales';
|
||||
import { floatToFixed2 } from '#/utils';
|
||||
|
||||
import { useGridColumns } from './data';
|
||||
import Form from './modules/form.vue';
|
||||
|
@ -109,7 +110,7 @@ const [Grid, gridApi] = useVbenVxeGrid({
|
|||
<Tag v-else-if="row.type === 3">钱包余额</Tag>
|
||||
</template>
|
||||
<template #price="{ row }">
|
||||
<span>¥{{ (row.price / 100.0).toFixed(2) }}</span>
|
||||
<span>¥{{ floatToFixed2(row.price) }}</span>
|
||||
</template>
|
||||
<template #status="{ row }">
|
||||
<Tag v-if="row.status === 0 && !row.payTransferId" type="warning">
|
||||
|
|
|
@ -10,7 +10,7 @@ import { Descriptions, Divider, Tag } from 'ant-design-vue';
|
|||
|
||||
import { getOrder } from '#/api/pay/order';
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE } from '#/utils';
|
||||
import { DICT_TYPE, floatToFixed2 } from '#/utils';
|
||||
|
||||
const detailData = ref<PayOrderApi.Order>();
|
||||
|
||||
|
@ -63,16 +63,16 @@ const [Modal, modalApi] = useVbenModal({
|
|||
</Descriptions.Item>
|
||||
<Descriptions.Item label="支付金额">
|
||||
<Tag color="green" size="small">
|
||||
¥{{ (detailData?.price || 0 / 100.0).toFixed(2) }}
|
||||
¥{{ floatToFixed2(detailData?.price) }}
|
||||
</Tag>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="手续费">
|
||||
<Tag color="orange" size="small">
|
||||
¥{{ (detailData?.channelFeePrice || 0 / 100.0).toFixed(2) }}
|
||||
¥{{ floatToFixed2(detailData?.channelFeePrice) }}
|
||||
</Tag>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="手续费比例">
|
||||
{{ (detailData?.channelFeeRate || 0 / 100.0).toFixed(2) }}%
|
||||
{{ floatToFixed2(detailData?.channelFeeRate) }}%
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="支付时间">
|
||||
{{ formatDateTime(detailData?.successTime) }}
|
||||
|
@ -115,7 +115,7 @@ const [Modal, modalApi] = useVbenModal({
|
|||
</Descriptions.Item>
|
||||
<Descriptions.Item label="退款金额" :span="2">
|
||||
<Tag size="small" color="red">
|
||||
¥{{ (detailData?.refundPrice || 0 / 100.0).toFixed(2) }}
|
||||
¥{{ floatToFixed2(detailData?.refundPrice) }}
|
||||
</Tag>
|
||||
</Descriptions.Item>
|
||||
<Descriptions.Item label="通知 URL">
|
||||
|
|
|
@ -9,7 +9,12 @@ import { formatDateTime } from '@vben/utils';
|
|||
import { Tag } from 'ant-design-vue';
|
||||
|
||||
import { DictTag } from '#/components/dict-tag';
|
||||
import { DICT_TYPE, getDictOptions, getRangePickerDefaultProps } from '#/utils';
|
||||
import {
|
||||
DICT_TYPE,
|
||||
floatToFixed2,
|
||||
getDictOptions,
|
||||
getRangePickerDefaultProps,
|
||||
} from '#/utils';
|
||||
|
||||
/** 列表的搜索表单 */
|
||||
export function useGridFormSchema(): VbenFormSchema[] {
|
||||
|
@ -120,7 +125,7 @@ export function useGridColumns(): VxeTableGridOptions['columns'] {
|
|||
{
|
||||
field: 'price',
|
||||
title: '转账金额',
|
||||
formatter: ({ cellValue }) => `¥${(cellValue / 100).toFixed(2)}`,
|
||||
formatter: 'formatAmount2',
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
|
@ -217,7 +222,7 @@ export function useDetailSchema(): DescriptionItemSchema[] {
|
|||
content: (data) => {
|
||||
return h(Tag, {
|
||||
color: 'blue',
|
||||
content: `¥${(data?.price / 100).toFixed(2)}`,
|
||||
content: `¥${floatToFixed2(data?.price)}`,
|
||||
});
|
||||
},
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue