From 992f82c540cf46898f0262c6fc21a3b3984d0afa Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 21 Sep 2022 16:03:55 +0800 Subject: [PATCH] =?UTF-8?q?1)=20=E5=A2=9E=E5=8A=A0=E4=BC=98=E6=83=A0?= =?UTF-8?q?=E5=A4=8D=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseCouponAddEdit/index copy.jsx | 4 ++-- src/components/UseCouponAddEdit/index.jsx | 12 ++++++++++-- src/pages/coupon/list/index.jsx | 2 +- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/UseCouponAddEdit/index copy.jsx b/src/components/UseCouponAddEdit/index copy.jsx index 56a332a2..747b2274 100644 --- a/src/components/UseCouponAddEdit/index copy.jsx +++ b/src/components/UseCouponAddEdit/index copy.jsx @@ -548,9 +548,9 @@ const UseCouponAddEdit = forwardRef((props, ref) => { onConfirm: () => { window.history.back(); }, - onCancel: this.onCancel, + onCancel: () => {}, className: "questModal", - parentComponent: this, + parentComponent: () => {}, }); }; const onChangeCombinedDate = (e) => { diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index 56a332a2..d3209d56 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -6,7 +6,6 @@ import React, { } from "react"; import { useSetState } from "ahooks"; import { FixedSizeList } from "react-window"; -import { useHistory } from "react-router-dom"; import { Card, DateRangePicker, @@ -253,6 +252,15 @@ const UseCouponAddEdit = forwardRef((props, ref) => { }); // 1.6 设置其它数据 editFun(); + + // 1.7 是否复制 + let isState = sessionStorage.getItem("isState"); + if (isState && isState === "1") { + setForm_info_data({ + title: `${editData.title}_${editData.copy_count + 1}`, + }); + } + console.log("isState =>", isState); } }); } else { @@ -548,7 +556,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => { onConfirm: () => { window.history.back(); }, - onCancel: this.onCancel, + onCancel() {}, className: "questModal", parentComponent: this, }); diff --git a/src/pages/coupon/list/index.jsx b/src/pages/coupon/list/index.jsx index 3d0a66dc..8b794a7f 100644 --- a/src/pages/coupon/list/index.jsx +++ b/src/pages/coupon/list/index.jsx @@ -369,7 +369,7 @@ const UseCouponList = () => { this.addCodeFunction(1, params)} + onClick={(e) => addCodeFunction(1, params)} > 复制