Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
students
shopping-mall
Commits
f3f88776
Commit
f3f88776
authored
Dec 30, 2020
by
이재연
Browse files
주소끝
parent
328089f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/src/Pages/Signup.js
View file @
f3f88776
...
@@ -8,32 +8,18 @@ import DaumPostcode from "react-daum-postcode";
...
@@ -8,32 +8,18 @@ import DaumPostcode from "react-daum-postcode";
function
Signup
()
{
function
Signup
()
{
const
[
address
,
setAddress
]
=
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
(
<
div
>
<
DaumPostcode
style
=
{
postCodeStyle
}
onComplete
=
{
handleComplete
}
/
>
<
/div
>
)
}
}
const
handleComplete
=
(
data
)
=>
{
const
handleComplete
=
(
data
)
=>
{
let
fullAddress
=
data
.
address
;
let
fullAddress
=
data
.
address
;
let
extraAddress
=
""
;
let
extraAddress
=
""
;
console
.
log
(
data
)
if
(
data
.
addressType
===
"
R
"
)
{
if
(
data
.
addressType
===
"
R
"
)
{
if
(
data
.
bname
!==
""
)
{
if
(
data
.
bname
!==
""
)
{
extraAddress
+=
data
.
bname
;
extraAddress
+=
data
.
bname
;
console
.
log
(
extraAddress
)
}
}
if
(
data
.
buildingName
!==
""
)
{
if
(
data
.
buildingName
!==
""
)
{
extraAddress
+=
extraAddress
+=
...
@@ -41,11 +27,36 @@ function Signup() {
...
@@ -41,11 +27,36 @@ function Signup() {
}
}
fullAddress
+=
extraAddress
!==
""
?
` (
${
extraAddress
}
)`
:
""
;
fullAddress
+=
extraAddress
!==
""
?
` (
${
extraAddress
}
)`
:
""
;
}
}
setIsZoneCode
(
data
.
zonecode
);
setAddress
({
full
:
fullAddress
,
zone
:
data
.
zonecode
});
setIsAddress
(
fullAddress
);
setIsPostOpen
(
false
);
console
.
log
(
fullAddress
);
};
}
const
Postcode
=
()
=>
{
return
(
<
DaumPostcode
onComplete
=
{
handleComplete
}
/
>
);
}
const
[
post
,
setPost
]
=
useState
([]);
function
postClick
()
{
if
(
post
.
length
!==
0
)
{
setPost
([])
}
else
{
setPost
(
<
div
>
<
DaumPostcode
style
=
{
postCodeStyle
}
onComplete
=
{
handleComplete
}
/
>
<
/div
>
)
}
}
const
postCodeStyle
=
{
const
postCodeStyle
=
{
position
:
"
absolute
"
,
position
:
"
absolute
"
,
width
:
"
400px
"
,
width
:
"
400px
"
,
...
@@ -158,14 +169,14 @@ function Signup() {
...
@@ -158,14 +169,14 @@ function Signup() {
<
Form
.
Group
controlId
=
"
formBasicAdd
"
>
<
Form
.
Group
controlId
=
"
formBasicAdd
"
>
<
Form
.
Row
>
<
Form
.
Row
>
<
Form
.
Label
>
주
소
<
/Form.Label
>
{
console
.
log
(
"
address=
"
,
address
)}
<
Form
.
Label
className
=
"
mx-3
"
>
주
소
<
/Form.Label
>
<
Col
>
<
Form
.
Control
required
type
=
"
text
"
id
=
"
add
"
size
=
"
sm
"
style
=
{{
width
:
'
120px
'
}}
value
=
{
address
.
zone
}
disabled
=
{(
address
.
zone
==
null
)
?
false
:
true
}
><
/Form.Control>
<
button
type
=
"
button
"
onClick
=
{
postClick
}
>
우편번호
찾기
<
/
b
utton
>
<
Button
size
=
"
sm
"
style
=
{{
background
:
'
#91877F
'
,
borderColor
:
'
#91877F
'
}}
className
=
"
mx-3
"
type
=
"
button
"
onClick
=
{
postClick
}
>
주소
찾기
<
/
B
utton
>
{
post
}
{
post
}
<
Form
.
Control
required
type
=
"
text
"
id
=
"
add2
"
size
=
"
sm
"
placeholder
=
"
상세주소
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
Form
.
Control
required
type
=
"
text
"
id
=
"
add
"
size
=
"
sm
"
value
=
{
address
.
full
}
disabled
=
{(
address
.
zone
==
null
)
?
false
:
true
}
className
=
"
mx-3
"
style
=
{{
width
:
'
330px
'
}}
><
/Form.Control
>
<
Form
.
Control
required
type
=
"
text
"
id
=
"
add2
"
size
=
"
sm
"
placeholder
=
"
상세주소
"
className
=
"
mx-sm-3
"
><
/Form.Control
>
<
Form
.
Control
.
Feedback
type
=
"
invalid
"
>
상세
주소를
입력하세요
.
<
/Form.Control.Feedback
>
<
Form
.
Control
.
Feedback
type
=
"
invalid
"
>
상세
주소를
입력하세요
.
<
/Form.Control.Feedback
>
<
/Col
>
<
/Form.Row
>
<
/Form.Row
>
<
/Form.Group
>
<
/Form.Group
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment