import React from 'react';
import './index.less';
import { Form, Row, Col } from 'antd';
import Page from '@src/containers/Page';
import Block from '@src/components/Block';
import { getMap, formatDate, formatMoney } from '@src/services/Tools';
import { RecordBuySource, ServiceKey, ServiceParamMap } from '../../../../Constant';
import { User } from '../../../stores/user';
const RecordBuySourceMap = getMap(RecordBuySource, 'value', 'label');
const ServiceKeyMap = getMap(ServiceKey, 'value', 'label');
const ServiceParamRelation = getMap(Object.keys(ServiceParamMap).map(key => {
return { map: getMap(ServiceParamMap[key], 'value', 'label'), key };
}), 'key', 'map');
export default class extends Page {
initData() {
const { id } = this.params;
let handler;
if (id) {
handler = User.getOrder({ id });
} else {
handler = Promise.resolve({});
}
handler
.then(result => {
const courseMap = getMap(result.courses, 'id');
const dataMap = getMap(result.datas, 'id');
const packageMap = getMap(result.packages, 'id');
this.setState({ courseMap, dataMap, packageMap, data: result });
});
}
renderProduct() {
const { data = {}, courseMap, dataMap, packageMap } = this.state;
const { checkouts = [] } = data;
return 包含商品
订单金额
赠送服务
订单时间