From df8b667bf85864df5b588f92cd000f8fa7f6ca1e Mon Sep 17 00:00:00 2001 From: zhangds Date: Thu, 29 Sep 2022 10:23:50 +0800 Subject: [PATCH] =?UTF-8?q?1)=20=E4=BF=AE=E5=A4=8D=E8=AE=A1=E5=88=92?= =?UTF-8?q?=E5=A4=8D=E5=88=B6=E3=80=81=E7=BC=96=E8=BE=91=E3=80=81=E6=96=B0?= =?UTF-8?q?=E5=A2=9E=E7=BB=91=E5=AE=9A=E7=B1=BB=E5=9E=8B=E5=88=87=E6=8D=A2?= =?UTF-8?q?=E8=90=BD=E5=9C=B0=E9=A1=B5=E5=88=87=E6=8D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/coupon/list/index.jsx | 5 +++-- src/pages/plan/add/add.js | 1 + src/pages/plan/add/edit.js | 1 + src/pages/plan/add/plan-copy.js | 8 ++++++++ src/pages/plan/add/step2.js | 5 +++-- src/pages/plan/add/step3.js | 2 +- 6 files changed, 17 insertions(+), 5 deletions(-) diff --git a/src/pages/coupon/list/index.jsx b/src/pages/coupon/list/index.jsx index 0df8cfee..f44ea255 100644 --- a/src/pages/coupon/list/index.jsx +++ b/src/pages/coupon/list/index.jsx @@ -57,8 +57,8 @@ const tableColumn = [ title: "归属key批次名称", width: "auto", type: "normal", - prop: "keyBatch.plan.title", - name: "keyBatch.plan.title", + prop: "keyBatch.batch_name", + name: "keyBatch.batch_name", }, { title: "启用/暂停", @@ -285,6 +285,7 @@ const UseCouponList = () => { sessionStorage.setItem("isState", type); sessionStorage.setItem("breaknav", JSON.stringify(activerou)); sessionStorage.setItem("pathname2", "/home/coupon-add-edit"); + sessionStorage.setItem("datetime", ""); history.push("/home/coupon-add-edit"); }; diff --git a/src/pages/plan/add/add.js b/src/pages/plan/add/add.js index 0de24882..d9e060dc 100644 --- a/src/pages/plan/add/add.js +++ b/src/pages/plan/add/add.js @@ -414,6 +414,7 @@ export default class add extends React.Component { keyType={this.state.keyType} keyStyle={this.state.keyStyle} isload={this.state.isload} + curstep={this.state.curstep} direct_reseller_id={this.state.direct_reseller_id} name={index} whiteStyle={this.state.whiteStyle} diff --git a/src/pages/plan/add/edit.js b/src/pages/plan/add/edit.js index 9d2ac42d..9d52ca8f 100644 --- a/src/pages/plan/add/edit.js +++ b/src/pages/plan/add/edit.js @@ -684,6 +684,7 @@ export default class add extends React.Component { this.setState({ keyType: e }); }} getStep3Theme={() => this.getStep3Theme()} + curstep={this.state.curstep} keyType={this.state.keyType} whiteStyle={this.state.whiteStyle} keyStyle={this.state.keyStyle} diff --git a/src/pages/plan/add/plan-copy.js b/src/pages/plan/add/plan-copy.js index a0acf66f..9e687d41 100644 --- a/src/pages/plan/add/plan-copy.js +++ b/src/pages/plan/add/plan-copy.js @@ -145,6 +145,7 @@ export default class add extends React.Component { this.refs["step2-" + i].submit(); } }, 500); + console.log("详情 =>", req); } else { this.addNewkey(); } @@ -213,6 +214,11 @@ export default class add extends React.Component { } } + // 获取落地页 + getStep3Theme() { + this.refs.step3.getThemeData(); + } + onConfirm(e) { let plan_id = sessionStorage.getItem("plan_id"); this.setState({ is_audit: true }); @@ -521,6 +527,8 @@ export default class add extends React.Component { this.setState({ keyType: e }); }} keyType={this.state.keyType} + getStep3Theme={() => this.getStep3Theme()} + curstep={this.state.curstep} isCopy={true} isload={this.state.isload} direct_reseller_id={this.state.direct_reseller_id} diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 09de4249..2213a700 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -294,7 +294,7 @@ export default class acclist extends React.Component { onCheckChange = ({ target }) => { this.props.changeKeyType(target.value); sessionStorage.setItem("keyType", target.value); - if (this.props.getStep3Theme) { + if (this.props.getStep3Theme && this.props.curstep === 3) { this.props.getStep3Theme(); } }; @@ -310,7 +310,8 @@ export default class acclist extends React.Component { this.setState({ model: model2 }); if (e.target.value == 6) { sessionStorage.setItem("white", 1); - if (this.props.getStep3Theme) { + console.log("this.props.curstep =>", this.props.curstep); + if (this.props.getStep3Theme && this.props.curstep === 3) { this.props.getStep3Theme(); } this.setState({ white_visible: true }); diff --git a/src/pages/plan/add/step3.js b/src/pages/plan/add/step3.js index e857ff84..592337f5 100644 --- a/src/pages/plan/add/step3.js +++ b/src/pages/plan/add/step3.js @@ -45,6 +45,7 @@ export default class acclist extends React.Component { } getThemeData() { + console.log("编辑 -1"); let params = {}; // 第一步:判断是否优惠券 @@ -82,7 +83,6 @@ export default class acclist extends React.Component { let model = this.state.model; model.theme_id = ""; this.setState({ model: model }); - if (this.props.data && this.props.data.theme_id) { this.setState({ theme_id: this.props.data.theme_id });