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 });