From 0866805d51920fc4acdb111379cce693c8d3e4e0 Mon Sep 17 00:00:00 2001 From: zhangds Date: Wed, 21 Sep 2022 09:59:37 +0800 Subject: [PATCH] =?UTF-8?q?1)=20=E4=BF=AE=E6=94=B9tabpage=20=E7=AC=AC?= =?UTF-8?q?=E4=B8=80=E6=AC=A1=E4=B8=8D=E5=8A=A0=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/UseCouponAddEdit/index.jsx | 2 +- src/components/tabPage/main.js | 22 ++++++++++++++++++++-- src/pages/coupon/list/index.jsx | 1 - 3 files changed, 21 insertions(+), 4 deletions(-) diff --git a/src/components/UseCouponAddEdit/index.jsx b/src/components/UseCouponAddEdit/index.jsx index 0db3c1c0..e9a0ccd1 100644 --- a/src/components/UseCouponAddEdit/index.jsx +++ b/src/components/UseCouponAddEdit/index.jsx @@ -228,7 +228,7 @@ const UseCouponAddEdit = forwardRef((props, ref) => { plan_id: "", key_batch_id: "", title: "", - date_time: "", + date_time: JSON.parse(sessionStorage.getItem("datetime")), }); const form_info_el = useRef(null); diff --git a/src/components/tabPage/main.js b/src/components/tabPage/main.js index d9dfeee4..fdf62c50 100644 --- a/src/components/tabPage/main.js +++ b/src/components/tabPage/main.js @@ -15,7 +15,25 @@ export default class tabbar extends React.Component { }; } componentDidMount() { - this.tabChange(0); + if (this.props.first) { + this.setState({ activeIndex: 0 }); + let arr = []; + for (let i = 0; i < this.state.tabList.length; i++) { + let temp = this.state.tabList[i]; + if (i == 0) { + temp.className = "tabbar active"; + } else if (i == 0 - 1) { + temp.className = "tabbar none-border"; + } else { + temp.className = "tabbar"; + } + arr[i] = temp; + } + this.setState({ tabList: arr }); + return; + } else { + this.tabChange(0); + } } tabChange(index) { @@ -33,7 +51,7 @@ export default class tabbar extends React.Component { arr[i] = temp; } this.setState({ tabList: arr }); - if (this.state.tabList.length > 1 && this.props.first !== true) { + if (this.state.tabList.length > 1) { this.props.tabChange(index); } } diff --git a/src/pages/coupon/list/index.jsx b/src/pages/coupon/list/index.jsx index 4eb36e22..e0a132be 100644 --- a/src/pages/coupon/list/index.jsx +++ b/src/pages/coupon/list/index.jsx @@ -193,7 +193,6 @@ const UseCouponList = () => { const selectionFun = () => {}; const searchCallback = () => { setState({ isQuery: !state.isQuery }); - // getTable(); }; const onPageChange = (data) => { setState({ page: data, isQuery: !state.isQuery });