BuLi-Tipp weiter gemacht
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
<script lang="ts">
|
||||
<script lang="js">
|
||||
|
||||
export default {
|
||||
props: {
|
||||
users: {
|
||||
type: Array<any>,
|
||||
type: Array,
|
||||
required: true,
|
||||
},
|
||||
spieltage: {
|
||||
@@ -33,7 +33,7 @@ export default {
|
||||
<td v-for="spieltag in spieltage[0]">{{ spieltag.user.name }}</td>
|
||||
</tr>
|
||||
<tr v-for="spieltag, i in spieltage">
|
||||
<td>{{ i+1 }}</td>
|
||||
<td>{{ parseInt(i)+1 }}</td>
|
||||
|
||||
<!-- Modal -->
|
||||
|
||||
|
||||
@@ -25,9 +25,12 @@ export default {
|
||||
get(){
|
||||
return fetch(RitzenbergenLib.api("/bulitipp/get-users.php"))
|
||||
.then((response) => response.json())
|
||||
.then((result2) => {
|
||||
if(result2.reload) this.update();
|
||||
return result2.data;
|
||||
})
|
||||
.then((result) => {
|
||||
console.log(result);
|
||||
console.log(this.spieltage);
|
||||
result.forEach((user, i) => {
|
||||
let sum = 0;
|
||||
this.spieltage.forEach((spieltag) => {
|
||||
@@ -49,9 +52,21 @@ export default {
|
||||
spieltage: {
|
||||
get() {
|
||||
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: []
|
||||
},
|
||||
saison:{
|
||||
get(){
|
||||
return fetch(RitzenbergenLib.api("/bulitipp/saison.php"))
|
||||
.then((response) => response.text())
|
||||
.then((result)=> parseInt(result));
|
||||
},
|
||||
default: ""
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -185,9 +200,9 @@ export default {
|
||||
];
|
||||
},
|
||||
loading(){
|
||||
console.log(this.$asyncComputed.users);
|
||||
return this.$asyncComputed.users.updating || this.$asyncComputed.spieltage.updating;
|
||||
}
|
||||
},
|
||||
|
||||
},
|
||||
methods: {
|
||||
gs(i) {
|
||||
@@ -197,16 +212,20 @@ export default {
|
||||
});
|
||||
return result;
|
||||
},
|
||||
update(){
|
||||
location.reload();
|
||||
}
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
tippenoffen: false
|
||||
tippenoffen: false,
|
||||
debug: true
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<template>
|
||||
<Loading v-show="loading"/>
|
||||
<Loading v-show="loading && !debug" />
|
||||
<Navbar buttontext="Tippen" @clickbtn="tippenoffen = true" />
|
||||
|
||||
<section
|
||||
@@ -226,7 +245,7 @@ export default {
|
||||
<strong>Willkommen im Bundesliga Tippspiel</strong>
|
||||
</h1>
|
||||
<p class="mbr-fonts-style mbr-text mbr-white mb-4 display-7">
|
||||
Saison
|
||||
Saison {{ saison }}/{{ saison + 1 }}
|
||||
</p>
|
||||
<br /><br />
|
||||
</div>
|
||||
@@ -255,7 +274,6 @@ export default {
|
||||
<br />
|
||||
|
||||
<MyFooter />
|
||||
|
||||
</template>
|
||||
<style scoped>
|
||||
@import "../assets/css/bulitipp2.css";
|
||||
|
||||
Reference in New Issue
Block a user