import React, { Component } from 'react'

export default class orderDes extends Component {
    render() {
        return (
            <div>
                
            </div>
        )
    }
}

function orderDes(props) {
    const listData = props.list;
    return (
      <div>
        {
          listData.map((item, index) => {
            const Info = (
              <div className="order-info">
                <p className='order-title' style={{ overflow: 'hidden', textOverflow: 'ellipsis', whiteSpace: 'nowrap' }}>{item.course_title}</p>
                <p className='order-content' style={{ WebkitBoxOrient: 'vertical', WebkitLineClamp: '2', wordBreak: 'break-all', overflow: 'hidden', textOverflow: 'ellipsis', display: '-webkit-box' }}>{item.simpledescription}</p>
                <p className='order-des'>
                  <span className='order-newprice'>¥{item.price1}</span>
                  <span className='order-price'>¥{item.price0}</span>
                </p>
              </div>
            )
  
            return (
              <OrderItem {...item} key={index} info={Info}>
                <div className="order-prefer">
                  <List key={index}>
                    <Item
                      arrow="horizontal"
                      onClick={() => { }}
                    >
                      <Link to='/coupons'>
                        <Flex justify='between'>
                          <span style={{color: '#333', fontSize: '15px'}}>优惠券</span>
                          <span style={{fontSize: '14px', color: '#999999'}}>{item.coupon_num === 0 ? '无' : `${item.coupon_num}张可用`}</span>
                        </Flex>
                      </Link>
                    </Item>
                  </List>
                </div>
              </OrderItem>
            )
          })
        }
      </div>
    );
  }