Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sw0501 committed Dec 6, 2023
2 parents ffd05f3 + b8d6165 commit ba5b19f
Show file tree
Hide file tree
Showing 15 changed files with 219 additions and 184 deletions.
4 changes: 4 additions & 0 deletions Backend/Frontend/creative/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import SubwayPage from "./page/subwaypage/SubwayPage.tsx"
import SubwayDetailPage from "./page/subwaypage/SubwayDetailPage.tsx"
import SubwayElevatorPage from "./page/subwaypage/SubwayElevator.tsx";
import SubwayBathChairPage from "./page/subwaypage/SubwayBathchair.tsx";
import SubwayTransferPAge from "./page/subwaypage/SubwayTransferPage.tsx";
import SubwayTranferDetailPage from "./page/subwaypage/SubwayTransferDetailPage.tsx";
import SignPage from "./page/SignPage.tsx";
import SignDetailPage from "./page/SIgnDetailPage.tsx";

Expand All @@ -20,6 +22,8 @@ function App() {
<Route path="/subway/detail/:stCd/:stNm" element={<SubwayDetailPage />} />
<Route path="/subway/elevator/:stCd/:stNm/:railCd/:lnCd" element={<SubwayElevatorPage />} />
<Route path="/subway/bathchair/:stCd/:stNm/:railCd/:lnCd" element={<SubwayBathChairPage />} />
<Route path="/subway/transfer/:stCd/:stNm/:railCd/:lnCd" element={<SubwayTransferPAge/>}/>
<Route path="/subway/transfer/detail/:stCd/:stNm/:railCd/:lnCd/:prevStinCd/:chthTgtLn/:chtnNextStinCd" element={<SubwayTranferDetailPage/>}/>
<Route path="/sign" element={<SignPage/>}/>
<Route path="/sign/detail" element={<SignDetailPage/>}/>
</Routes>
Expand Down
2 changes: 1 addition & 1 deletion Backend/Frontend/creative/src/component/auth/Api.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import axios from "axios"

export const api = axios.create({
baseURL: "https://34.145.39.241:3005"
baseURL: "https://www.easy-taza.site:3005"
})

5 changes: 2 additions & 3 deletions Backend/Frontend/creative/src/component/map/SignMapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,15 @@ const Mapping = () => {
const [map,setMap] = useState(null);
const [start,setStart] = useState<any>(null);
const [end,setEnd] = useState<any>(null);
const [prev,setPrev] = useState<any>(start);
const position = useSelector((state:RootState) => state.map.position)
const {curPosition} = usePosition(geolocationOptions);
const state = useSelector((state:RootState)=>state.sign.State);
const tmY = curPosition ? curPosition.tmY: position.tmY;
const tmX = curPosition ? curPosition.tmX: position.tmX;
useEffect(() => {
const container = document.getElementById("signmap");
const x = position.tmX!==0?Number(position.tmX):tmX!==0?tmX:37.55068403524657;
const y = position.tmY!==0?Number(position.tmY):tmY!==0?tmY:127.07411251036736;
const x = position.tmX!==0?Number(position.tmX):tmX!==0?tmX:127.07411251036736;
const y = position.tmY!==0?Number(position.tmY):tmY!==0?tmY:37.55068403524657;
const options = {
center: new window.kakao.maps.LatLng(y, x),
level: 3,
Expand Down
4 changes: 2 additions & 2 deletions Backend/Frontend/creative/src/component/map/SubwayMapping.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const Mapping = () => {
const tmX = curPosition ? curPosition.tmX: position.tmX;
useEffect(() => {
const container = document.getElementById("subwaymap");
const x = position.tmX!==0?Number(position.tmX):tmX!==0?tmX:37.55068403524657;
const y = position.tmY!==0?Number(position.tmY):tmY!==0?tmY:127.07411251036736;
const x = position.tmX!==0?Number(position.tmX):tmX!==0?tmX:127.07411251036736;
const y = position.tmY!==0?Number(position.tmY):tmY!==0?tmY:37.55068403524657;
const options = {
center: new window.kakao.maps.LatLng(y, x),
level: 3,
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const SubwayForm = () => {
dispatch(SubwayActions.addSubwayInfo(data))
dispatch(MapActions.Onsubwaymode())
}).catch(error => {
console.log(error)
alert("데이터를 받아오지 못했습니다.")
});

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import React,{useEffect, useState} from "react";
import styled from "styled-components";
import { api } from "../../auth/Api.ts"

const StyledSubwayTransferDetail = styled.main`
display:flex;
flex-direction:column;
align-items: start;
justify-content: space-evenly;
width: 98vw;
height: 40vh;
border: 4px solid #FFD12D;
overflow: auto;
`
const StyledTransferDetailLi = styled.span`
font-family: 'Pretendard-Regular';
font-weight: 600;
margin: 2%;
font-size: 1em;
`

const SubwayTranferDetail = ({param,setImage}:any) => {
const [tranferInfo,setTransferInfo] = useState<any>();
useEffect(() => {
const stCd = param.stCd;
const stNm = param.stNm;
const railCd = param.railCd;
const lnCd = param.lnCd;
const prevStinCd = param.prevStinCd;
const chthTgtLn = param.chthTgtLn;
const chtnNextStinCd = param.chtnNextStinCd;
const getDetail = async () => {
await api.get(`/subway/transferMove/transferInfo/${stCd}/${stNm}/${railCd}/${lnCd}/${prevStinCd}/${chthTgtLn}/${chtnNextStinCd}`)
.then(res => {
const { data } = res;
setTransferInfo(data)
setImage(data[0].imgPath)
}).catch(error=>{
console.log(error)
})
}
getDetail()
}, [param])
return(
<StyledSubwayTransferDetail>
{tranferInfo&&(
<StyledTransferDetailLi>
{tranferInfo[0].stMovePath} {">>"} {tranferInfo[0].edMovePath}
</StyledTransferDetailLi>)}
{tranferInfo&&tranferInfo.map((ele:any,index:number)=>(
<StyledTransferDetailLi key={index}>
{ele.mvContDtl}
</StyledTransferDetailLi>
))}
</StyledSubwayTransferDetail>
)
}

export default SubwayTranferDetail
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import React,{useEffect, useState} from "react";
import styled from "styled-components";
import { api } from "../../auth/Api.ts"
import { Link } from "react-router-dom";

const StyledSubwayTransferDetail = styled.main`
display:flex;
flex-direction:column;
align-items: start;
justify-content: space-evenly;
width: 98vw;
height: 40vh;
background-color:white;
border: 4px solid #FFD12D;
overflow: auto;
.TransferLink{
width: 100%;
text-decoration:none;
list-style:none;
color: #000000;
}
`

const StyledTransferDetailLi = styled.span`
font-family: 'Pretendard-Regular';
font-weight: 600;
margin-left: 5%;
border-bottom: 1px solid;
font-size: 1em;
`
/*
/subway/transferMove/transferInfo/:stCd/:stNm/:railCd/:lnCd/:prevStinCd/:chthTgtLn/:chtnNextStinCd
*/

const SubwayTranferDetail = ({param}:any) => {
const [source,setSource] = useState<[]>()
const [transfer,setTransfer] = useState<[]>()
useEffect(() => {
const stCd = param.stCd;
const stNm = param.stNm;
const railCd = param.railCd;
const lnCd = param.lnCd;
const getDetail = async () => {
await api.get(`/subway/transferMove/transferList/${stCd}/${stNm}/${railCd}/${lnCd}`)
.then(res => {
const { data } = res;
const {sourceStation,transferStation} = data
setSource(sourceStation);
setTransfer(transferStation);
}).catch(error=>{
alert("환승역이 아닙니다!")
window.location.href = `/subway/detail/${stCd}/${stNm}`
})
}
getDetail()
}, [param])
return(
<StyledSubwayTransferDetail>
{source&&source.map((sor:any)=>(
(transfer&&transfer.map((tran:any)=>(
<Link to={`/subway/transfer/detail/${param.stCd}/${param.stNm}/${param.railCd}/${param.lnCd}/${sor.stCd}/${tran.lnCd}/${tran.stCd}`} key={sor.stCd+tran.stCd} className="TransferLink">
<StyledTransferDetailLi>
{sor.stNm} - {tran.stNm}
</StyledTransferDetailLi>
</Link>
)))
))}
</StyledSubwayTransferDetail>
)
}

export default SubwayTranferDetail
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ const SubwayDetailPage = () => {
<div className={classes.subwaypage}>
<Header />
<div className={classes.main}>
<SubwayPanel text={["지하철편의시설"]} menu={<SubwayBar />} />
<SubwayDetail info={info} />
<SubwayPanel text={["지하철편의시설"]} menu={<SubwayBar />} />
<SubwayDetail info={info} />
</div>
<MenuBar/>
</div>
Expand Down

This file was deleted.

Loading

0 comments on commit ba5b19f

Please sign in to comment.