修复 【兑换码批次】编辑立减金商品,加款弹窗中,“预估当前消耗余额、预估当前剩余余额、预估充值后总充值批次金额、预估充值后剩余余额”计算有误

This commit is contained in:
wangsongsole 2022-06-13 18:05:53 +08:00
parent 8f40b5fa3a
commit 7e0274ee66
1 changed files with 13 additions and 7 deletions

View File

@ -46,13 +46,17 @@ export default ({ data, onChangeMoney }) => {
<div className='dialog_p'>
<p>
预估当前消耗余额为
<span className='red'> {stateData?.recharge_amount} </span>
<span className='red'>
{' '}
{Number(stateData?.used_amount).toFixed(2)}{' '}
</span>
</p>
<p>
预估当前剩余余额为
<span className='green'>
{' '}
{stateData?.all_budget - stateData?.recharge_amount}{' '}
{stateData?.recharge_amount - stateData?.used_amount}{' '}
</span>
</p>
@ -104,8 +108,11 @@ export default ({ data, onChangeMoney }) => {
预估充值后总充值批次金额为
<span className='blue'>
{' '}
{(Number(stateData?.recharge_amount) | 0) +
(stateData?.addNew | 0)}{' '}
{(
stateData?.recharge_amount -
0 +
(stateData?.addNew ? stateData?.addNew - 0 : 0)
).toFixed(2)}{' '}
</span>
</p>
@ -113,9 +120,8 @@ export default ({ data, onChangeMoney }) => {
预估充值后剩余余额为
<span className='blue'>
{' '}
{stateData?.all_budget -
stateData?.recharge_amount -
(stateData?.addNew | 0)}{' '}
{Math.floor(stateData?.used_amount * 100) / 100 +
(stateData?.addNew ? stateData.addNew - 0 : 0)}{' '}
</span>
</p>