feat: carousel

This commit is contained in:
skytek_xinliang
2026-09-21 14:27:35 +08:00
parent d05ac13c27
commit be1cf7d978
5 changed files with 210 additions and 319 deletions
+7 -8
View File
@@ -5,12 +5,15 @@ import Checkin from "@/pages/checkin.vue";
import CheckinDetail from "@/pages/checkinDetail.vue";
import Course from "@/pages/course.vue";
import Index from "@/pages/index.vue";
import Introduction from "@/pages/introduction.vue";
import Login from "@/pages/login.vue";
import Profile from "@/pages/profile.vue";
import Register from "@/pages/register.vue";
import SelfAssessment from "@/pages/self-assessment.vue";
import { APPOINTMENT_ENABLED, CHECKIN_ENABLED } from "@/config/features";
import {
APPOINTMENT_ENABLED,
BODY_COMPOSITION_ENABLED,
CHECKIN_ENABLED,
} from "@/config/features";
import { useAppStore } from "@/stores/app";
import { useCourseStore } from "@/stores/course";
import { getApiErrorStatus } from "@/utils/api-error";
@@ -26,12 +29,6 @@ const router = createRouter({
name: "home",
component: Index,
},
{
path: "/introduction",
name: "introduction",
component: Introduction,
meta: { title: "計畫簡介|運動玩轉健康力" },
},
{
path: "/login",
name: "login",
@@ -96,12 +93,14 @@ const router = createRouter({
});
const APPOINTMENT_PATH = /^\/appointment(?:\/|$)/;
const BODY_COMPOSITION_PATH = /^\/body-composition(?:\/|$)/;
const CHECKIN_PATH = /^\/checkin(?:\/|$)/;
// 簡單的導航守衛:只有標記需要登入的頁面會導向登入頁
router.beforeEach(async (to) => {
if (
(!APPOINTMENT_ENABLED && APPOINTMENT_PATH.test(to.path)) ||
(!BODY_COMPOSITION_ENABLED && BODY_COMPOSITION_PATH.test(to.path)) ||
(!CHECKIN_ENABLED && CHECKIN_PATH.test(to.path))
) {
return { name: "home" };