fix: 修复立减金按钮loading
This commit is contained in:
parent
b1fbde1599
commit
b4eaba643f
|
@ -203,7 +203,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
plan_OPTIONS: [],
|
plan_OPTIONS: [],
|
||||||
key_OPTIONS: [],
|
key_OPTIONS: [],
|
||||||
addProductBtnLoading: false,
|
addProductBtnLoading: false,
|
||||||
addGoldBtnLoading: false,
|
|
||||||
product_title: "",
|
product_title: "",
|
||||||
showScopePop: false,
|
showScopePop: false,
|
||||||
scopePopType: "",
|
scopePopType: "",
|
||||||
|
@ -380,8 +379,21 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
});
|
});
|
||||||
|
|
||||||
let scope_data = goods_arr.concat(lj_arr);
|
let scope_data = goods_arr.concat(lj_arr);
|
||||||
|
console.log("scope_data =>", scope_data);
|
||||||
scope_data = _.map(scope_data, (o) => {
|
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;
|
return o;
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -867,10 +879,9 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
// 第四步:获取商品数据
|
// 第四步:获取商品数据
|
||||||
let param = {
|
let param = {
|
||||||
reseller_id: direct_reseller_ids,
|
reseller_id: direct_reseller_ids,
|
||||||
type: 1,
|
|
||||||
};
|
};
|
||||||
getProductInfoSelect(param).then((res) => {
|
getProductInfoSelect(param).then((res) => {
|
||||||
setState({ addProductBtnLoading: false, addGoldBtnLoading: false });
|
setState({ addProductBtnLoading: false });
|
||||||
handelResponse(
|
handelResponse(
|
||||||
res,
|
res,
|
||||||
(req, msg) => {
|
(req, msg) => {
|
||||||
|
@ -898,7 +909,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
);
|
);
|
||||||
setState({
|
setState({
|
||||||
product_title: "新增立减金",
|
product_title: "新增立减金",
|
||||||
addGoldBtnLoading: true,
|
|
||||||
scopePopType: "addKnockGold",
|
scopePopType: "addKnockGold",
|
||||||
productData: null,
|
productData: null,
|
||||||
});
|
});
|
||||||
|
@ -907,7 +917,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setState({ addProductBtnLoading: false, addGoldBtnLoading: false });
|
setState({ addProductBtnLoading: false });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1381,7 +1391,6 @@ const UseCouponAddEdit = forwardRef((props, ref) => {
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
style={{ marginLeft: "20px" }}
|
style={{ marginLeft: "20px" }}
|
||||||
loading={state.addGoldBtnLoading}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
addProduct("addKnockGold");
|
addProduct("addKnockGold");
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -138,7 +138,6 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
|
||||||
rank: [],
|
rank: [],
|
||||||
tableData: [],
|
tableData: [],
|
||||||
addProductBtnLoading: false,
|
addProductBtnLoading: false,
|
||||||
addGoldBtnLoading: false,
|
|
||||||
tableLoading: false,
|
tableLoading: false,
|
||||||
direct_reseller_id: direct_reseller_id ? direct_reseller_id : 0,
|
direct_reseller_id: direct_reseller_id ? direct_reseller_id : 0,
|
||||||
showScopePop: false,
|
showScopePop: false,
|
||||||
|
@ -418,7 +417,6 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
|
||||||
);
|
);
|
||||||
setState({
|
setState({
|
||||||
product_title: "新增立减金",
|
product_title: "新增立减金",
|
||||||
addGoldBtnLoading: true,
|
|
||||||
scopePopType: "addKnockGold",
|
scopePopType: "addKnockGold",
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -427,7 +425,7 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
|
||||||
reseller_id: direct_reseller_ids,
|
reseller_id: direct_reseller_ids,
|
||||||
};
|
};
|
||||||
getProductInfoSelect(param).then((res) => {
|
getProductInfoSelect(param).then((res) => {
|
||||||
setState({ addProductBtnLoading: false, addGoldBtnLoading: false });
|
setState({ addProductBtnLoading: false });
|
||||||
handelResponse(
|
handelResponse(
|
||||||
res,
|
res,
|
||||||
(req, msg) => {
|
(req, msg) => {
|
||||||
|
@ -445,7 +443,7 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
setState({ addProductBtnLoading: false, addGoldBtnLoading: false });
|
setState({ addProductBtnLoading: false });
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -679,7 +677,6 @@ const UseExchangeAddEdit = forwardRef((props, ref) => {
|
||||||
<Button
|
<Button
|
||||||
type="primary"
|
type="primary"
|
||||||
style={{ marginLeft: "20px" }}
|
style={{ marginLeft: "20px" }}
|
||||||
loading={state.addGoldBtnLoading}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
addProduct("addKnockGold");
|
addProduct("addKnockGold");
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -780,7 +780,6 @@ export default class acclist extends React.Component {
|
||||||
// { title: "已完结" },6
|
// { title: "已完结" },6
|
||||||
// { title: "已作废" },7
|
// { title: "已作废" },7
|
||||||
opearoEl(type, rowData) {
|
opearoEl(type, rowData) {
|
||||||
console.log("rowData =>", rowData);
|
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case 1:
|
case 1:
|
||||||
if ([1, 8, 4, 5, 7].includes(rowData.status)) {
|
if ([1, 8, 4, 5, 7].includes(rowData.status)) {
|
||||||
|
|
Loading…
Reference in New Issue