BuLi-Tipp Modals zu Tabelle und Paarungsergebnissen hinzugefügt
This commit is contained in:
@@ -6,7 +6,7 @@ TODO:
|
||||
|
||||
- Addhit
|
||||
- Galerie
|
||||
- BuLi-Tipp
|
||||
- BuLi-Tipp (Rangliste, Tippen und Übersicht)
|
||||
- Startseite
|
||||
- Footer, Texte?
|
||||
- Event Fotos
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
<script lang="js">
|
||||
import RitzenbergenLib from "../../ritzenbergenlib.ts";
|
||||
import Modal from "../Modal.vue";
|
||||
export default {
|
||||
props: {
|
||||
ergebnisse: {
|
||||
type: Object,
|
||||
type: Array,
|
||||
required: true
|
||||
},
|
||||
maxspieltag: {
|
||||
@@ -13,7 +14,18 @@ import RitzenbergenLib from "../../ritzenbergenlib.ts";
|
||||
},
|
||||
data(){
|
||||
return {
|
||||
RitzenbergenLib
|
||||
RitzenbergenLib,
|
||||
showmodal: false,
|
||||
modalindex: 0
|
||||
}
|
||||
},
|
||||
components: {
|
||||
Modal
|
||||
},
|
||||
methods: {
|
||||
getbulipunktesrc(spieltag,paarung){
|
||||
|
||||
return RitzenbergenLib.RitzenbergenLib.api("/bulitipp/buli-punkte.php?name=null&detail=spiel&spieltag="+spieltag+"&paarung="+paarung);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -22,17 +34,19 @@ import RitzenbergenLib from "../../ritzenbergenlib.ts";
|
||||
<section class="buli-results scroll-x" id="buliresults-section">
|
||||
<br /><br />
|
||||
<h2>Paarungsergebnisse {{ maxspieltag }}. Spieltag</h2>
|
||||
<Modal
|
||||
v-if="showmodal" @closemodal="showmodal = false">
|
||||
<iframe :src="getbulipunktesrc(maxspieltag,ergebnisse[modalindex].paarung.id)" frameborder="0"></iframe>
|
||||
</Modal>
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Paarung</td>
|
||||
<td>Ergebnis</td>
|
||||
</tr>
|
||||
<tr v-for="ergebnis in ergebnisse">
|
||||
<td>
|
||||
<!-- Modal -->
|
||||
<!--
|
||||
<iframe frameborder="0"></iframe> -->
|
||||
<tr v-for="ergebnis,i in ergebnisse">
|
||||
<td @click="showmodal = true; modalindex = i">
|
||||
|
||||
<span class="as-link">
|
||||
<span class="teams">
|
||||
<span class="team">
|
||||
@@ -58,4 +72,10 @@ import RitzenbergenLib from "../../ritzenbergenlib.ts";
|
||||
<style scoped>
|
||||
|
||||
@import "../../assets/css/bulitipp2.css";
|
||||
|
||||
iframe{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
</style>
|
||||
@@ -20,6 +20,18 @@ export default {
|
||||
this.modalOpen=true;
|
||||
this.spieltag=spieltag;
|
||||
this.user=user;
|
||||
},
|
||||
calcPoints(spiel){
|
||||
if(spiel.tipp==null) return 0;
|
||||
if(spiel.result==spiel.tipp) return 3;
|
||||
let differenztipp=spiel.tipp[0]-spiel.tipp[1];
|
||||
let differenz=spiel.result[0]-spiel.result[1];
|
||||
if(differenztipp==differenz) return 2;
|
||||
if(
|
||||
(spiel.tipp[0]>spiel.tipp[1] && spiel.result[0]>spiel.result[1]) ||
|
||||
(spiel.tipp[0]<spiel.tipp[1] && spiel.result[0]<spiel.result[1])
|
||||
) return 1;
|
||||
return 0;
|
||||
}
|
||||
},
|
||||
components: {
|
||||
@@ -29,7 +41,8 @@ export default {
|
||||
return {
|
||||
modalOpen: false,
|
||||
spieltag: null,
|
||||
user: null
|
||||
user: null,
|
||||
RitzenbergenLib: ritzenbergenlib.RitzenbergenLib
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -38,11 +51,17 @@ export default {
|
||||
asyncComputed: {
|
||||
modalContent: {
|
||||
get(){
|
||||
if(spieltag==null || user==null) return [];
|
||||
if(this.spieltag==undefined) return [];
|
||||
let params=new URLSearchParams({
|
||||
|
||||
spieltag: this.spieltag+1,
|
||||
user: this.ts[this.spieltag][this.user].user.id
|
||||
});
|
||||
return fetch(RitzenbergenLib.api("")+params.toString());
|
||||
return fetch(this.RitzenbergenLib.api("/bulitipp/spieltag-user.php?")+params.toString()).then((response)=>{
|
||||
return response.json();
|
||||
}).then((data)=>{
|
||||
return data.data;
|
||||
})
|
||||
;
|
||||
},
|
||||
default: []
|
||||
}
|
||||
@@ -63,10 +82,11 @@ export default {
|
||||
<td>Punkte</td>
|
||||
</tr>
|
||||
<tr v-for="spiel in modalContent">
|
||||
<td>0 - 0</td>
|
||||
<td>0 - 0</td>
|
||||
<td>0 - 0</td>
|
||||
<td>3</td>
|
||||
<td>{{ spiel.paarung.heim }} - {{ spiel.paarung.gast }}</td>
|
||||
<td>{{ spiel.result[0] }} - {{ spiel.result[1] }}</td>
|
||||
<td v-if="spiel.tipp!=null">{{ spiel.tipp[0] }} - {{ spiel.tipp[1] }}</td>
|
||||
<td v-else> - </td>
|
||||
<td>{{ calcPoints(spiel) }}</td>
|
||||
</tr>
|
||||
</table>
|
||||
</Modal>
|
||||
|
||||
@@ -45,9 +45,11 @@ class RitzenbergenLib {
|
||||
class Paarung {
|
||||
public heim: string;
|
||||
public gast: string;
|
||||
constructor (heim: string, gast: string) {
|
||||
public id: number;
|
||||
constructor (heim: string, gast: string, id: number) {
|
||||
this.heim = heim;
|
||||
this.gast = gast;
|
||||
this.id=id;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -102,7 +102,7 @@ export default {
|
||||
return result2.data;
|
||||
})
|
||||
.then((result) => {
|
||||
return result.map(el => new RitzenbergenLib.Paarung(el[0],el[1]));
|
||||
return result.map(el => new RitzenbergenLib.Paarung(el[0],el[1],el[2]));
|
||||
})
|
||||
.catch((error) => {
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user