diff --git a/blogHomework.md b/blogHomework.md index 37b0ade..a307adf 100644 --- a/blogHomework.md +++ b/blogHomework.md @@ -473,7 +473,7 @@ if __name__ == '__main__': - 沈帅的回答 - > 我在这次任务中承担任务比较轻松 并且感觉学习速度较慢 希望在团队作业中能改善(沈帅) + > 苏炜杰表达能力有待提高 - 苏炜杰的回答 diff --git a/game/package.json b/game/package.json index 241bdf0..6ab111a 100644 --- a/game/package.json +++ b/game/package.json @@ -2,6 +2,7 @@ "dependencies": { "@material-ui/core": "^4.11.0", "@material-ui/icons": "^4.9.1", + "@material-ui/lab": "^4.0.0-alpha.56", "dayjs": "^1.9.3", "fontsource-roboto": "^3.0.3", "react": "^16.13.1", diff --git a/game/src/view/game.tsx b/game/src/view/game.tsx index 2fa4f0a..d1d3366 100644 --- a/game/src/view/game.tsx +++ b/game/src/view/game.tsx @@ -4,7 +4,8 @@ import Info from '../components/info'; import { imageList } from '../util/config'; import { useHistory, useLocation } from 'react-router-dom'; import GameBase from '../components/gameBase'; -import { Button } from '@material-ui/core'; +import { Button, Snackbar } from '@material-ui/core'; +import { Alert } from '@material-ui/lab'; import { getRandomItem } from '../util/gameData'; import { addGameRecord } from '../util/store'; import { getSteps } from '../util/prompt'; @@ -34,6 +35,8 @@ export default function Game(): JSX.Element { const [tipOpen, setTipOpen] = useState(false); // record dialog 是否打开 const [recordOpen, setRecordOpen] = useState(false); + // 成功 + const [successOpen, setSuccessOpen] = useState(false); // 路由数据 const myLocation = useLocation(); // 路由控制器 @@ -87,18 +90,13 @@ export default function Game(): JSX.Element { window.clearInterval(timeId); setTimeId(undefined); } - addGameRecord({ - serialNumber: myLocation.state.serialNumber, - steps: steps, - useTime: useTime, - src: src, - timeStamp: new Date().getTime(), - }); - myHistory.push('/record'); + setSuccessOpen(true); + window.clearInterval(timeId); } }, [serialNumber]); return (
+ {/* 提示按钮对话框 */} + {/* 战绩按钮对话框 */} { setRecordOpen(false); }} /> + {/* 成功消息条 */} + { + addGameRecord({ + serialNumber: myLocation.state.serialNumber, + steps: steps, + useTime: useTime, + src: src, + timeStamp: new Date().getTime(), + }); + myHistory.push('/record'); + }} + > + + 成功挑战本题,将会跳转至战绩页 + + + {/* 游戏上方页面信息 */} + {/* 游戏主要区域 */} value + stepKey); }} /> + {/* 按钮组 */}
{timeId !== undefined ? (