diff --git a/src/dealer/withdraw/index.tsx b/src/dealer/withdraw/index.tsx index 9ef56f5..f6dddf3 100644 --- a/src/dealer/withdraw/index.tsx +++ b/src/dealer/withdraw/index.tsx @@ -2,6 +2,7 @@ import React, { useState, useRef, useEffect, useCallback } from 'react' import { View, Text } from '@tarojs/components' import { Cell, + Space, Button, Form, Input, @@ -38,6 +39,7 @@ const DealerWithdraw: React.FC = () => { // 获取可提现余额 const fetchBalance = useCallback(async () => { + console.log(dealerUser,'dealerUser...') try { setAvailableAmount(dealerUser?.money || '0.00') } catch (error) { @@ -211,8 +213,14 @@ const DealerWithdraw: React.FC = () => { formRef.current?.setFieldsValue({ amount: availableAmount.replace(',', '') }) } + // 格式化金额 + const formatMoney = (money?: string) => { + if (!money) return '0.00' + return parseFloat(money).toFixed(2) + } + const renderWithdrawForm = () => ( - + {/* 余额卡片 */} { }}> - + + {formatMoney(dealerUser?.money)} 可提现余额 - ¥{availableAmount} {