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

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