OrderCard.js 1.82 KB
Newer Older
이재연's avatar
이재연 committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import React from 'react'
import { Card, Col, Row } from 'react-bootstrap'



function OrderCard(props) {

    return (
        <Card >
            <Card.Title className="font-weight-bold mt-4 text-center"> 주문 현황</Card.Title>
            {
                props.ordered.map((e) => (
                    <Card.Body className='m-1'>
                        {e.products.length > 1 ?
                            <Card.Header className="font-weight-bold mb-3 text-center" style={{ background: '#F7F3F3' }}>
                                {e.products[0].productId.pro_name}  {e.products.length - 1}
                                </Card.Header>
                            : (
                                <Card.Header className="font-weight-bold mb-3 text-center" style={{ background: '#F7F3F3' }}>
                                    {e.products[0].productId.pro_name}
                                </Card.Header>)}
                        <Col>
                            <Row>
                                <Card.Text> 주문번호 : <strong>{e._id}</strong>  </Card.Text>
                            </Row>
                            <Row>
                                <Card.Text> 결제금액 : <strong>{e.total}</strong> </Card.Text>
                            </Row>
                            <Row>
                                <Card.Text> 배송지 : <strong> {e.receiverInfo.address} - {e.receiverInfo.address2}</strong> </Card.Text>
                            </Row>
                            <Row>
                                <Card.Text> 주문날짜 : <strong> {e.createdAt.substring(0, 10)}</strong> </Card.Text>
                            </Row>
                        </Col>
                    </Card.Body>
                )
                )
            }
        </Card>
    )
}

export default OrderCard