修复 兑换码管理】编辑页面,立减金加款对话框中,输入加款金额,点击取消按钮,在充值批次金额中也会展示加款后的金额

This commit is contained in:
wangsongsole 2022-06-15 17:23:31 +08:00
parent 87ba41c2ae
commit 3905dfe6fa
1 changed files with 3 additions and 4 deletions

View File

@ -8,6 +8,7 @@ import { Button, Notify } from 'zent'
import { addFund, handelResponse } from '@/assets/api' import { addFund, handelResponse } from '@/assets/api'
export default ({ data, onChangeMoney }) => { export default ({ data, onChangeMoney }) => {
const [stateData, setStateData] = useState({ addNew: '' }) const [stateData, setStateData] = useState({ addNew: '' })
const [isCount, setIsCount] = useState(false)
const ref = useRef() const ref = useRef()
useEffect(() => { useEffect(() => {
setStateData({ ...data }) setStateData({ ...data })
@ -25,6 +26,7 @@ export default ({ data, onChangeMoney }) => {
res, res,
(req, msg) => { (req, msg) => {
Notify.success('加款成功') Notify.success('加款成功')
setIsCount(true)
setTimeout(() => { setTimeout(() => {
onChangeMoney(false, Number(stateData.addNew)) onChangeMoney(false, Number(stateData.addNew))
}, 1000) }, 1000)
@ -132,10 +134,7 @@ export default ({ data, onChangeMoney }) => {
<p className='dflexajce'> <p className='dflexajce'>
<Button <Button
onClick={() => { onClick={() => {
onChangeMoney( onChangeMoney(false, isCount ? Number(stateData.addNew) : 0)
false,
stateData.addNew ? Number(stateData.addNew) : 0
)
}}> }}>
取消 取消
</Button> </Button>