text: import React, { Component } from 'react';
  import { connect } from 'dva';
  import { Card, Badge, Table, Divider } from 'antd';
  import DescriptionList from '@/components/DescriptionList';
  import PageHeaderWrapper from '@/components/PageHeaderWrapper';
  import styles from './MenberManageCheck.less';
  
  const { Description } = DescriptionList;
  
  const progressColumns = [
    {
      title: '时间',
      dataIndex: 'time',
      key: 'time',
    },
    {
      title: '当前进度',
      dataIndex: 'rate',
      key: 'rate',
    },
    {
      title: '状态',
      dataIndex: 'status',
      key: 'status',
      render: text =>
        text === 'success' ? (
          <Badge status="success" text="成功" />
        ) : (
          <Badge status="processing" text="进行中" />
        ),
    },
    {
      title: '操作员ID',
      dataIndex: 'operator',
      key: 'operator',
    },
    {
      title: '耗时',
      dataIndex: 'cost',
      key: 'cost',
    },
  ];
  
  @connect(({ profile, loading }) => ({
    profile,
    loading: loading.effects['profile/fetchBasic'],
  }))
  class BasicProfile extends Component {
    componentDidMount() {
      const { dispatch, match } = this.props;
      const { params } = match;
  
      dispatch({
        type: 'profile/fetchBasic',
        payload: params.id || '1000000000',
      });
    }
  
    render() {
      const { profile = {}, loading } = this.props;
      const { basicGoods = [], basicProgress = [], userInfo = {}, application = {} } = profile;
      let goodsData = [];
      if (basicGoods.length) {
        let num = 0;
        let amount = 0;
        basicGoods.forEach(item => {
          num += Number(item.num);
          amount += Number(item.amount);
        });
        goodsData = basicGoods.concat({
          id: '总计',
          num,
          amount,
        });
      }
      const renderContent = (value, row, index) => {
        const obj = {
          children: value,
          props: {},
        };
        if (index === basicGoods.length) {
          obj.props.colSpan = 0;
        }
        return obj;
      };
      const goodsColumns = [
        {
          title: '商品编号',
          dataIndex: 'id',
          key: 'id',
          render: (text, row, index) => {
            if (index < basicGoods.length) {
              return <a href="">{text}</a>;
            }
            return {
              children: <span style={{ fontWeight: 600 }}>总计</span>,
              props: {
                colSpan: 4,
              },
            };
          },
        },
        {
          title: '商品名称',
          dataIndex: 'name',
          key: 'name',
          render: renderContent,
        },
        {
          title: '商品条码',
          dataIndex: 'barcode',
          key: 'barcode',
          render: renderContent,
        },
        {
          title: '单价',
          dataIndex: 'price',
          key: 'price',
          align: 'right',
          render: renderContent,
        },
        {
          title: '数量（件）',
          dataIndex: 'num',
          key: 'num',
          align: 'right',
          render: (text, row, index) => {
            if (index < basicGoods.length) {
              return text;
            }
            return <span style={{ fontWeight: 600 }}>{text}</span>;
          },
        },
        {
          title: '金额',
          dataIndex: 'amount',
          key: 'amount',
          align: 'right',
          render: (text, row, index) => {
            if (index < basicGoods.length) {
              return text;
            }
            return <span style={{ fontWeight: 600 }}>{text}</span>;
          },
        },
      ];
      //    width: 104px;
      // height: 104px;
      return (
        <PageHeaderWrapper title="会员管理查看" loading={loading}>
          <Card bordered={false}>
            <img
              alt=""
              style={{ marginBottom: '20px', width: '104px', height: '104px', textAlign: 'Center' }}
              src="https://gw.alipayobjects.com/zos/antfincdn/XAosXuNZyF/BiazfanxmamNRoxxVxka.png"
            />
            <DescriptionList size="large" title="用户信息" style={{ marginBottom: 32 }}>
              <Description term="姓名">{application.id}</Description>
              <Description term="昵称">{application.status}</Description>
              <Description term="性别">{application.orderNo}</Description>
              <Description term="手机">{application.childOrderNo}</Description>
              <Description term="学校">{application.orderNo}</Description>
              <Description term="年级">{application.childOrderNo}</Description>
            </DescriptionList>
            <Divider style={{ marginBottom: 32 }} />
            <DescriptionList size="large" title="用户信息" style={{ marginBottom: 32 }}>
              <Description term="会员类型">{userInfo.name}</Description>
              <Description term="会员期限">{userInfo.tel}</Description>
              <Description term="积分">{userInfo.delivery}</Description>
              <Description term="经验">{userInfo.addr}</Description>
              <Description term="注册时间">{userInfo.remark}</Description>
              <Description term="最近登陆">{userInfo.addr}</Description>
              <Description term="注册设备">{userInfo.remark}</Description>
              <Description term="微信">{userInfo.addr}</Description>
              <Description term="QQ">{userInfo.remark}</Description>
              <Description term="推广伙伴">{userInfo.remark}</Description>
            </DescriptionList>
          </Card>
        </PageHeaderWrapper>
      );
    }
  }
  
  export default BasicProfile;
  