forked from cuixueshe/earthworm
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAuthRequired.vue
40 lines (37 loc) · 1.08 KB
/
AuthRequired.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<template>
<CommonModal :show-modal="authRequireModalState">
<div className="modal-box">
<h3 className="font-bold text-lg mb-4">✨ 友情提示</h3>
<p class="py-4 text-center text-xl">注册以进行下一课的学习哦~ 😊</p>
<div className="modal-action">
<button
class="btn"
@click="hideAuthRequireModal"
>
取消
</button>
<button
class="btn"
@click="handleSignup"
>
去注册
</button>
</div>
</div>
</CommonModal>
</template>
<script setup lang="ts">
import { useAuthRequire } from "~/composables/main/authRequire";
import { useGameMode } from "~/composables/main/game";
import { signIn } from "~/services/auth";
import { useCourseStore } from "~/store/course";
const { authRequireModalState, hideAuthRequireModal } = useAuthRequire();
const { showQuestion } = useGameMode();
const courseStore = useCourseStore();
function handleSignup() {
hideAuthRequireModal();
courseStore.resetStatementIndex();
showQuestion();
signIn();
}
</script>