I am working on implementing the wallet.

This commit is contained in:
PascalMarchesseault
2024-06-28 23:24:18 -04:00
parent d8dada8489
commit dbc2c07931
2 changed files with 45 additions and 43 deletions

View File

@@ -82,14 +82,9 @@
</v-list-item> </v-list-item>
<v-list-item class="nav-button"> <v-list-item class="nav-button">
<v-list-item-title> <v-list-item-title>
<v-btn to="/wallet" class="w-100 " variant="plain"> Mon wallet</v-btn> <v-btn to="/wallet" class="w-100 " variant="plain"> Portefeuille</v-btn>
</v-list-item-title> </v-list-item-title>
</v-list-item> </v-list-item>
<v-list-item class="nav-button">
<v-list-item-title>
<v-btn to="/wallet" class="w-100 " variant="plain"> Mon wallet</v-btn>
</v-list-item-title>
</v-list-item>
<v-list-item class="nav-button"> <v-list-item class="nav-button">
<v-list-item-title> <v-list-item-title>
<v-btn @click="logout" to="/wallet" class="w-100 " variant="plain"> Déconnexion</v-btn> <v-btn @click="logout" to="/wallet" class="w-100 " variant="plain"> Déconnexion</v-btn>

View File

@@ -1,50 +1,57 @@
<template> <template>
<v-container class="mt-28 bg-gray-100 p-6 rounded-lg shadow-lg"> <v-container class="mt-10 bg-gray-100 py-10 rounded-lg shadow-lg border border-fuchsia-500 mb-15">
<v-data-table <div class="flex justify-center text-6xl mb-4 font-sans font-weight-bold">Portefeuille</div>
<div class="flex justify-between mb-4">
<div class="text-left">
<span class="font-bold">Montant Total : </span>
</div>
<div class="text-center">
<span class="font-bold">Nombre total de transactions : </span>
</div>
</div>
<v-data-table
:headers="headers" :headers="headers"
:items="transactions" :items="transactions"
class="elevation-1" class="elevation-1 text-black"
:items-per-page="5" :items-per-page="5"
> show-group-by
<template v-slot:[`item.amount`]="{ item }"> >
<span>{{ item.amount }} {{ item.g }}</span> </v-data-table>
</template>
</v-data-table>
</v-container> </v-container>
</template> </template>
<script setup lang="ts"> <script async setup>
import { ref } from 'vue'; import { onBeforeMount, ref } from 'vue';
import {useClient} from "@/plugins/api.js";
import MyUserModel from "@/models/myUserModel.js";
const client = useClient();
const headers = ref([ const total = ref(false);
{ text: 'Date', value: 'date' }, const drawer = ref(false);
{ text: 'Amount', value: 'amount' }, const currentUserName = ref("INVITÉ");
{ text: 'Currency', value: 'currency' }, let currentUser = null;
{ text: 'Tip Message', value: 'tipMessage' },
{ text: 'Paid', value: 'paid' },
]);
const transactions = ref([ onBeforeMount(async () => {
{ try {
date: '2024-06-01', const myUser = await client.get("/api/GetMyUser");
amount: '100', const currentUserModel = MyUserModel.createFromApiResult(myUser.data);
currency: 'USD', currentUser = currentUserModel;
tipMessage: 'Thank you!', currentUserName.value = currentUserModel.firstName + " " + currentUserModel.lastName
paid: true,
}, } catch(error) {
{ console.log("User not logged")
date: '2024-06-15', }
amount: '50', })
currency: 'EUR',
tipMessage: 'Great service!', function logout(){
paid: false, localStorage.removeItem('jwt');
}, window.location.reload();
// Ajoutez d'autres transactions ici }
]);
</script> </script>
<style scoped> <style scoped>
/* Ajoutez des styles personnalisés si nécessaire */
</style> </style>