From 2939911c993c3817d841d4cb4660aa940e478cc0 Mon Sep 17 00:00:00 2001 From: Philipp Dormann Date: Mon, 17 Mar 2025 22:35:12 +0100 Subject: [PATCH] feat: loading screen --- src/views/Profile.vue | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/src/views/Profile.vue b/src/views/Profile.vue index 562647c..6300a2c 100644 --- a/src/views/Profile.vue +++ b/src/views/Profile.vue @@ -11,15 +11,18 @@ dark:text-gray-200 "> -

-

Team: {{ state.group }}

+
+

+

Team: {{ state.group }}

+
+

Daten werden geladen...

-
+
@@ -287,7 +290,8 @@
+ class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">{{ + $t('vorname_des_sponsors') }} @@ -295,7 +299,8 @@
+ class="block mb-2 text-sm text-gray-700 font-medium dark:text-white">{{ + $t('nachname_des_sponsors') }} @@ -305,23 +310,23 @@
- +
- +
- + @@ -337,7 +342,8 @@ class="shrink-0 mt-1.5 border-gray-200 rounded-sm text-blue-600 focus:ring-blue-500 dark:bg-neutral-800 dark:border-neutral-700 dark:checked:bg-blue-500 dark:checked:border-blue-500 dark:focus:ring-offset-gray-800">
- +
@@ -491,6 +497,7 @@ import { toCanvas } from "bwip-js"; import Footer from "@/components/Footer.vue"; import { useI18n } from 'vue-i18n' const { t } = useI18n() +const loadstate = ref("loading") const mode = ref("") // const newsponsor_check = ref(false) @@ -566,6 +573,7 @@ function getReadableDistance(distance) { axios .get(`${config.baseurl}api/runners/me/${accesstoken}`) .then(({ data }) => { + loadstate.value = "loaded" state.phone = data.phone; state.email = data.email; state.firstname = data.firstname; @@ -577,6 +585,7 @@ axios state.barcode = textToBase64Barcode(data.id ?? "???"); }) .catch((error) => { + loadstate = "error" toast.clear(); toast.error(t('profil_konnte_nicht_geladen_werden')); });