From 1fffabfae87a0f3b75c4dc13803f9cdb5519681d Mon Sep 17 00:00:00 2001 From: JianMiau Date: Mon, 13 May 2024 14:50:38 +0800 Subject: [PATCH] =?UTF-8?q?[mod]=20=E5=B0=8F=E6=94=B9=20=E3=84=8F=E3=84=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- index.html | 5 +++++ src/Play.tsx | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/index.html b/index.html index edd60be..abdb158 100644 --- a/index.html +++ b/index.html @@ -5,6 +5,11 @@ + + + + + 羽球團 diff --git a/src/Play.tsx b/src/Play.tsx index 5a6d7ea..01826ab 100644 --- a/src/Play.tsx +++ b/src/Play.tsx @@ -9,10 +9,11 @@ export default function Play() { const navigate: NavigateFunction = useNavigate(); const { id } = useParams(); const [data, setData] = useState(null) - const [team, setTeam] = useState([]) + const [time, setTime] = useState("") const [winTeam, setWinTeam] = useState("") const [score, setScore] = useState("") - const [scoreList, setScoreList] = useState([]) + const [team, setTeam] = useState([]) + const [scoreList, setScoreList] = useState([]) function onClickLobby(): void { navigate(`/`); @@ -35,7 +36,6 @@ export default function Play() { axios.request(config) .then((response) => { - // console.log(JSON.stringify(response.data)); const data: any = response.data[0]; setData(data); document.title = dayjs(data.time * 1000).format("YYYY-MM-DD HH:mm:ss") @@ -53,6 +53,7 @@ export default function Play() { const team: string[] = JSON.parse(data.team).flat(); const winTeam: string[] = JSON.parse(data.team)[win]; const scoreList: number[] = JSON.parse(data.scoreList); + setTime(dayjs(data.time * 1000).format("YYYY-MM-DD HH:mm:ss")); setTeam(team); setWinTeam(winTeam[0] + "、" + winTeam[1]); setScore(score[0] + ":" + score[1]); @@ -69,6 +70,9 @@ export default function Play() {

{team[0]}、{team[1]} vs {team[2]}、{team[3]}

+ +

{time}

+