fix: 修复立减金按钮loading

This commit is contained in:
zhangds 2022-10-19 11:04:46 +08:00
parent b1fbde1599
commit b4eaba643f
3 changed files with 18 additions and 13 deletions

View File

@ -203,7 +203,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
plan_OPTIONS: [],
key_OPTIONS: [],
addProductBtnLoading: false,
addGoldBtnLoading: false,
product_title: "",
showScopePop: false,
scopePopType: "",
@ -380,8 +379,21 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
});
let scope_data = goods_arr.concat(lj_arr);
console.log("scope_data =>", scope_data);
scope_data = _.map(scope_data, (o) => {
o.checked = true;
if (o.type === 2) {
if (o.only.is_delete) {
o.checked = true;
} else {
o.checked = false;
}
} else {
if (o.is_delete) {
o.checked = true;
} else {
o.checked = false;
}
}
return o;
});
@ -867,10 +879,9 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
//
let param = {
reseller_id: direct_reseller_ids,
type: 1,
};
getProductInfoSelect(param).then((res) => {
setState({ addProductBtnLoading: false, addGoldBtnLoading: false });
setState({ addProductBtnLoading: false });
handelResponse(
res,
(req, msg) => {
@ -898,7 +909,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
);
setState({
product_title: "新增立减金",
addGoldBtnLoading: true,
scopePopType: "addKnockGold",
productData: null,
});
@ -907,7 +917,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
});
}
} catch (err) {
setState({ addProductBtnLoading: false, addGoldBtnLoading: false });
setState({ addProductBtnLoading: false });
}
};
@ -1381,7 +1391,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
<Button
type="primary"
style={{ marginLeft: "20px" }}
loading={state.addGoldBtnLoading}
onClick={() => {
addProduct("addKnockGold");
}}

View File

@ -138,7 +138,6 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
rank: [],
tableData: [],
addProductBtnLoading: false,
addGoldBtnLoading: false,
tableLoading: false,
direct_reseller_id: direct_reseller_id ? direct_reseller_id : 0,
showScopePop: false,
@ -418,7 +417,6 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
);
setState({
product_title: "新增立减金",
addGoldBtnLoading: true,
scopePopType: "addKnockGold",
});
}
@ -427,7 +425,7 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
reseller_id: direct_reseller_ids,
};
getProductInfoSelect(param).then((res) => {
setState({ addProductBtnLoading: false, addGoldBtnLoading: false });
setState({ addProductBtnLoading: false });
handelResponse(
res,
(req, msg) => {
@ -445,7 +443,7 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
);
});
} catch (err) {
setState({ addProductBtnLoading: false, addGoldBtnLoading: false });
setState({ addProductBtnLoading: false });
}
};
@ -679,7 +677,6 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
<Button
type="primary"
style={{ marginLeft: "20px" }}
loading={state.addGoldBtnLoading}
onClick={() => {
addProduct("addKnockGold");
}}

View File

@ -780,7 +780,6 @@ export default class acclist extends React.Component {
// { title: "已完结" },6
// { title: "已作废" },7
opearoEl(type, rowData) {
console.log("rowData =>", rowData);
switch (type) {
case 1:
if ([1, 8, 4, 5, 7].includes(rowData.status)) {