init
This commit is contained in:
parent
a758e7ddc0
commit
fbe7fc4e2b
20
src/App.vue
20
src/App.vue
@ -17,7 +17,9 @@ const gamePage = useTemplateRef('game-page');
|
||||
function startExploration(payload: { region: string; store: string; username: string }) {
|
||||
userData.value = payload;
|
||||
stage.value = 1;
|
||||
gamePage.value?.init();
|
||||
setTimeout(() => {
|
||||
gamePage.value?.init();
|
||||
}, 1);
|
||||
}
|
||||
|
||||
|
||||
@ -104,23 +106,21 @@ const gameKey = ref(10)
|
||||
|
||||
|
||||
|
||||
<Loader class="page" v-if="stage == -1" @loaded="stage = 0"
|
||||
style="z-index: 100;" />
|
||||
<Loader class="page" v-if="stage == -1" @loaded="startExploration" style="z-index: 100;" />
|
||||
|
||||
<Transition name="fade" mode="out-in">
|
||||
<Page1 class="page page-1" v-if="stage == 0" style="z-index: 99;"
|
||||
@start-exploration="startExploration" />
|
||||
<Page1 class="page page-1" v-if="stage == 0" style="z-index: 99;" @start-exploration="startExploration" />
|
||||
</Transition>
|
||||
|
||||
<Game class="page" :userdata="userData" :key="gameKey" v-if="stage >= 0"
|
||||
:style="{ opacity: stage === 1 ? 1 : 0 }" style="z-index: 98;"
|
||||
@cloud-down="cloudDown" @cloud-up="cloudUp" ref="game-page" @restart="gameKey++" />
|
||||
<Transition name="fade" mode="out-in">
|
||||
<Game class="page" :userdata="userData" :key="gameKey" v-if="stage >= 0" :style="{ opacity: stage === 1 ? 1 : 0 }"
|
||||
style="z-index: 98;" @cloud-down="cloudDown" @cloud-up="cloudUp" ref="game-page" @restart="gameKey++" />
|
||||
</Transition>
|
||||
|
||||
<div class="overlay page">
|
||||
<div class="bgm"
|
||||
style="position: absolute; top: 16vw;right: 8vw;width: 8vw; cursor: pointer;pointer-events: all;">
|
||||
<img src="./assets/开启音乐.webp" @click="playingBgm = false" alt=""
|
||||
v-if="playingBgm">
|
||||
<img src="./assets/开启音乐.webp" @click="playingBgm = false" alt="" v-if="playingBgm">
|
||||
<img src="./assets/关掉音乐.webp" @click="playingBgm = true" alt="" v-else>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -603,7 +603,7 @@ window.addEventListener('keydown', (e) => {
|
||||
<Transition name="fade">
|
||||
<div class="game-end" v-if="gameState == GAME_STATE.gameEnd">
|
||||
<GatheringCloud ref="gatheringCloud" />
|
||||
<Button @click="startQuiz" class="start-quiz-btn">开始答题</Button>
|
||||
|
||||
</div>
|
||||
</Transition>
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user