|
@@ -1,11 +1,13 @@
|
|
|
<script setup>
|
|
|
import { ref, reactive } from "vue";
|
|
|
+import { useRouter } from "vue-router";
|
|
|
import { useMainStore } from "@/stores/store";
|
|
|
import { useI18n } from "vue-i18n";
|
|
|
import "animate.css";
|
|
|
import Footer from "../components/Footer.vue";
|
|
|
|
|
|
const { t } = useI18n();
|
|
|
+const router = useRouter();
|
|
|
const store = useMainStore();
|
|
|
|
|
|
// let assignGender = ref("");
|
|
@@ -25,6 +27,22 @@ function setGender(value) {
|
|
|
store.assignGender = value;
|
|
|
console.log("setGender", store.assignGender);
|
|
|
}
|
|
|
+
|
|
|
+let alertShow = ref(false);
|
|
|
+
|
|
|
+function check() {
|
|
|
+ console.log("store.assignGender", store.assignGender);
|
|
|
+ if (store.assignGender === "") {
|
|
|
+ // alert("尚未選擇性別");
|
|
|
+ alertShow.value = true;
|
|
|
+ setTimeout(() => {
|
|
|
+ alertShow.value = false;
|
|
|
+ }, 2000);
|
|
|
+ } else {
|
|
|
+ alertShow.value = false;
|
|
|
+ router.push("/step3");
|
|
|
+ }
|
|
|
+}
|
|
|
</script>
|
|
|
|
|
|
<template>
|
|
@@ -40,11 +58,21 @@ function setGender(value) {
|
|
|
<v-icon :icon="item.icon" color="white"></v-icon>
|
|
|
<p>{{ t(item.value) }}</p>
|
|
|
</button>
|
|
|
+
|
|
|
+ <div v-if="alertShow" class="alert-item">
|
|
|
+ <v-alert border="top" type="warning" variant="outlined" class="mt-5">
|
|
|
+ 尚未選擇
|
|
|
+ </v-alert>
|
|
|
+ </div>
|
|
|
</div>
|
|
|
|
|
|
- <router-link to="/step3" class="main-btn">
|
|
|
+ <button @click="check()" to="/step3" class="main-btn">
|
|
|
+ {{ t("next_step") }}
|
|
|
+ </button>
|
|
|
+
|
|
|
+ <!-- <router-link to="/step3" class="main-btn">
|
|
|
{{ t("next_step") }}
|
|
|
- </router-link>
|
|
|
+ </router-link> -->
|
|
|
|
|
|
<Footer url="/step1" />
|
|
|
</div>
|