From 9861444f34ba332eca9fee86bc144309b778c474 Mon Sep 17 00:00:00 2001 From: zhangds Date: Tue, 5 Mar 2024 20:07:56 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E7=BB=84=E5=90=88?= =?UTF-8?q?=E5=95=86=E5=93=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/pages/plan/add/step2.js | 5 +---- src/pages/plan/key/UseKeyAddEdit.jsx | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/src/pages/plan/add/step2.js b/src/pages/plan/add/step2.js index 9b6fb9e4..d24a5344 100644 --- a/src/pages/plan/add/step2.js +++ b/src/pages/plan/add/step2.js @@ -363,21 +363,18 @@ export default class acclist extends React.Component { planAddExchangeCoupon(type) { switch (type) { case 0: - sessionStorage.removeItem("has_combining") this.setState({ draw_title: "新建兑换码", exchangeType: 1, rowExchangeData: null }) setTimeout(() => { this.refs.addEditExchangeEl.clearExchangeForm() }, 300) break case 1: - sessionStorage.removeItem("has_combining") this.setState({ draw_title: "新建优惠券" }) setTimeout(() => { this.refs.addEditCouponEl.clearCouponForm() }, 300) break case 2: - sessionStorage.setItem("has_combining", 1) this.setState({ draw_title: "新建组合商品", exchangeType: 2, rowExchangeData: null }) setTimeout(() => { this.refs.addEditExchangeEl.clearExchangeForm() @@ -606,7 +603,7 @@ export default class acclist extends React.Component { let param = this.refs.addEditExchangeEl.getModel() // 第三步:包码只能选一个 - if (this.props.isSettlement >= 1 && !sessionStorage.getItem("has_combining")) { + if (this.props.isSettlement >= 1 && this.state.exchangeType !== 2) { // 合并数组 let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash] if (all_arr.length > 1) { diff --git a/src/pages/plan/key/UseKeyAddEdit.jsx b/src/pages/plan/key/UseKeyAddEdit.jsx index 1be3b3e2..5e37c790 100644 --- a/src/pages/plan/key/UseKeyAddEdit.jsx +++ b/src/pages/plan/key/UseKeyAddEdit.jsx @@ -563,14 +563,12 @@ const UseKeyAddEdit = () => { const planAddExchangeCoupon = (type) => { switch (type) { case 0: - sessionStorage.removeItem("has_combining") setState({ draw_title: "新建兑换码", exchangeType: 1 }) setTimeout(() => { addEditExchangeEl.current.clearExchangeForm() }, 300) break case 1: - sessionStorage.removeItem("has_combining") setState({ draw_title: "新建优惠券" }) setTimeout(() => { addEditCouponEl.current.clearCouponForm() @@ -578,7 +576,6 @@ const UseKeyAddEdit = () => { break case 2: // 存储是否有组合商品 - sessionStorage.setItem("has_combining", 1) setState({ draw_title: "新建组合商品", exchangeType: 2 }) setTimeout(() => { addEditExchangeEl.current.clearExchangeForm() @@ -688,7 +685,7 @@ const UseKeyAddEdit = () => { let validator = addEditExchangeEl.current.submit() if (validator) { let param = addEditExchangeEl.current.getModel() - if (state.isSettlement >= 1) { + if (state.isSettlement >= 1 && state.exchangeType !== 2) { // 包码 合并数组 let all_arr = [...param.product.legal, ...param.product.reduce, ...param.product.cash] if (all_arr.length > 1 && !sessionStorage.getItem("has_combining")) {