mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
decay is the balance shown, max 5 transactions in overview
This commit is contained in:
parent
ed554073dc
commit
449018a3a3
@ -79,6 +79,7 @@ export default {
|
||||
balance: 0,
|
||||
GdtBalance: 0,
|
||||
transactions: [],
|
||||
bookedBalance: 0,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@ -94,19 +95,13 @@ export default {
|
||||
this.$store.dispatch('logout')
|
||||
this.$router.push('/login')
|
||||
},
|
||||
async loadBalance() {
|
||||
const result = await communityAPI.balance(this.$store.state.session_id)
|
||||
if (result.success) {
|
||||
this.balance = result.result.data.balance // / 10000
|
||||
} else {
|
||||
// what to do when loading balance fails?
|
||||
}
|
||||
},
|
||||
async updateTransactions() {
|
||||
const result = await communityAPI.transactions(this.$store.state.session_id)
|
||||
if (result.success) {
|
||||
this.GdtBalance = result.result.data.gdtSum // / 10000
|
||||
this.GdtBalance = Number(result.result.data.gdtSum)
|
||||
this.transactions = result.result.data.transactions
|
||||
this.balance = Number(result.result.data.decay)
|
||||
this.bookedBalance = Number(result.result.data.balance)
|
||||
} else {
|
||||
// what to do when loading balance fails?
|
||||
}
|
||||
@ -119,7 +114,6 @@ export default {
|
||||
this.initScrollbar()
|
||||
},
|
||||
created() {
|
||||
this.loadBalance()
|
||||
this.updateTransactions()
|
||||
},
|
||||
}
|
||||
|
||||
@ -14,6 +14,7 @@
|
||||
<gdd-table
|
||||
v-if="showTransactionList"
|
||||
:transactions="transactions"
|
||||
:max="5"
|
||||
@update-transactions="updateTransactions"
|
||||
/>
|
||||
</b-container>
|
||||
|
||||
@ -255,7 +255,7 @@ export default {
|
||||
this.$store.state.session_id,
|
||||
this.ajaxCreateData.email,
|
||||
// better to send the user's input here?
|
||||
this.ajaxCreateData.amount * 10000,
|
||||
this.ajaxCreateData.amount,
|
||||
this.ajaxCreateData.memo,
|
||||
this.ajaxCreateData.target_date,
|
||||
)
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-row v-show="showTransactionList">
|
||||
<b-row>
|
||||
<b-col col="6">
|
||||
<stats-card
|
||||
type="gradient-red"
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-list-group v-show="showTransactionList">
|
||||
<b-list-group>
|
||||
<b-list-group-item
|
||||
v-for="item in transactions"
|
||||
v-for="item in transactions.slice(0, max)"
|
||||
:key="item.id"
|
||||
style="background-color: #ebebeba3 !important"
|
||||
>
|
||||
@ -106,8 +106,8 @@
|
||||
export default {
|
||||
name: 'GddTable',
|
||||
props: {
|
||||
showTransactionList: { type: Boolean, default: true },
|
||||
transactions: { default: [] },
|
||||
max: { type: Number, default: 25 },
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user