import React, { Component } from "react";
import CardWrapper from "@/component/CardWrapper";
import InfoHeader from "@/component/InfoHeader";
import LabelInput from "@/ui-component/LabelInput";
import UploadImage from "@/ui-component/UploadImage";
import { Row, Col } from "antd";

export default class PhotoInfo extends Component {
    state = {
        loading: false
    };

    changeFile(key,value){
        this.props &&
            this.props.transferMsg &&
            this.props.transferMsg(key,value);
    }

    render() {
        return (
            <div className="photo-info">
                <InfoHeader
                    title="证件照与生活照"
                    tip="(每张图片大小不超过2M)"
                />
                <CardWrapper>
                    <Row>
                        <Col span={10}>
                            <LabelInput>证件照（一寸彩色免冠证件照）</LabelInput>
                            <UploadImage changeFile={this.changeFile.bind(this)} imageKey="idPhoto" imageUrl={this.props.info.idPhoto}></UploadImage>
                        </Col>
                        <Col span={10} offset={4}>
                            <p className="input-label not-must">生活照（个人近半年站立半身照）</p>
                            <UploadImage changeFile={this.changeFile.bind(this)} imageKey="lifePhoto" imageUrl={this.props.info.lifePhoto}></UploadImage>
                        </Col>
                    </Row>
                </CardWrapper>
            </div>
        );
    }
}
