mirror of
https://github.com/janishutz/MusicPlayerV2.git
synced 2025-11-25 04:54:23 +00:00
Compare commits
2 Commits
9a347c9206
...
e0dcfa6964
| Author | SHA1 | Date | |
|---|---|---|---|
| e0dcfa6964 | |||
|
|
69d2db8c37 |
@@ -1,8 +1,8 @@
|
|||||||
{
|
{
|
||||||
"ages": {
|
"ages": {
|
||||||
"below": "red",
|
"below": "Orange",
|
||||||
"16-18": "",
|
"16-18": "Yellow",
|
||||||
"18+": ""
|
"18+": "Turquoise"
|
||||||
},
|
},
|
||||||
"offering": {
|
"offering": {
|
||||||
"big-bar": {
|
"big-bar": {
|
||||||
|
|||||||
@@ -50,7 +50,9 @@
|
|||||||
|
|
||||||
let cashinInDepot = false;
|
let cashinInDepot = false;
|
||||||
|
|
||||||
fetch( '/bar-config.json' ).then( res => {
|
fetch( '/bar-config.json', {
|
||||||
|
'cache': 'no-store'
|
||||||
|
} ).then( res => {
|
||||||
if ( res.status === 200 ) {
|
if ( res.status === 200 ) {
|
||||||
res.json().then( json => {
|
res.json().then( json => {
|
||||||
const data: FullConfig = json;
|
const data: FullConfig = json;
|
||||||
@@ -83,18 +85,22 @@
|
|||||||
const keys = Object.keys( selection.value );
|
const keys = Object.keys( selection.value );
|
||||||
|
|
||||||
let totalPrice = 0;
|
let totalPrice = 0;
|
||||||
|
let totalDepot = 0;
|
||||||
|
|
||||||
for ( let i = 0; i < keys.length; i++ ) {
|
for ( let i = 0; i < keys.length; i++ ) {
|
||||||
const o = selection.value[ keys[ i ] ];
|
const o = selection.value[ keys[ i ] ];
|
||||||
|
|
||||||
totalPrice += o * offering.value[ selectedBar.value ].offering[ keys[ i ] ].price;
|
totalPrice += o * offering.value[ selectedBar.value ].offering[ keys[ i ] ].price;
|
||||||
totalPrice += o * ( offering.value[ selectedBar.value ].offering[ keys[ i ] ].depot ?? 0 );
|
totalDepot += o * ( offering.value[ selectedBar.value ].offering[ keys[ i ] ].depot ?? 0 );
|
||||||
|
|
||||||
if ( ( offering.value[ selectedBar.value ].offering[ keys[ i ] ].depot ?? 0 ) > 0 && o > 0 )
|
|
||||||
cashinInDepot = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return totalPrice / 100;
|
if ( totalDepot > 0 ) {
|
||||||
|
cashinInDepot = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
totalPrice += totalDepot;
|
||||||
|
|
||||||
|
return ( totalPrice / 100 ) + ( totalDepot ? ` (Depot = ${ totalDepot })` : '' );
|
||||||
} );
|
} );
|
||||||
|
|
||||||
const changeValue = ( id: string, amount: number ) => {
|
const changeValue = ( id: string, amount: number ) => {
|
||||||
@@ -157,6 +163,9 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<p v-if="Object.keys( offering ).includes( selectedBar )">
|
||||||
|
Total: CHF {{ total }}
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user