From 8fb9a7213d29e7f58201b60402738fd26fd8def3 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Mon, 19 Feb 2024 17:07:16 +0800 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20=E9=87=8D?= =?UTF-8?q?=E6=9E=84=E4=BA=AC=E4=B8=9CE=E5=8D=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseProductPop/index.jsx | 51 ++++++-------------------- 1 file changed, 12 insertions(+), 39 deletions(-) diff --git a/src/components/UseProductPop/index.jsx b/src/components/UseProductPop/index.jsx index bb9e2a5d..7cd392ed 100644 --- a/src/components/UseProductPop/index.jsx +++ b/src/components/UseProductPop/index.jsx @@ -88,9 +88,7 @@ const UseProductPop = forwardRef((props, ref) => { account_type: "", map_product_name: "", end_time: "", - card_show: 2, - messageVerify: 2, - channelVerIfy: undefined + card_show: 2 }) useEffect(() => { @@ -139,9 +137,11 @@ const UseProductPop = forwardRef((props, ref) => { setState({ loading: true }) return new Promise((resolve, reject) => { if (directResellerId) { + /* 京东E卡 */ + const isECard = model.product_type === 3 let param = { reseller_id: directResellerId, - type: model.product_type + type: isECard ? 1 : model.product_type } getProductInfoSelect(param).then((res) => { handelResponse( @@ -177,8 +177,6 @@ const UseProductPop = forwardRef((props, ref) => { if (productData) { setModel({ goods_id: productData.goods_id, - messageVerify: productData.messageVerify, - channelVerIfy: productData.channelVerIfy, cost_price: productData.cost_price, weight: String(productData.weight), quantity: productData.quantity, @@ -188,7 +186,7 @@ const UseProductPop = forwardRef((props, ref) => { product_id: productData.product_id, account_type: productData.account_type, map_product_name: productData.map_product_name, - product_type: model.product_type, + product_type: productData.isECard ? 1 : model.product_type, card_show: Number(productData.card_show), code_batch_id: productData.code_batch_id, end_time: productData.end_time, @@ -245,9 +243,7 @@ const UseProductPop = forwardRef((props, ref) => { account_type: "", map_product_name: "", end_time: "", - card_show: 2, - messageVerify: 2, - channelVerIfy: undefined + card_show: 2 }) setTimeout(() => { setState({ isUpdatePic: !state.isUpdatePic }) @@ -255,9 +251,12 @@ const UseProductPop = forwardRef((props, ref) => { } // 获取表单数据 const getFormModel = () => { + /* 京东E卡 */ + const isECard = model.product_type === 3 return { product_id: model.product_id, - product_type: model.product_type, + product_type: isECard ? 1 : model.product_type, + isECard, product_name: model.product_name, contract_price: model.contract_price, cost_price: model.cost_price, @@ -271,9 +270,7 @@ const UseProductPop = forwardRef((props, ref) => { map_product_name: model.product_name, goods_id: model.goods_id, end_time: model.end_time, - card_show: model.card_show, - messageVerify: model.messageVerify, - channelVerIfy: model.channelVerIfy + card_show: model.card_show } } @@ -514,18 +511,7 @@ const UseProductPop = forwardRef((props, ref) => { > 直充 卡密 - - - - { - setModel({ messageVerify: e.target.value }) - }} - value={model.messageVerify} - disabled={!!model.code_batch_id} - > - - + 京东E卡 {model.product_type === 2 ? ( @@ -556,19 +542,6 @@ const UseProductPop = forwardRef((props, ref) => { }} /> - -