From c3eb32a78f15e14519d60cdfeca7be6fd0795010 Mon Sep 17 00:00:00 2001 From: Jiwon Yoon Date: Wed, 11 Aug 2021 00:07:41 +0900 Subject: [PATCH] =?UTF-8?q?=EB=B2=84=EA=B7=B8=EC=9E=A1=EA=B8=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/public/images/moon.svg | 1 + client/public/images/sun.svg | 1 + client/src/components/Admin/TimeTable.js | 11 ++++++++--- client/src/components/TheaterInfo.js | 21 +++++++++++---------- client/src/pages/MoviePage.js | 10 +++++----- client/src/pages/PaymentPage/PaymentPage.js | 2 +- client/src/pages/TicketingPage.js | 12 ++++++------ client/src/pages/TicketingSeatPage.js | 4 +++- server/controllers/movie.controller.js | 2 +- 9 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 client/public/images/moon.svg create mode 100644 client/public/images/sun.svg diff --git a/client/public/images/moon.svg b/client/public/images/moon.svg new file mode 100644 index 0000000..ba1f379 --- /dev/null +++ b/client/public/images/moon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/public/images/sun.svg b/client/public/images/sun.svg new file mode 100644 index 0000000..d08f5e1 --- /dev/null +++ b/client/public/images/sun.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/client/src/components/Admin/TimeTable.js b/client/src/components/Admin/TimeTable.js index 277d390..893e32c 100644 --- a/client/src/components/Admin/TimeTable.js +++ b/client/src/components/Admin/TimeTable.js @@ -51,7 +51,10 @@ const TimeTable = ({ ticketInfo = { movieId: 0 }, setTicketInfo }) => { ...ticketInfo, timetableId: time.id, time: time.date.split('T')[0] + " " + hours + ":" + mins, - selectedTheater: time.theater.theaterName + selectedTheater: time.theater.theaterName, + theaterId:time.theaterId, + partTime: time.partTime, + week: time.week }) } @@ -62,7 +65,7 @@ const TimeTable = ({ ticketInfo = { movieId: 0 }, setTicketInfo }) => { timeList.map(el =>
{el.theaterName} 관 /

{el.theaterTypeName}

{el.timetable.map(time => { - console.log("timetable==",time) + console.log("timetable==", time) if (ticketInfo) return
handleClick(time)}> @@ -81,7 +84,9 @@ const TimeTable = ({ ticketInfo = { movieId: 0 }, setTicketInfo }) => {
})}
) - :

서버에 저장되어 있는 상영시간표가 존재하지 않습니다.
아래의 양식을 작성해 새로운 상영시간표를 등록해주세요.

} + :

