added jackpot-history page

This commit is contained in:
Kostya
2024-04-13 20:21:35 +03:00
parent 4f467e83b8
commit 59565dc1c0
4 changed files with 117 additions and 0 deletions

View File

@@ -125,6 +125,22 @@ button {
grid-gap: 0.625rem;
}
.jackpot-history__content-grid {
display: grid;
grid-auto-columns: 1fr;
grid-template-columns: 0.35fr repeat(5, 1fr) 1fr;
grid-template-rows: auto 0fr repeat(4, 1fr);
grid-template-areas:
"menu header header header header header header"
"menu jackpot-history jackpot-history jackpot-history jackpot-history jackpot-history chat"
"menu jackpot-history jackpot-history jackpot-history jackpot-history jackpot-history chat"
"menu jackpot-history jackpot-history jackpot-history jackpot-history jackpot-history chat"
"menu jackpot-history jackpot-history jackpot-history jackpot-history jackpot-history chat"
"menu jackpot-history jackpot-history jackpot-history jackpot-history jackpot-history chat"
"menu jackpot-history jackpot-history jackpot-history jackpot-history jackpot-history chat";
grid-gap: 0.625rem;
}
.grid-crash {
display: grid;
grid-template-columns: 0.35fr repeat(5, 1fr) 1fr;
@@ -227,6 +243,13 @@ button {
margin: 0.625rem 2.438rem 1.125rem 1.125rem; */
}
.jackpot-history {
grid-area: jackpot-history;
background: #17181C;
border-radius: 20px;
height: 97%;
}
.double {
display: flex;
grid-area: double;

View File

@@ -85,3 +85,25 @@ export async function JoinJackpotGame(userData, amount) {
console.log('Fetch error')
}
}
export async function getJackpotHistoryGame () {
try {
const response = await fetch(`${BackendApiUrl}/GameJackpot/GetNewestJackpotGames`, {
method: 'POST',
headers: {
'Content-Type': 'application/json'
},
redirect: "follow"
})
if (!response.ok) {
console.log('Fetch error:', response.status)
}
console.log(response)
return await response.json()
}
catch (error) {
console.log('Fetch error')
}
}

View File

@@ -0,0 +1,70 @@
t<template>
<div class="jackpot-history__content-grid">
<aside-bar-element/>
<chat-component/>
<header-element-page/>
<div class="jackpot-history">
<div class="jackpot-history__content">
<ul class="jackpot-history__element">
<li v-for="(game, index) in historyGame" :key="index">
<div class="abc">
<div class="jackpot-history__element">
<div class="element-info">
<div class="element-info__icon">
<img :src="`https://avatar.spworlds.ru/face/55/${game.winnerUserName}`">
</div>
<div class="element-info__user-info">
<h2 class="username">{{ game.winnerUserName }}</h2>
<h2 class="user-deposit">
{{ game.winStake.toFixed(2) }}
<span class="img-width"><img src="@/assets/icons-profile/icon-diamond-ore.png"></span>
</h2>
</div>
</div>
<div class="element-chance">
<h2>
Шанс <span class="chance-style">{{ game.winnerPercentage.toFixed(2) }}%</span>
</h2>
</div>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</template>
<script>
import { onMounted, reactive } from "vue";
import ChatComponent from "@/components/ChatComponent.vue";
import AsideBarElement from "@/components/AsidebarComponent.vue";
import HeaderElementPage from "@/components/HeaderComponent.vue";
import '@/assets/css/PagesStyles/jackpot-history.css'
import {getJackpotHistoryGame} from "@/assets/js/jackpot/JackpotLogic";
export default {
components: {HeaderElementPage, ChatComponent, AsideBarElement},
setup() {
let historyGame = reactive({})
onMounted(() => {
getJackpotHistoryGame()
.then(response => {
Object.assign(historyGame, response)
})
})
return { historyGame }
}
}
</script>
<style>
</style>

View File

@@ -6,6 +6,7 @@ import SapergamePage from "@/pages/games-pages/SapergamePage.vue";
import SettingsPage from "@/pages/SettingsPage.vue";
import CrashGamePage from "@/pages/games-pages/CrashgamePage.vue";
import JackpotPage from "@/pages/games-pages/JackpotPage.vue";
import JackopthistoryPage from "@/pages/JackopthistoryPage.vue";
import DoublePage from "@/pages/games-pages/DoublePage.vue";
import AboutPage from "@/pages/AboutPage.vue";
import HelpPage from "@/pages/HelpPage.vue" ;
@@ -18,6 +19,7 @@ export default createRouter({
{ path: '/game/saper', component: SapergamePage, name: 'saper' },
{ path: '/game/crash', component: CrashGamePage, name: 'crash' },
{ path: '/game/jackpot', component: JackpotPage, name: 'jackpot' },
{ path: '/game/jackpot/history', component: JackopthistoryPage, name: 'jackpot-history' },
{ path: '/game/double', component: DoublePage, name: 'double' },
{ path: '/settings', component: SettingsPage, name: 'settings' },
{ path: '/about', component: AboutPage, name: 'about' },