From b4eaba643f3db804aa55355a465022cfb0cf9e35 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 19 Oct 2022 11:04:46 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=AB=8B=E5=87=8F?= =?UTF-8?q?=E9=87=91=E6=8C=89=E9=92=AEloading?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseCouponAddEdit/index.jsx | 23 ++++++++++++++------- src/components/UseExchangeAddEdit/index.jsx | 7 ++----- src/pages/plan/key/list.js | 1 - 3 files changed, 18 insertions(+), 13 deletions(-) diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index c7ac5ed4..49b6afe7 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -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) => {