From 37958004df1ec6cce1f71fd9e9fc144c7c131245 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Fri, 30 Sep 2022 16:32:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E5=85=91=E6=8D=A2=E7=A0=81=E5=A4=8D?= =?UTF-8?q?=E5=88=B6)=EF=BC=9A=E4=BF=AE=E5=A4=8D=E5=85=91=E6=8D=A2?= =?UTF-8?q?=E7=A0=81=E5=A4=8D=E5=88=B6=E6=97=B6=E5=95=86=E5=93=81=E4=B8=8D?= =?UTF-8?q?=E8=83=BD=E7=BC=96=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../exchangecode/exchangecodeAdd/index.jsx | 23 +++++++++---------- 1 file changed, 11 insertions(+), 12 deletions(-) diff --git a/src/pages/exchangecode/exchangecodeAdd/index.jsx b/src/pages/exchangecode/exchangecodeAdd/index.jsx index 60103c52..4b199756 100644 --- a/src/pages/exchangecode/exchangecodeAdd/index.jsx +++ b/src/pages/exchangecode/exchangecodeAdd/index.jsx @@ -296,16 +296,17 @@ export default class exchangeAdd extends React.Component { res.checked = true return res }) + this.setState({ tempdata: reqCopy.goods || [] }) - let a1 = reqCopy.goods.map((item) => { - let obj = { - ...item, - in: true - } - return obj - }) - sessionStorage.setItem("productData", JSON.stringify(a1)) - sessionStorage.setItem("knockGoldData", JSON.stringify(a1)) + + sessionStorage.setItem( + "productData", + JSON.stringify(reqCopy.goods) + ) + sessionStorage.setItem( + "knockGoldData", + JSON.stringify(reqCopy.goods) + ) let arr = [] _.map(reqCopy.goods, (res) => { @@ -313,12 +314,10 @@ export default class exchangeAdd extends React.Component { obj.key = res.only obj.text = res.product_name obj.id = res.id - this.state.oldProduct.push(res.id) arr.push(obj) return obj }) - this.setState({ rankoptions: arr }) - this.setState({ rank: arr }) + this.setState({ rank: arr, rankoptions: arr }) }, (err) => {} )