import React from 'react';
import HeaderComponent from '../../components/CommonComponent/HeaderComponent/HeaderComponent'
import Button from '../../components/CommonComponent/ButtonComponent/ButtonComponent'
require('./index.css');

export default class HomePageContainer extends React.Component{
    constructor(props){
        super(props);
        this.state = {
        }
    }

    componentWillMount(){

    }

    render(){
        let props = this.props;
        let {headerInfo={}} = props;
        let {taskInfo={}} = headerInfo;
        let marginTop = UTILPATH.getRemByPx(77);
        let marginTop50 = UTILPATH.getRemByPx(50);
        let marginTop20 = UTILPATH.getRemByPx(20);
        let padding = UTILPATH.getRemByPx(8);
        let marginTop160 = UTILPATH.getRemByPx(160);
        let imgStyle =  taskInfo.area ? {marginTop: marginTop160} : {};
        let buttonStyle={background:'#ff775c',margin:"0 auto",marginTop:marginTop};
        return(
            <div>
                <HeaderComponent
                    showHeader={CONFIG.headerStatus[1]}
                    headerInfo={headerInfo}
                />
                <div className={"homeContainer"} >
                    <img className={"homeIcon"} style={imgStyle} src={UTILPATH.localImg.homePage} alt=""/>
                    {
                        taskInfo.area ? <div className={'homeWelcom font30 clo333'} style={{marginTop:marginTop50}}>欢迎来到<span className="homeArea font50 colff775c" style={{padding:`0 ${padding}`}}>{taskInfo.area || ''}</span>区</div>
                            : null
                    }
                    <div className={"homeText font42"} style={{fontWeight:'800',marginTop:marginTop20}}>下午好, 你辛苦了！</div>
                    <Button text={'开始工作'} btnContainer={'colfff font30'} style={buttonStyle} option={this.start.bind(this)}/>
                </div>
            </div>

        )
    }
    start(){
        console.log('执行 开始工作了')
        let props=this.props;
        props.getTaskList();
    }
 
}

HomePageContainer.propTypes = {
};

HomePageContainer.defaultProps = {
}