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
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) => {}
)