import React, { useState, useEffect, useRef } from 'react';
import MainNav from '../Components/MainNav';
import SubNav from '../Components/SubNav';
import DaumPostcode from "react-daum-postcode";
import { Container, Card, Row, Col, Button, Form } from 'react-bootstrap';
function Payment() {
const [paymentWay, setPaymentWay] = useState([])
const [isAddress, setIsAddress] = useState("");
const [isZoneCode, setIsZoneCode] = useState();
const [isPostOpen, setIsPostOpen] = useState();
const [post, setPost] = useState([])
function postClick() {
if (post.length !== 0) {
setPost([])
}
else {
setPost(
)
}
}
const handleComplete = (data) => {
let fullAddress = data.address;
let extraAddress = "";
if (data.addressType === "R") {
if (data.bname !== "") {
extraAddress += data.bname;
}
if (data.buildingName !== "") {
extraAddress +=
extraAddress !== "" ? `, ${data.buildingName}` : data.buildingName;
}
fullAddress += extraAddress !== "" ? ` (${extraAddress})` : "";
}
setIsZoneCode(data.zonecode);
setIsAddress(fullAddress);
setIsPostOpen(false);
};
const postCodeStyle = {
display: "block",
position: "absolute",
// top: "50%",
width: "400px",
height: "500px",
padding: "7px",
};
function handleClick() {
if (paymentWay.length !== 0) {
setPaymentWay([])
}
else {
const a = (
입금은행
입금자
입금예정일
)
setPaymentWay(a)
}
}
function handleClick2() {
if (paymentWay.length !== 0) {
setPaymentWay([])
}
}
const [num, setNum] = useState(0)
function plusNum() {
setNum(num + 1)
}
function minusNum() {
if (num === 0) {
setNum(0)
}
else {
setNum(num - 1)
}
}
function deleteCart() {
//장바구니 DB에서 해당 항목 삭제
console.log('카트에 담긴 항목을 삭제했습니다.')
}
return (
주문/결제
주문자 정보
이름
이메일
휴대전화
배송지 정보
{post}
-
총 상품금액
12,000원
-
배송비
2,500원
결제금액14,500원
결제수단
{paymentWay}
)
}
export default Payment