fix(兑换码复制):修复兑换码复制时商品不能编辑

This commit is contained in:
wangsongsole 2022-09-30 16:32:50 +08:00
parent 2d73e4b078
commit 37958004df
1 changed files with 11 additions and 12 deletions

View File

@ -296,16 +296,17 @@ export default class exchangeAdd extends React.Component {
res.checked = true res.checked = true
return res return res
}) })
this.setState({ tempdata: reqCopy.goods || [] }) this.setState({ tempdata: reqCopy.goods || [] })
let a1 = reqCopy.goods.map((item) => {
let obj = { sessionStorage.setItem(
...item, "productData",
in: true JSON.stringify(reqCopy.goods)
} )
return obj sessionStorage.setItem(
}) "knockGoldData",
sessionStorage.setItem("productData", JSON.stringify(a1)) JSON.stringify(reqCopy.goods)
sessionStorage.setItem("knockGoldData", JSON.stringify(a1)) )
let arr = [] let arr = []
_.map(reqCopy.goods, (res) => { _.map(reqCopy.goods, (res) => {
@ -313,12 +314,10 @@ export default class exchangeAdd extends React.Component {
obj.key = res.only obj.key = res.only
obj.text = res.product_name obj.text = res.product_name
obj.id = res.id obj.id = res.id
this.state.oldProduct.push(res.id)
arr.push(obj) arr.push(obj)
return obj return obj
}) })
this.setState({ rankoptions: arr }) this.setState({ rank: arr, rankoptions: arr })
this.setState({ rank: arr })
}, },
(err) => {} (err) => {}
) )