Skip to content

Commit

Permalink
Merge branch 'test'
Browse files Browse the repository at this point in the history
  • Loading branch information
SmallTeddy committed Dec 25, 2023
2 parents eccf459 + d7edf54 commit 798f5f4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
5 changes: 4 additions & 1 deletion src/views/Component/GameMenu.vue
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ const reshow = (): void => {
show.value = true;
if (info.value.rounds <= maxRounds && info.value.rounds > 1) {
setTimeout(() => {
if (['win', 'lose'].includes(state.value.gameState)) {
return show.value = true;
}
show.value = false;
}, 2000);
}
Expand All @@ -45,7 +48,7 @@ const menuController = () => {
* 游戏开始
*/
const startGame = (): void => {
if (state.value.gameState === 'win' || state.value.gameState === 'lose') {
if (['win', 'lose'].includes(state.value.gameState)) {
return;
}
showGameInfo.value = true
Expand Down
2 changes: 1 addition & 1 deletion src/views/Component/PlayerCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const cardCheckClick = (cardInfo: CardItem): void => {
setTimeout(() => {
emits('card-check', cardInfo)
}, 1000)
}, 3000)
}, 4500)
}
defineExpose({
Expand Down
6 changes: 3 additions & 3 deletions src/views/Game/GameMain.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import CheckCard from '@/views/Component/CheckCard.vue'
import DropCard from '@/views/Component/DropCard.vue';
import type { CardItem, LogItem, GameStatus } from '@/views/Type'
import { useGlobalState } from '@/store';
import { getRandomNumber, deepClone, nextRounds, clearAllThrottle } from '@/utils'
import { getRandomNumber, deepClone, nextRounds } from '@/utils'
// 全局信息变量
const state = useGlobalState()
Expand All @@ -27,7 +27,7 @@ const computerCardInfo: Ref<CardItem> | null = ref()
*/
const playerCardCheck = (cardInfo: CardItem): void => {
// 正在展示信息 就拒绝检查
if(showGameMenuRef.value.show){
if (showGameMenuRef.value.show) {
return;
}
if (playerCardInfo.value) {
Expand Down Expand Up @@ -102,7 +102,7 @@ watch(
() => state.value.gameState,
(gameState: GameStatus) => {
if (['init', 'win', 'lose'].includes(gameState)) {
state.value.rounds = 0
state.value.rounds = 1
state.value.dropedCardItems = []
state.value.gameLogItems = []
}
Expand Down

0 comments on commit 798f5f4

Please sign in to comment.