OrderCard.js 2.28 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
css    
박상호 committed
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
                        <Card.Text >
                            <Col className='justify-content-center'>
                                <Row className='justify-content-center' >
                                    <>
                                        <Col sm={3} xs={5} className='p-1'><li>주문번호 :</li></Col>
                                        <Col sm={8} xs={6} className='p-1'><strong>{e._id}</strong></Col>
                                    </>
                                    <Col sm={3} xs={5} className='p-1'><li>결제금액 :</li></Col>
                                    <Col sm={8} xs={6} className='p-1'><strong>{e.total}</strong></Col>

                                    <Col sm={3} xs={5} className='p-1'><li>배송지 :</li></Col>
                                    <Col sm={8} xs={6} className='p-1'><strong> {e.receiverInfo.address}</strong> <br />( {e.receiverInfo.address2} )</Col>

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

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

export default OrderCard