import React, { useState, useEffect } from 'react';
import { PageHeaderWrapper } from '@ant-design/pro-layout';
import { Button, Icon, message, Modal, Radio } from 'antd';
import router from 'umi/router';
import moment from 'moment';
import className from 'classnames';
import styles from './style.less';
import { fetch, apis } from '../../utils/request';
import request from '../../utils/request';
import XForm, { FieldTypes } from '../../components/XForm';
import RechargeOrder from './RechargeOrder';
import ConsumeOrder from './ConsumeOrder';
import RefundOrder from './RefundOrder';
import Base from './Base';
import Recharge from './components/Recharge'
import { regFenToYuan } from '@/utils/money';

function header(props) {
    const orgId = props.location.query.orgId || ''

    useEffect(() => {
     
    }, [])

  

    const [tab, changeTab] = useState('basic')


    return (

        <>
            <div style={{ marginBottom: '16px' }}>
                <Radio.Group value={tab} buttonStyle="solid" onChange={e => changeTab(e.target.value)}>
                    <Radio.Button value="basic">基本信息</Radio.Button>
                    <Radio.Button value="recharge">充值订单</Radio.Button>
                    <Radio.Button value="consume">消费订单</Radio.Button>
                    <Radio.Button value="refund">退款订单</Radio.Button>
                </Radio.Group>
            </div>
            <div>
                {tab === 'basic' && <Base orgId={orgId} />}
                {tab === 'recharge' && <RechargeOrder organize="hidden" orgId={orgId} />}
                {tab === 'consume' && <ConsumeOrder organize="hidden" orgId={orgId} />}
                {tab === 'refund' && <RefundOrder organize="hidden" orgId={orgId} onToDetail={() => changeTab('basic')} />}
            </div>
        </>
    )
}

export default header