From 969afe92194b24ebf1dc9d87c08354d6fb98b5f5 Mon Sep 17 00:00:00 2001 From: red-deng-deng <1924913374@qq.com> Date: Thu, 30 Dec 2021 11:14:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E6=88=90=E3=80=90=E5=A4=8D=E5=88=B6ke?= =?UTF-8?q?y=E3=80=91=E9=80=BB=E8=BE=91=E4=B8=B2=E9=80=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 ++ src/pages/exchangecode/add/add.js | 21 ++++++++++----------- src/pages/plan/add/step2.js | 2 +- src/pages/plan/key/edit.js | 4 ++-- src/pages/plan/key/list.js | 24 ++++++++++++++++++++++-- 5 files changed, 37 insertions(+), 16 deletions(-) diff --git a/.gitignore b/.gitignore index 4d29575d..fa9b5e2e 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ npm-debug.log* yarn-debug.log* yarn-error.log* +src/pages/exchangecode/contenttaggedwith/add.js +src/pages/exchangecode/contenttaggedwith/add.less diff --git a/src/pages/exchangecode/add/add.js b/src/pages/exchangecode/add/add.js index 603a794d..1657deda 100644 --- a/src/pages/exchangecode/add/add.js +++ b/src/pages/exchangecode/add/add.js @@ -77,18 +77,17 @@ export default class acclist extends React.Component{ componentDidMount(e){ let batch_id=sessionStorage.getItem("keybatch_id") - + let copyOpearo=sessionStorage.getItem("copyOpearo") //编辑 - if(batch_id > 0) + if(batch_id > 0||copyOpearo==2) { - this.setState({isEdit:true}) + // this.setState({isEdit:true}) getKeyBatchDetail(batch_id).then((res)=>{ handelResponse(res,(req,msg)=>{ - - console.log("和编辑",req) - this.setState({pagetitle:"编辑key"}) + this.setState({pagetitle:"复制key"}) let model = { - batch_name:req.batch_name, + title:req.plan_title, + batch_name:'', style: req.style, quantity:req.quantity, allow_repetition:req.allow_repetition, @@ -102,8 +101,8 @@ export default class acclist extends React.Component{ this.setState({begintime:req.begin_time}) let list = _.map(req.code_batch,(item)=>{ - item.disabled = true; - item.checked = true; + // item.disabled = true; + // item.checked = true; return item }) console.log(list) @@ -895,7 +894,7 @@ export default class acclist extends React.Component{
- +
{this.state.model.title}
@@ -940,7 +939,7 @@ export default class acclist extends React.Component{ {this.onCheckChange(e)}} disabled={this.state.isEdit} > 兑换码 优惠券 - 立减金 + {/* 立减金 */} { diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 0f5adc33..76194aca 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -767,7 +767,7 @@ export default class acclist extends React.Component{ {this.onCheckChange(e)}}> 兑换码 优惠券 - 立减金 + {/* 立减金 */}
{ diff --git a/src/pages/plan/key/edit.js b/src/pages/plan/key/edit.js index 3b4d2876..24bde0f2 100644 --- a/src/pages/plan/key/edit.js +++ b/src/pages/plan/key/edit.js @@ -832,7 +832,7 @@ export default class acclist extends React.Component{ - +
{this.state.model.plan_title}
@@ -867,7 +867,7 @@ export default class acclist extends React.Component{ {this.onCheckChange(e)}} disabled={this.state.isEdit} > 兑换码 优惠券 - 立减金 + {/* 立减金 */}
{ diff --git a/src/pages/plan/key/list.js b/src/pages/plan/key/list.js index cc584402..93dbbbbc 100644 --- a/src/pages/plan/key/list.js +++ b/src/pages/plan/key/list.js @@ -266,7 +266,7 @@ export default class acclist extends React.Component{ } ]}] sessionStorage.setItem("keybatch_id","") - + sessionStorage.setItem("copyOpearo",0) sessionStorage.setItem('breakchangenav',JSON.stringify(activerou)); } aboutFn(e,row){ @@ -283,7 +283,25 @@ export default class acclist extends React.Component{ } ]}] sessionStorage.setItem('breaknav',JSON.stringify(activerou)); - } + } + //复制 + onCopyRow(status,row){ + this.props.history.push('/home/exchangecode-add'); + sessionStorage.setItem('pathname2','/home/exchangecode-add') + let activerou=[{pagetitle:'复制',items:[ + { + "path": "/home/exchangecode-list", + "name": "key列表管理" + }, + { + "path": "/home/exchangecode-add", + "name": "复制key" + } + ]}] + sessionStorage.setItem("keybatch_id",row.id) + sessionStorage.setItem("copyOpearo",1) + sessionStorage.setItem('breakchangenav',JSON.stringify(activerou)); + } //page pageChange(e){ this.setState({page:e}); @@ -397,6 +415,7 @@ onEditRow(status,row){ sessionStorage.setItem("keybatch_id",row.id) } + //敲回车查询 iptsureFn(){ this.setState({page:1}) @@ -621,6 +640,7 @@ linkTo(row){ str = {this.onEditRow(e,rowData)}} >编辑 + {this.onCopyRow(e,rowData)}} >复制 { keysIsSend(rowData.id).then((res)=>{