/*
 * Creator:     ML
 * CreatDate:   2020-03-19
 * descripts：  配送单 取消订单 (新增订单页面/未配送界面)
 * */
import React from 'react';
import { List, WhiteSpace, Result, Icon } from 'antd-mobile';
import '../style/index.less';
// import { $http } from "containers/config/https";
import DistributionList from "./DistributionList";
import store from "store";

const Item = List.Item;
export default class CancelOrderTip extends React.Component {
    constructor({ history }) {
        super();
        this.state = {
        }
        this.history = history;
    }

    componentDidMount() {
    }
    //查看全部配送单
    handleCheckAllOrder = () => {
        store.dispatch({
            type: "distributionTabs",
            value: "2"
        });
        this.history.push({
            pathname: "/0006/00000005",
            state: ""
        });
    }
    render() {
        // let { } = this.state;
        console.log("this.props.location.state----------", this.props.location.state)
        return (
            <div className="detail-dom">
                <div>
                    <Item>
                        <div className="btn-check-tips">
                            <Result
                                img={<Icon type="cross-circle" className="spe" style={{ fill: 'red' }} />}
                                title={
                                    <span style={{ color: "red" }}>
                                        该配送订单已取消
                                        </span>
                                }
                            />
                        </div>
                        <div className="btn-check-info">
                            <span onClick={this.handleCheckAllOrder}>查看全部配送单</span>
                        </div>
                    </Item>
                    <WhiteSpace />
                </div>
                <div className="adress-info">
                    <Item className="adress-item">
                        <p>
                            {this.props.location.state && this.props.location.state.receiveDetailArea}
                        </p>
                        <p>
                            {this.props.location.state && this.props.location.state.receiveDetailAdress}
                        </p>
                        <p>
                            <span>{(this.props.location.state && this.props.location.state.receiveName) || "***"}</span>
                            <span>{this.props.location.state && this.props.location.state.receiveMobile}</span>
                        </p>
                    </Item>
                </div>
                <WhiteSpace />
                <DistributionList info={this.props.location.state} data={this.props.location.state && this.props.location.state.pres} activeTabs={store.getState().electronicPrescription && store.getState().electronicPrescription.distributionTabsData}></DistributionList>
            </div>
        )
    }
}