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
butter-studio
Commits
228698d4
Commit
228698d4
authored
Aug 11, 2021
by
Kim, Subin
Browse files
관람료 정보 불러오기
parent
07d957af
Changes
1
Hide whitespace changes
Inline
Side-by-side
client/src/pages/TheaterPage.js
View file @
228698d4
import
{
useState
,
useEffect
}
from
'
react
'
import
{
useState
,
useEffect
}
from
'
react
'
import
TicketFeeTable
from
'
../components/Admin/TicketFeeTable
'
import
TicketFeeTable
from
'
../components/Admin/TicketFeeTable
'
import
TheaterInfo
from
'
../components/TheaterInfo
'
import
TheaterInfo
from
'
../components/TheaterInfo
'
import
cinemaApi
from
"
../apis/cinema.api.js
"
import
theaterApi
from
'
../apis/theater.api.js
'
import
theaterApi
from
'
../apis/theater.api.js
'
import
catchErrors
from
"
../utils/catchErrors.js
"
;
import
catchErrors
from
"
../utils/catchErrors.js
"
const
TheaterPage
=
()
=>
{
const
TheaterPage
=
()
=>
{
const
[
theaterTypeList
,
setTheaterTypeList
]
=
useState
([])
const
[
theaterTypeList
,
setTheaterTypeList
]
=
useState
([])
const
[
ticketFeeInfo
,
setTicketFeeInfo
]
=
useState
(
""
)
const
[
state
,
setState
]
=
useState
(
0
)
const
[
state
,
setState
]
=
useState
(
0
)
const
[
selectTheater
,
setSelectTheater
]
=
useState
(
0
)
const
[
selectTheater
,
setSelectTheater
]
=
useState
(
0
)
const
[
error
,
setError
]
=
useState
(
""
)
const
[
error
,
setError
]
=
useState
(
""
)
useEffect
(()
=>
{
useEffect
(()
=>
{
getTicketFeeInfo
()
getTicketFeeInfo
()
getTheaterType
()
},
[])
},
[])
async
function
getT
icketFeeInfo
()
{
async
function
getT
heaterType
()
{
try
{
try
{
setError
(
""
)
setError
(
""
)
const
res
=
await
theaterApi
.
getTheaterType
()
const
res
=
await
theaterApi
.
getTheaterType
()
...
@@ -24,8 +27,18 @@ const TheaterPage = () => {
...
@@ -24,8 +27,18 @@ const TheaterPage = () => {
}
}
}
}
async
function
getTicketFeeInfo
()
{
try
{
setError
(
""
)
const
res
=
await
cinemaApi
.
getCinemaInfo
()
setTicketFeeInfo
(
res
.
moreFeeInfo
)
}
catch
(
error
)
{
catchErrors
(
error
,
setError
)
}
}
return
(
return
(
<
div
>
<>
<
div
>
<
div
>
<
ul
className
=
"
nav nav-tabs justify-content-center my-4 border-0
"
id
=
"
myTab
"
role
=
"
tablist
"
>
<
ul
className
=
"
nav nav-tabs justify-content-center my-4 border-0
"
id
=
"
myTab
"
role
=
"
tablist
"
>
<
li
className
=
"
nav-item
"
role
=
"
presentation
"
>
<
li
className
=
"
nav-item
"
role
=
"
presentation
"
>
...
@@ -56,11 +69,12 @@ const TheaterPage = () => {
...
@@ -56,11 +69,12 @@ const TheaterPage = () => {
<
/ol
>
<
/ol
>
<
/nav
>
<
/nav
>
<
TicketFeeTable
selectTheater
=
{
selectTheater
}
/
>
<
TicketFeeTable
selectTheater
=
{
selectTheater
}
/
>
<
div
className
=
"
text-start mt-5
"
style
=
{{
whiteSpace
:
"
pre-line
"
}}
>
{
ticketFeeInfo
}
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/
div
>
<
/
>
)
)
}
}
...
...
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