From e3f9a83ec55bc0aeec8c349961d562681323b1aa Mon Sep 17 00:00:00 2001 From: ogerly Date: Tue, 3 Aug 2021 17:17:45 +0200 Subject: [PATCH] step 1 --- .../admin_transactionGdt_list.json | 45 +++++++++++++ frontend/src/apis/communityAPI.js | 7 ++ .../src/views/Layout/DashboardLayout_gdd.vue | 65 ++++++++++++++++++- .../AccountOverview/GddTransactionGdtList.vue | 46 +++++++++++++ .../Pages/UserProfileTransactionList.vue | 9 +++ 5 files changed, 171 insertions(+), 1 deletion(-) create mode 100644 frontend/public/json-example/admin_transactionGdt_list.json create mode 100644 frontend/src/views/Pages/AccountOverview/GddTransactionGdtList.vue diff --git a/frontend/public/json-example/admin_transactionGdt_list.json b/frontend/public/json-example/admin_transactionGdt_list.json new file mode 100644 index 000000000..0fab48c11 --- /dev/null +++ b/frontend/public/json-example/admin_transactionGdt_list.json @@ -0,0 +1,45 @@ +{"state":"success", "gdt": + [ + { + "id": 8821, + "amount": 1000, + "date": "2020-08-12T14:12:00+00:00", + "email": "foerderkreis-1@gradido.org", + "comment": null, + "coupon_code": "", + "gdt_entry_type_id": 4, + "factor": "20.0000", + "amount2": 0, + "factor2": "0.0500", + "gdt": 1000 + }, + { + "id": 8552, + "amount": 1000, + "date": "2020-06-17T14:12:00+00:00", + "email": "foerderkreis-1@gradido.org", + "comment": null, + "coupon_code": "", + "gdt_entry_type_id": 4, + "factor": "20.0000", + "amount2": 0, + "factor2": "0.0500", + "gdt": 1000 + }, + { + "id": 8317, + "amount": 1000, + "date": "2020-03-16T14:12:00+00:00", + "email": "foerderkreis-1@gradido.org", + "comment": null, + "coupon_code": "", + "gdt_entry_type_id": 4, + "factor": "20.0000", + "amount2": 0, + "factor2": "0.0500", + "gdt": 1000 + } + ], + "transactionExecutingCount": 3000, + "count": 3 +} \ No newline at end of file diff --git a/frontend/src/apis/communityAPI.js b/frontend/src/apis/communityAPI.js index b2df337b8..65b9d40b9 100644 --- a/frontend/src/apis/communityAPI.js +++ b/frontend/src/apis/communityAPI.js @@ -40,6 +40,13 @@ const communityAPI = { `${CONFIG.COMMUNITY_API_URL}listTransactions/${firstPage}/${items}/${order}/${sessionId}`, ) }, + transactionsGdt: async (sessionId, firstPage = 1, items = 5, order = 'DESC') => { + return apiGet( + `${CONFIG.COMMUNITY_API_URL}state-balances/ajaxGdtOverview/${firstPage}/${items}/${order}/${sessionId}`, + ) + }, + //http://localhost/vue/public/json-example/admin_transactionGdt_list.json + //http://localhost/state-balances/ajaxGdtOverview /* create: async (sessionId, email, amount, memo, target_date = new Date() ) => { const payload = { sessionId, diff --git a/frontend/src/views/Layout/DashboardLayout_gdd.vue b/frontend/src/views/Layout/DashboardLayout_gdd.vue index 1bde53e60..302fe5039 100755 --- a/frontend/src/views/Layout/DashboardLayout_gdd.vue +++ b/frontend/src/views/Layout/DashboardLayout_gdd.vue @@ -58,10 +58,14 @@ :pending="pending" @update-balance="updateBalance" @update-transactions="updateTransactions" + @updateGdt="updateGdt" + :transactionsGdt="transactionsGdt" + > + @@ -75,6 +79,7 @@ import ContentFooter from './ContentFooter.vue' import { FadeTransition } from 'vue2-transitions' import communityAPI from '../../apis/communityAPI' import VueQrcode from 'vue-qrcode' +//import { gdt } from '../../../public/json-example/admin_transactionGdt_list.json' function hasElement(className) { return document.getElementsByClassName(className).length > 0 @@ -106,7 +111,8 @@ export default { bookedBalance: 0, transactionCount: 0, pending: true, - } + transactionsGdt: [], + } }, methods: { initScrollbar() { @@ -141,12 +147,69 @@ export default { // what to do when loading balance fails? } }, + async updateGdt(){ + //this.transactionsGdt = gdt + // const result = await communityAPI.transactionsGdt( + // this.$store.state.sessionId + // ) + + this.transactionsGdt = [{"state":"success", "gdt": + [ + { + "id": 8821, + "amount": 1000, + "date": "2020-08-12T14:12:00+00:00", + "email": "foerderkreis-1@gradido.org", + "comment": null, + "coupon_code": "", + "gdt_entry_type_id": 4, + "factor": "20.0000", + "amount2": 0, + "factor2": "0.0500", + "gdt": 1000 + }, + { + "id": 8552, + "amount": 1000, + "date": "2020-06-17T14:12:00+00:00", + "email": "foerderkreis-1@gradido.org", + "comment": null, + "coupon_code": "", + "gdt_entry_type_id": 4, + "factor": "20.0000", + "amount2": 0, + "factor2": "0.0500", + "gdt": 1000 + }, + { + "id": 8317, + "amount": 1000, + "date": "2020-03-16T14:12:00+00:00", + "email": "foerderkreis-1@gradido.org", + "comment": null, + "coupon_code": "", + "gdt_entry_type_id": 4, + "factor": "20.0000", + "amount2": 0, + "factor2": "0.0500", + "gdt": 1000 + } + ], + "transactionGdtExecutingCount": 3000, + "count": 3 +}] + + //console.log("DashboardLayout_gdd.vue") + //console.log(this.result) + }, updateBalance(ammount) { this.balance -= ammount }, }, mounted() { this.initScrollbar() + this.updateGdt() + console.log(this.transactionsGdt) }, } diff --git a/frontend/src/views/Pages/AccountOverview/GddTransactionGdtList.vue b/frontend/src/views/Pages/AccountOverview/GddTransactionGdtList.vue new file mode 100644 index 000000000..775d4b70e --- /dev/null +++ b/frontend/src/views/Pages/AccountOverview/GddTransactionGdtList.vue @@ -0,0 +1,46 @@ + + + + diff --git a/frontend/src/views/Pages/UserProfileTransactionList.vue b/frontend/src/views/Pages/UserProfileTransactionList.vue index e6a25b436..75d296306 100644 --- a/frontend/src/views/Pages/UserProfileTransactionList.vue +++ b/frontend/src/views/Pages/UserProfileTransactionList.vue @@ -10,6 +10,7 @@ :show-pagination="true" @update-transactions="updateTransactions" /> + @@ -17,17 +18,22 @@