BuLi-Tipp weiter gemacht

This commit is contained in:
R40fendt
2025-05-05 16:22:47 +02:00
parent dfc0420121
commit 85db79ba5d
2 changed files with 40 additions and 22 deletions

View File

@@ -1,9 +1,9 @@
<script lang="ts"> <script lang="js">
export default { export default {
props: { props: {
users: { users: {
type: Array<any>, type: Array,
required: true, required: true,
}, },
spieltage: { spieltage: {
@@ -33,7 +33,7 @@ export default {
<td v-for="spieltag in spieltage[0]">{{ spieltag.user.name }}</td> <td v-for="spieltag in spieltage[0]">{{ spieltag.user.name }}</td>
</tr> </tr>
<tr v-for="spieltag, i in spieltage"> <tr v-for="spieltag, i in spieltage">
<td>{{ i+1 }}</td> <td>{{ parseInt(i)+1 }}</td>
<!-- Modal --> <!-- Modal -->

View File

@@ -25,9 +25,12 @@ export default {
get(){ get(){
return fetch(RitzenbergenLib.api("/bulitipp/get-users.php")) return fetch(RitzenbergenLib.api("/bulitipp/get-users.php"))
.then((response) => response.json()) .then((response) => response.json())
.then((result2) => {
if(result2.reload) this.update();
return result2.data;
})
.then((result) => { .then((result) => {
console.log(result); console.log(result);
console.log(this.spieltage);
result.forEach((user, i) => { result.forEach((user, i) => {
let sum = 0; let sum = 0;
this.spieltage.forEach((spieltag) => { this.spieltage.forEach((spieltag) => {
@@ -49,9 +52,21 @@ export default {
spieltage: { spieltage: {
get() { get() {
return fetch(RitzenbergenLib.api("/bulitipp/ts.php")) return fetch(RitzenbergenLib.api("/bulitipp/ts.php"))
.then((response) => response.json()); .then((response) => response.json())
.then((result2) => {
if(result2.reload) this.update();
return result2.data;
});
}, },
default: [] default: []
},
saison:{
get(){
return fetch(RitzenbergenLib.api("/bulitipp/saison.php"))
.then((response) => response.text())
.then((result)=> parseInt(result));
},
default: ""
} }
}, },
computed: { computed: {
@@ -185,9 +200,9 @@ export default {
]; ];
}, },
loading(){ loading(){
console.log(this.$asyncComputed.users);
return this.$asyncComputed.users.updating || this.$asyncComputed.spieltage.updating; return this.$asyncComputed.users.updating || this.$asyncComputed.spieltage.updating;
} },
}, },
methods: { methods: {
gs(i) { gs(i) {
@@ -197,17 +212,21 @@ export default {
}); });
return result; return result;
}, },
update(){
location.reload();
}
}, },
data(){ data(){
return { return {
tippenoffen: false tippenoffen: false,
debug: true
} }
} }
}; };
</script> </script>
<template> <template>
<Loading v-show="loading"/> <Loading v-show="loading && !debug" />
<Navbar buttontext="Tippen" @clickbtn="tippenoffen=true" /> <Navbar buttontext="Tippen" @clickbtn="tippenoffen = true" />
<section <section
class="header16 cid-u6k7q0xIhk bulitipp mbr-fullscreen mbr-parallax-background" class="header16 cid-u6k7q0xIhk bulitipp mbr-fullscreen mbr-parallax-background"
@@ -226,7 +245,7 @@ export default {
<strong>Willkommen im Bundesliga Tippspiel</strong> <strong>Willkommen im Bundesliga Tippspiel</strong>
</h1> </h1>
<p class="mbr-fonts-style mbr-text mbr-white mb-4 display-7"> <p class="mbr-fonts-style mbr-text mbr-white mb-4 display-7">
Saison Saison {{ saison }}/{{ saison + 1 }}
</p> </p>
<br /><br /> <br /><br />
</div> </div>
@@ -234,7 +253,7 @@ export default {
</div> </div>
</section> </section>
<Modal v-show="tippenoffen" @closemodal="tippenoffen=false"> <Modal v-show="tippenoffen" @closemodal="tippenoffen = false">
<h1>Test</h1> <h1>Test</h1>
</Modal> </Modal>
<Uebersicht :users="users" /> <Uebersicht :users="users" />
@@ -255,7 +274,6 @@ export default {
<br /> <br />
<MyFooter /> <MyFooter />
</template> </template>
<style scoped> <style scoped>
@import "../assets/css/bulitipp2.css"; @import "../assets/css/bulitipp2.css";