OrderCard.js 2.13 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
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>)}
박상호's avatar
good    
박상호 committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
                        <Card.Text>
                            <Col>
                                <Row className=''>
                                    <Col sm={4} xs={4} className='p-1'>주문번호 :</Col>
                                    <Col sm={8} xs={8} className='p-1'><strong>{e._id}</strong></Col>

                                    <Col sm={4} xs={4} className='p-1'>결제금액 :</Col>
                                    <Col sm={8} xs={8} className='p-1'><strong>{e.total}</strong></Col>

                                    <Col sm={4} xs={4} className='p-1'>배송지 :</Col>
                                    <Col sm={8} xs={8} className='p-1'><strong> {e.receiverInfo.address} / </strong><strong><small> {e.receiverInfo.address2}</small></strong></Col>

                                    <Col sm={4} xs={4} className='p-1'>주문날짜 :</Col>
                                    <Col sm={8} xs={8} className='p-1'><strong>{e.createdAt.substring(0, 10)}</strong></Col>
                                </Row>
                            </Col>
                        </Card.Text>
이재연's avatar
이재연 committed
39
40
41
42
43
                    </Card.Body>
                )
                )
            }
        </Card>
박상호's avatar
good    
박상호 committed
44

이재연's avatar
이재연 committed
45
46
47
48
    )
}

export default OrderCard