From 27cb9e8518c4a991b0a0951a9232a6765463e6a5 Mon Sep 17 00:00:00 2001 From: wangsongsole Date: Thu, 11 Aug 2022 14:55:57 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=AD=A3=20=E5=A4=8D=E5=88=B6?= =?UTF-8?q?=E5=85=91=E6=8D=A2=E7=A0=81=E5=90=8E=EF=BC=8C=E8=A2=AB=E5=A4=8D?= =?UTF-8?q?=E5=88=B6=E7=9A=84=E5=85=91=E6=8D=A2=E7=A0=81=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E6=B2=A1=E6=9C=89=E5=9B=9E=E6=98=BE=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/exchangecode/copyCode/index.jsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/pages/exchangecode/copyCode/index.jsx b/src/pages/exchangecode/copyCode/index.jsx index 5f5a8a79..3ca2e3fb 100644 --- a/src/pages/exchangecode/copyCode/index.jsx +++ b/src/pages/exchangecode/copyCode/index.jsx @@ -152,14 +152,23 @@ export default class acclist extends React.Component { this.setState({ isEdit: true }) } - req.code_batch = req.code_batch ? req.code_batch : [] + req.code_batch = req.code_batch || [] this.setState({ pagetitle: '复制兑换码', plan_id: req.plan_id, key_status: req.status }) - let list = _.map(req.code_batch, (item) => { + const cloneData = _.cloneDeep(req.code_batch) + req.code_batch.map((item) => { + if (item.id === copy_code_id) { + const data = _.cloneDeep(item) + data.id = new Date().getTime() + cloneData.push(data) + } + }) + + let list = _.map(cloneData, (item) => { item.product = item.product.map((item1) => { let obj = {} if (item1.type === 1) { @@ -202,6 +211,7 @@ export default class acclist extends React.Component { return obj }) + let pr = {} pr.range = item.range pr.restrict = item.restrict