/*
 * Creator:     ML
 * CreatDate:   2020-03-15
 * descripts：   配送单 清单
 * */
import React from 'react';
import {  List, WhiteSpace,  } from 'antd-mobile';
import "pages/common/style/index.less";
import '../style/index.less';
// import { $http } from "containers/config/https";
// import store from 'store';
const Item = List.Item;
export default class DistributionList extends React.Component {
    constructor({ history }) {
        super();
        this.state = {
            expressModal: false
        }
        this.history = history;
    }

    componentDidMount() {
    }
    showModal = (e, key) => {
        e.preventDefault(); // 修复 Android 上点击穿透
        this.setState({
            [key]: true,
        });
    }
    onClose = key => () => {
        this.setState({
            [key]: false,
        });
    }
    render() {
        // let { } = this.state;
        // console.log("this.props.info", this.props.info)
        return (
            <div className="detail-dom">
                <WhiteSpace />
                <div className="list-info">
                    <Item>
                        <p>
                            配送清单
                        </p>
                    </Item>
                    {
                        this.props.data && this.props.data && this.props.data && this.props.data.map((item, i) => {
                            return (
                                <div key={i}>
                                    <Item>
                                        <span style={{ fontWeight: "600" }}>{item.locDesc || "xxx"}</span>{"(" + item.prescNo + ")"}
                                    </Item>
                                    <div className="small-info">
                                        {
                                            item.orderDetail && item.orderDetail.map((items, index) => {
                                                return (
                                                    <Item key={index} extra={<span className="small-title" style={{ color: "#888" }}>{"x" + items.orderQty}</span>}><span className="small-title">{index + 1}.{items.medDesc}</span></Item>
                                                )
                                            })
                                        }
                                    </div>
                                </div>
                            )
                        })
                    }
                </div>
                <div className="order-info">
                    <Item extra={<span className="self-mention">{this.props.info && this.props.info.distributionList && this.props.info.distributionList ? "x" + this.props.info && this.props.info.distributionList : "1"}</span>}><span className="order-title">配送清单</span></Item>
                    <Item extra={<span className="self-mention">{">"}</span>}><span className="order-title">发票</span></Item>
                    <WhiteSpace />
                </div>
                <div className="status-info" style={{display:this.props.orderBlock&&this.props.orderBlock?"none":"block"}}>
                    <Item extra={<span className="self-mention">{this.props.info && this.props.info.ordStatus}</span>}><span className="order-title">订单状态</span></Item>
                    <Item >
                        <p className="time-info">
                            <span>订单生成时间</span>
                            <span>{this.props.info && this.props.info.createDate}<span> </span>{this.props.info && this.props.info.createTime}</span>
                        </p>
                    </Item>
                </div>
               
            </div>
        )
    }
}