import React, { Component } from "react";
import { connect } from "react-redux";
import BannerContainer from '@containers/TypeConfigContainer';
//  引入组件
import BodyContainer from "@components/BodyContainer";

import {HIDEDROP} from '@store/types/homePage.js';
import style from './index.less';
import {getInitModules} from '@store/async-actions/homePage.js';
import { getUrlArgObject } from "@utils/tools";

class HomePage extends Component {
    constructor() {
        super();
        this.state={
            timer:null
        }
    }
    
    componentDidMount(){
        clearTimeout(this.state.timer);
        const that = this;
        const timer = setTimeout(function(){//解决患者信息在获取模板之后的问题
            that.props.getInit();
        },200)
        this.setState({
            timer
        })      
    }
    render() {
        return <div className={style['home-page']} onClick={this.props.hideAllDrop}>
            <BannerContainer />
            {/* <InfoTitle /> */}
            <BodyContainer></BodyContainer>
        </div>;
    }
}

const mapStateToProps = function (state) {
  return {

  }
};
const mapDispatchToProps = function (dispatch) {
    return {
        hideAllDrop(){
            dispatch({
              type:HIDEDROP
            });
        },
        getInit(){
            dispatch(getInitModules);
        }
    }
};

export default connect(mapStateToProps, mapDispatchToProps)(HomePage);