{{ $t('send') }}
@@ -26,7 +26,7 @@
-
+
@@ -57,6 +57,7 @@ import DashboardNavbar from './DashboardNavbar.vue'
import ContentFooter from './ContentFooter.vue'
// import DashboardContent from './Content.vue';
import { FadeTransition } from 'vue2-transitions'
+import communityAPI from '../../apis/communityAPI'
export default {
components: {
@@ -65,6 +66,11 @@ export default {
// DashboardContent,
FadeTransition,
},
+ data() {
+ return {
+ balance: 0,
+ }
+ },
methods: {
initScrollbar() {
let isWindows = navigator.platform.startsWith('Win')
@@ -78,10 +84,24 @@ 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?
+ }
+ },
+ updateBalance(ammount) {
+ this.balance -= ammount
+ },
},
mounted() {
this.initScrollbar()
},
+ created() {
+ this.loadBalance()
+ },
}
diff --git a/frontend/src/views/Pages/KontoOverview.vue b/frontend/src/views/Pages/KontoOverview.vue
index 10942b7f5..a0aa6b5ae 100644
--- a/frontend/src/views/Pages/KontoOverview.vue
+++ b/frontend/src/views/Pages/KontoOverview.vue
@@ -2,17 +2,17 @@
-
+
@@ -28,25 +28,24 @@ export default {
name: 'Overview',
data() {
return {
- row_form: true,
- row_check: false,
- row_thx: false,
transactions: [],
+ showTransactionList: true,
}
},
+ props: {
+ balance: { type: Number, default: 0 },
+ },
components: {
GddStatus,
GddSend,
GddTable,
},
- created() {
- this.$store.dispatch('accountBalance', this.$store.state.session_id)
- },
methods: {
- setRows(rows) {
- this.row_form = rows.row_form
- this.row_check = rows.row_check
- this.row_thx = rows.row_thx
+ toggleShowList(bool) {
+ this.showTransactionList = bool
+ },
+ updateTransactions(data) {
+ this.$emit('update-balance', data.ammount)
},
setTransactions(transactions) {
this.transactions = transactions