index.js 1.23 KB
Newer Older
.  
baiguangyao committed
1 2
import React from 'react';
import './orderlist.scss';
xuzhenghua committed
3
import {Link} from "react-router-dom";
.  
baiguangyao committed
4 5 6 7


/**
 * @OrderList        组件内容
baiguangyao committed
8
 * @param tab        左侧内容
.  
baiguangyao committed
9 10 11 12 13 14 15 16
 * @param info       右侧信息
 * @param children   内容
 * @param restProps  传入的自定义属性
 * @returns {*}
 * @constructor
 */


17
const OrderItem = ({ info, tab, children, src,id, isaist, toDetail, ...restProps }) => {
.  
baiguangyao committed
18 19 20
    return (
            <div className='public-list-item'>
                <div className="public-content">
baiguangyao committed
21
                    {tab}
.  
baiguangyao committed
22
                    <div className="public-cover" >
23 24 25
                        {/* <Link to={`/detail?id=${id}`}> */}
                            <img src={src} alt="" onClick={() => toDetail(id)} />
                        {/* </Link> */}
26 27 28 29 30
                        {
                            (isaist &&
                                <span className='return_cash'></span>
                            )
                        }
.  
baiguangyao committed
31 32 33 34 35 36 37 38 39 40 41 42
                    </div>
                    {info}
                </div>
                {React.Children.map(
                    children,
                    child => (child ? React.cloneElement(child, {}) : child)
                )}
            </div>
    )
}

export default OrderItem;