import React from 'react';
import ReactQrCode from 'qrcode.react'
import HeaderComponent from '../HeaderComponent/HeaderComponent'
require('./index.css');

export default class Qrcode extends React.Component{
    constructor(props){
        super(props);
        this.getOtherHeader = this.getOtherHeader.bind(this);
    }

    getOtherHeader(){
        let {goBack} = this.props;
        return <div className={"otherHeader font32 clearfix"}>
            <div className={"fl colfff"} onClick={()=>goBack()}>
                <i className={"iconfont middle icon font50 icon-circle-left circleIcon"}></i>
                <span className={"middle"}>添加照片</span>
            </div>
        </div>
    }

    render(){
        return(
            <div>
                <HeaderComponent
                    showHeader={CONFIG.headerStatus[2]}
                >
                    {this.getOtherHeader()}
                </HeaderComponent>
                <div className="qrCodeContainer">
                    <div className={"qrcode"}>
                        <ReactQrCode className={"qrcodeCanvas"} value={this.props.url || ''}/>
                    </div>
                    <div className={"qrcodeText font32"}>
                        请用手机微信“扫一扫”上方二维码进行图片上传
                    </div>
                </div>
            </div>

        )
    }
}