서버에 저장되어 있는 상영시간표가 존재하지 않습니다. + {/*
아래의 양식을 작성해 새로운 상영시간표를 등록해주세요. */} +

} ) } diff --git a/client/src/components/TheaterInfo.js b/client/src/components/TheaterInfo.js index a30ad61..bc33b49 100644 --- a/client/src/components/TheaterInfo.js +++ b/client/src/components/TheaterInfo.js @@ -53,15 +53,16 @@ const TheaterInfo = () => { try { const response = await cinemaApi.getCinemaInfo() const response2 = await theaterApi.getAll() - setCinemaInfo({ ...response, theaterNum: response2.length }) - setCurrentInfo({ - name: "대중교통 안내", - title: "transportation", - information: response.transportation - }) + if (response && response2) { + setCinemaInfo({ ...response, theaterNum: response2.length }) + setCurrentInfo({ + name: "대중교통 안내", + title: "transportation", + information: response.transportation + }) + } } catch (error) { - // catchErrors(error, setError) - console.log(error) + catchErrors(error, setError) } } @@ -76,7 +77,7 @@ const TheaterInfo = () => { return ( <> {cinemaInfo ? -
+

{cinemaInfo.cinemaName}

@@ -112,7 +113,7 @@ const TheaterInfo = () => {
: -
+
극장정보를 불러올 수 없습니다.
} diff --git a/client/src/pages/MoviePage.js b/client/src/pages/MoviePage.js index 2367888..94bd0fb 100644 --- a/client/src/pages/MoviePage.js +++ b/client/src/pages/MoviePage.js @@ -66,7 +66,7 @@ const MoviePage = ({ location }) => {

{movieInfo.title}

-

예매율: {Math.round((movieInfo.ticket_sales / (movieInfo.totalReservationRate.totalReservationRate || 1)) * 100)}% 누적관객수: {movieInfo.ticket_sales}명

+

예매율: {Math.round((movieInfo.ticket_sales / (movieInfo.totalReservationRate.totalReservationRate || 1)) * 100)}%

{movieInfo.director || movieInfo.cast ? <> @@ -101,9 +101,9 @@ const MoviePage = ({ location }) => {
  • -
  • + {/*
  • -
  • + */}
    @@ -113,9 +113,9 @@ const MoviePage = ({ location }) => {
    -
    + {/*
    관람평
    -
    +
    */}
    diff --git a/client/src/pages/PaymentPage/PaymentPage.js b/client/src/pages/PaymentPage/PaymentPage.js index 49c481e..aa965bb 100644 --- a/client/src/pages/PaymentPage/PaymentPage.js +++ b/client/src/pages/PaymentPage/PaymentPage.js @@ -211,7 +211,7 @@ const Payment = ({ location }) => {
    {ticketInfo.title}
    {ticketInfo.cinema}
    {ticketInfo.time}
    -
    {ticketInfo.selectedTheater}관 {ticketInfo.selectedSeats.map(el => String.fromCharCode(parseInt(el.split('-')[0]) + 65) + el.split('-')[1]) + ' '}
    +
    {ticketInfo.selectedTheater}관 {ticketInfo.selectedSeats.map(el => String.fromCharCode(parseInt(el.split('-')[0]) + 64) + el.split('-')[1]) + ' '}
    성인: {ticketInfo.adult}명
    청소년: {ticketInfo.youth}명
    diff --git a/client/src/pages/TicketingPage.js b/client/src/pages/TicketingPage.js index 356b1f2..26af9a5 100644 --- a/client/src/pages/TicketingPage.js +++ b/client/src/pages/TicketingPage.js @@ -57,7 +57,7 @@ const TicketingPage = ({ location }) => { } } return ( -
    +

    영화

    @@ -73,12 +73,12 @@ const TicketingPage = ({ location }) => {
    -
    +
    {movieInfo ? 영화포스터 :
    영화선택
    }
    -
    +
    극장선택
    {movieInfo && ticketInfo.cinema ?
      @@ -90,16 +90,16 @@ const TicketingPage = ({ location }) => { :
      }
    -
    좌석선택
    +
    좌석선택
    {movieInfo && ticketInfo.cinema && ticketInfo.timetableId ? - 예매하기 + 예매하기 - : 예매하기 + : 예매하기 }
    diff --git a/client/src/pages/TicketingSeatPage.js b/client/src/pages/TicketingSeatPage.js index c9c5855..db5fb13 100644 --- a/client/src/pages/TicketingSeatPage.js +++ b/client/src/pages/TicketingSeatPage.js @@ -63,7 +63,9 @@ const TicketingSeatPage = ({ location }) => { theaterTypeId: theaterInfo.theatertypeId } }) - const basicFee = response3.data[0].day + response3.data[0].defaultPrice + response3.data[0].weekdays + const week = ticketInfo.week + const partTime = ticketInfo.partTime + const basicFee = response3.data[0][partTime] + response3.data[0].defaultPrice + response3.data[0][week] setTicketFee({ adult: basicFee + response3.data[0].adult, youth: basicFee + response3.data[0].youth, diff --git a/server/controllers/movie.controller.js b/server/controllers/movie.controller.js index 785c6ee..e725be8 100644 --- a/server/controllers/movie.controller.js +++ b/server/controllers/movie.controller.js @@ -137,7 +137,7 @@ const getMovieList = async (req, res) => { } } elements.sort(function (a, b) { - return a.release_date - b.release_date + return b.release_date - a.release_date }) res.json(elements) } else { -- GitLab