fix: 优化优惠券防抖功能

This commit is contained in:
zhangds 2022-11-01 10:57:26 +08:00
parent e21637338f
commit 2ea28a13e7
1 changed files with 9 additions and 8 deletions

View File

@ -662,16 +662,16 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
console.log("编辑 大提交 =>", param); console.log("编辑 大提交 =>", param);
editCoupon(editData.id, param).then((res) => { editCoupon(editData.id, param).then((res) => {
setState({
isLoadingBtn: false,
});
handelResponse( handelResponse(
res, res,
(req, msg) => { (req, msg) => {
Notify.success(res.message); Notify.success(res.message);
setTimeout(() => { setTimeout(() => {
setState({
isLoadingBtn: false,
});
window.history.back(); window.history.back();
}, 2000); }, 500);
}, },
(err) => { (err) => {
Notify.error(err); Notify.error(err);
@ -721,16 +721,17 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
}); });
} }
addCoupon(param).then((res) => { addCoupon(param).then((res) => {
setState({
isLoadingBtn: false,
});
handelResponse( handelResponse(
res, res,
(req, msg) => { (req, msg) => {
Notify.success(res.message); Notify.success(res.message);
setTimeout(() => { setTimeout(() => {
setState({
isLoadingBtn: false,
});
window.history.back(); window.history.back();
}, 2000); }, 500);
}, },
(err) => { (err) => {
Notify.error(err); Notify.error(err);