BuLi-Tipp weiter gemacht
This commit is contained in:
@@ -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 -->
|
||||||
|
|
||||||
|
|||||||
@@ -25,20 +25,23 @@ 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) => {
|
||||||
let points = spieltag.find((element) => {
|
let points = spieltag.find((element) => {
|
||||||
return element.user.id === user.id;
|
return element.user.id === user.id;
|
||||||
|
});
|
||||||
|
sum += points.points;
|
||||||
});
|
});
|
||||||
sum += points.points;
|
user.points = sum;
|
||||||
});
|
});
|
||||||
user.points = sum;
|
return result;
|
||||||
});
|
|
||||||
return result;
|
|
||||||
}).catch((error) => {
|
}).catch((error) => {
|
||||||
return null;
|
return null;
|
||||||
});
|
});
|
||||||
@@ -49,10 +52,22 @@ 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";
|
||||||
|
|||||||
Reference in New Issue
Block a user