diff --git a/frontend/src/layouts/MyLayout.vue b/frontend/src/layouts/MyLayout.vue index 6bc4eb9..002fb32 100644 --- a/frontend/src/layouts/MyLayout.vue +++ b/frontend/src/layouts/MyLayout.vue @@ -43,6 +43,20 @@ Startseite + + + + + + QR-Code Scanner + + - +
Jetzt ist eine gute Zeit, etwas Neues zu beginnen.
- +
@@ -25,15 +25,21 @@ data() { return { reward: false, + cacheID: "", + cacheName: "", + rankingPoints: "", end1: "Gut gemacht, Du hast alle Stationen dieses Cache gefunden. Dir wurden ", end2: " Punkte gutgeschrieben." //TODO Punkte wirklich gutschreiben, ggf. Cache auf erledigt setzen } }, computed: { isLoggedIn() { - return this.$store.getters['auth/GET_ADMINSTATE']; //TODO Methode umschreiben + return localStorage.getItem('userToken'); //TODO Methode umschreiben --> funktioniert das? } }, + created() { + this.fetchData(); + }, methods: { fetchData() { this.$axios.get('/api/allCaches') @@ -43,10 +49,11 @@ console.log(this.data); console.log(response.data); const cache = response.data.find(cache => cache.id === Number(this.$route.params.cache)); - this.data.cacheName = cache.name; - this.data.cachePoints = cache.rankingPoints; + this.cacheName = cache.name; + this.rankingPoints = cache.rankingPoints; + this.cacheID = this.$route.params.cache; }) + }, } - } } diff --git a/frontend/src/pages/qr-code-test.vue b/frontend/src/pages/qr-scanner.vue similarity index 95% rename from frontend/src/pages/qr-code-test.vue rename to frontend/src/pages/qr-scanner.vue index 7bf52e7..087cb71 100644 --- a/frontend/src/pages/qr-code-test.vue +++ b/frontend/src/pages/qr-scanner.vue @@ -23,9 +23,6 @@ -

Last result: {{ result }}

-

Validating: {{ validating }}

-

is Valid: {{ isValid }}

diff --git a/frontend/src/router/routes.js b/frontend/src/router/routes.js index 2971fb9..d2e6391 100644 --- a/frontend/src/router/routes.js +++ b/frontend/src/router/routes.js @@ -16,9 +16,9 @@ const routes = [ children: [{ path: "", component: () => import("pages/Cache.vue") }] }, { - path: "/qr-code-test/", + path: "/qr-scanner/", component: () => import("layouts/MyLayout.vue"), - children: [{ path: "", component: () => import("pages/qr-code-test.vue") }] + children: [{ path: "", component: () => import("pages/qr-scanner.vue") }] }, { path: "/cache/:id", @@ -55,6 +55,11 @@ const routes = [ component: () => import("layouts/MyLayout.vue"), children: [{ path: "", component: () => import("pages/CacheStart.vue") }] }, + { + path: "/CacheEnd/:cache/", + component: () => import("layouts/MyLayout.vue"), + children: [{ path: "", component: () => import("pages/CacheEnd.vue") }] + }, { path: "/profile/", component: () => import("layouts/MyLayout.vue"),