mirror of
https://github.com/IT4Change/gradido.git
synced 2026-01-20 20:01:31 +00:00
Merge branch 'master' of github.com:gradido/gradido
# Conflicts: # community_server
This commit is contained in:
commit
826a4e722e
12
.github/workflows/push.yml
vendored
Normal file
12
.github/workflows/push.yml
vendored
Normal file
@ -0,0 +1,12 @@
|
||||
name: on-push
|
||||
on: push
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- name: Build the stack
|
||||
run: docker-compose up -d
|
||||
- name: Test
|
||||
run: docker run gradido-node-test
|
||||
timeout-minutes: 2
|
||||
@ -13,11 +13,13 @@
|
||||
export default {
|
||||
name: 'app',
|
||||
created () {
|
||||
if ( $cookies.isKey("gdd_session_id") == true ) {
|
||||
this.$store.state.email = this.$cookies.get('gdd_u')
|
||||
//console.log("this.$cookies.get('gdd_session_id') ", this.$cookies.get('gdd_session_id') )
|
||||
//console.log(" $cookies.isKey('gdd_session_id') == true", this.$cookies.isKey("gdd_session_id") == true )
|
||||
if ( this.$cookies.get('gdd_session_id') == this.$store.state.session_id ) {
|
||||
//this.$store.state.email = this.$cookies.get('gdd_u')
|
||||
this.$router.push('/KontoOverview')
|
||||
}else {
|
||||
this.$router.push("/Login")
|
||||
this.$router.push("/Login")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,23 +8,23 @@ import NotFound from '@/views/NotFoundPage.vue'
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
redirect: 'landing',
|
||||
redirect: 'login',
|
||||
component: AuthLayoutGDD,
|
||||
children: [
|
||||
{
|
||||
path: '/login',
|
||||
name: 'login',
|
||||
component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/Login.vue')
|
||||
component: () => import('../views/Pages/Login.vue')
|
||||
},
|
||||
{
|
||||
path: '/thx',
|
||||
name: 'Thanks',
|
||||
component: () => import(/* webpackChunkName: "demo" */ '../views/thx.vue')
|
||||
component: () => import('../views/Pages/thx.vue')
|
||||
},
|
||||
{
|
||||
path: '/register',
|
||||
name: 'register',
|
||||
component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/Register.vue')
|
||||
component: () => import('../views/Pages/Register.vue')
|
||||
},
|
||||
]
|
||||
},
|
||||
@ -36,7 +36,7 @@ const routes = [
|
||||
{
|
||||
path: '/KontoOverview',
|
||||
name: 'Kontoübersicht',
|
||||
component: () => import(/* webpackChunkName: "demo" */ '../views/KontoOverview.vue'),
|
||||
component: () => import('../views/KontoOverview.vue'),
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
}
|
||||
@ -44,7 +44,7 @@ const routes = [
|
||||
{
|
||||
path: '/profile',
|
||||
name: 'profile',
|
||||
component: () => import(/* webpackChunkName: "demo" */ '../views/Pages/UserProfile.vue')
|
||||
component: () => import('../views/Pages/UserProfile.vue')
|
||||
}
|
||||
]
|
||||
},
|
||||
@ -57,7 +57,7 @@ const routes = [
|
||||
{
|
||||
path: '/AdminOverview',
|
||||
name: 'Adminübersicht',
|
||||
component: () => import(/* webpackChunkName: "demo" */ '../views/AdminOverview.vue'),
|
||||
component: () => import('../views/AdminOverview.vue'),
|
||||
meta: {
|
||||
requiresAuth: true
|
||||
}
|
||||
|
||||
@ -4,6 +4,8 @@ Vue.use(Vuex)
|
||||
import router from '../routes/router.js'
|
||||
import loginAPI from '../apis/loginAPI'
|
||||
import communityAPI from '../apis/communityAPI'
|
||||
import axios from 'axios'
|
||||
|
||||
|
||||
export const store = new Vuex.Store({
|
||||
state: {
|
||||
@ -11,14 +13,15 @@ export const store = new Vuex.Store({
|
||||
email: null,
|
||||
user : {
|
||||
name:"",
|
||||
balance: 0
|
||||
balance: 0,
|
||||
balance_gdt: 0
|
||||
},
|
||||
ajaxCreateData: {
|
||||
session_id : '',
|
||||
email: "max.musterman@gmail.de",
|
||||
amount: 10000000,
|
||||
email: "",
|
||||
amount: 0,
|
||||
target_date:"2021-02-19T13:25:36+00:00",
|
||||
memo:"AGE",
|
||||
memo:"",
|
||||
auto_sign: true
|
||||
},
|
||||
transactions: [],
|
||||
@ -33,26 +36,30 @@ export const store = new Vuex.Store({
|
||||
// Syncronous mutation of the state
|
||||
mutations: {
|
||||
email: (state, email) => {
|
||||
console.log('mutation: email')
|
||||
//console.log('mutation: email')
|
||||
state.email = email
|
||||
},
|
||||
session_id: (state,session_id) => {
|
||||
console.log('mutation: session_id')
|
||||
//console.log('mutation: session_id')
|
||||
state.session_id = session_id
|
||||
},
|
||||
user_balance: (state,balance) => {
|
||||
console.log('mutation: user_balance')
|
||||
//console.log('mutation: user_balance')
|
||||
state.user.balance = balance
|
||||
},
|
||||
user_balance_gdt: (state,balance) => {
|
||||
//console.log('mutation: user_balance_gdt')
|
||||
state.user.balance_gdt = balance
|
||||
},
|
||||
transactions: (state,transactions) => {
|
||||
console.log('mutation: transactions')
|
||||
//console.log('mutation: transactions')
|
||||
state.transactions = transactions
|
||||
}
|
||||
},
|
||||
// Asyncronous actions - used for api calls
|
||||
actions: {
|
||||
login: async ({ dispatch, commit }, data) => {
|
||||
console.log('action: login')
|
||||
//console.log('action: login')
|
||||
const result = await loginAPI.login(data.email,data.password)
|
||||
if( result.success ){
|
||||
commit('session_id', result.result.data.session_id)
|
||||
@ -94,35 +101,52 @@ export const store = new Vuex.Store({
|
||||
router.push('/Login')
|
||||
},
|
||||
ajaxCreate: async ({ dispatch, state }) => {
|
||||
console.log('action: ajaxCreate')
|
||||
console.log(state.ajaxCreateData)
|
||||
//console.log('action: ajaxCreate')
|
||||
//console.log("dispatch", dispatch)
|
||||
//console.log("state.ajaxCreateData", state.ajaxCreateData)
|
||||
/*
|
||||
const result = await communityAPI.create(
|
||||
state.ajaxCreateData.session_id,
|
||||
state.ajaxCreateData.email,
|
||||
state.ajaxCreateData.amount,
|
||||
state.ajaxCreateData.memo,
|
||||
state.ajaxCreateData.target_date,
|
||||
state.ajaxCreateData.memo
|
||||
)
|
||||
*/
|
||||
|
||||
/*
|
||||
this.ajaxCreateData.session_id : '',
|
||||
this.ajaxCreateData.email: "max.musterman@gmail.de",
|
||||
this.ajaxCreateData.amount: 10000000,
|
||||
this.ajaxCreateData.target_date:"2021-02-19T13:25:36+00:00",
|
||||
this.ajaxCreateData.memo:"AGE",
|
||||
this.ajaxCreateData.auto_sign: true
|
||||
*/
|
||||
|
||||
|
||||
axios.post("http://localhost/transaction-creations/ajaxCreate", state.ajaxCreateData).then((result) => {
|
||||
console.log("ajaxCreate result", result)
|
||||
|
||||
if( result.success ){
|
||||
// TODO
|
||||
} else {
|
||||
dispatch('logout')
|
||||
//dispatch('logout')
|
||||
}
|
||||
}, (error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
ajaxListTransactions: async ({commit, dispatch, state}) => {
|
||||
console.log('action: ajaxListTransactions')
|
||||
const result = await communityAPI.transactions(state.session_id)
|
||||
console.log(result)
|
||||
if(result.success) {
|
||||
commit('transactions', result.result.data.transactions)
|
||||
} else {
|
||||
dispatch('logout')
|
||||
}
|
||||
// console.log('action: ajaxListTransactions', state.session_id)
|
||||
// const result = await communityAPI.transactions(state.session_id)
|
||||
|
||||
|
||||
|
||||
},
|
||||
accountBalance: async ({ commit, dispatch, state }) => {
|
||||
console.log('action: accountBalance')
|
||||
//console.log('action: accountBalance')
|
||||
const result = await communityAPI.balance(state.session_id)
|
||||
console.log(result)
|
||||
//console.log(result)
|
||||
if(result.success) {
|
||||
commit('user_balance', result.result.data.balance)
|
||||
} else {
|
||||
|
||||
@ -8,21 +8,18 @@
|
||||
|
||||
<!-- Card sent GDD-->
|
||||
<gdd-sent />
|
||||
<br>
|
||||
<br>
|
||||
<hr>
|
||||
<!-- Card table -->
|
||||
<div>
|
||||
<gdd-table />
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<hr>
|
||||
<!-- Card table -->
|
||||
<div>
|
||||
<gdd-add-work />
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<br>
|
||||
<!-- Card table -->
|
||||
<div>
|
||||
@ -34,35 +31,7 @@
|
||||
<div @click="$store.dispatch('ajaxListTransactions')">this.$store.dispatch('ajaxListTransactions')</div>
|
||||
<div @click="$store.dispatch('accountBalance')">this.$store.dispatch('accountBalance')</div>
|
||||
<hr>
|
||||
<h3>User Balanace</h3>
|
||||
<small>this.$store.state.user.balance</small>
|
||||
<p>
|
||||
{{this.$store.state.user}}
|
||||
</p>
|
||||
<hr>
|
||||
<h3>User Balanace</h3>
|
||||
<small>this.$store.state.user.balance</small>
|
||||
<p>
|
||||
{{this.$store.state.user.balance}}
|
||||
</p>
|
||||
|
||||
<hr>
|
||||
<h3>User Transactions List</h3>
|
||||
<small>this.$store.state.transactions</small>
|
||||
<p>
|
||||
{{this.$store.state.transactions}}
|
||||
</p>
|
||||
|
||||
|
||||
<hr>
|
||||
<h3>User Participation List</h3>
|
||||
<small>/public/json-example/userparticipation.json</small>
|
||||
<p>
|
||||
{{userparticipation}}
|
||||
</p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@ -72,72 +41,21 @@
|
||||
import GddTable from './KontoOverview/GddTable.vue';
|
||||
import GddAddWork from './KontoOverview/GddAddWork.vue';
|
||||
import GddWorkTable from './KontoOverview/GddWorkTable.vue';
|
||||
import axios from 'axios';
|
||||
|
||||
export default {
|
||||
data(){
|
||||
return {
|
||||
usertransactions: {},
|
||||
userdata: {},
|
||||
userparticipation: {}
|
||||
}
|
||||
},
|
||||
export default {
|
||||
components: {
|
||||
GddStatus,
|
||||
GddSent,
|
||||
GddTable,
|
||||
GddAddWork,
|
||||
GddWorkTable,
|
||||
//axios
|
||||
GddWorkTable
|
||||
},
|
||||
created() {
|
||||
|
||||
|
||||
this.$store.dispatch('accountBalance')
|
||||
|
||||
},
|
||||
methods: {
|
||||
UserData() {
|
||||
axios.get("/json-example/userdata.json").then((d) => {
|
||||
console.log(d);
|
||||
this.userdata = d.data;
|
||||
|
||||
}, (error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},
|
||||
/*UserTransactions() {
|
||||
axios.get("/json-example/usertransactions.json").then((transactions) => {
|
||||
console.log(transactions);
|
||||
this.usertransactions = transactions.data;
|
||||
|
||||
}, (error) => {
|
||||
console.log(error);
|
||||
});
|
||||
},*/
|
||||
UserParticitions() {
|
||||
axios.get("/json-example/userparticipation.json").then((participation) => {
|
||||
console.log(participation);
|
||||
this.userparticipation = participation.data;
|
||||
|
||||
}, (error) => {
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
},
|
||||
created() {
|
||||
// Simple GET request using axios
|
||||
// axios.get("https://api.npms.io/v2/search?q=vue").then((response) => {
|
||||
// console.log(response);
|
||||
// this.totalVuePackages = response.data.total;
|
||||
// this.dataVuePackages = response.data;
|
||||
// }, (error) => {
|
||||
// console.log(error);
|
||||
// });
|
||||
/////////////////////////
|
||||
},
|
||||
mounted() {
|
||||
this.UserData();
|
||||
//this.UserTransactions();
|
||||
this.UserParticitions();
|
||||
},
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@ -1,79 +1,68 @@
|
||||
<template>
|
||||
<div>
|
||||
<b-row>
|
||||
<b-col xl="12" md="12">
|
||||
<base-button icon type="primary" size="lg" v-b-toggle.collapse-1>
|
||||
<b-row>
|
||||
<b-col xl="12" md="12">
|
||||
<base-button icon type="primary" size="lg" v-b-toggle.collapse-1>
|
||||
<span class="btn-inner--icon"><i class="ni ni-curved-next"></i></span>
|
||||
<span class="btn-inner--text">{{ $t('site.overview.send_gradido') }} </span>
|
||||
</base-button>
|
||||
<b-collapse id="collapse-1" class="mt-2">
|
||||
<b-card >
|
||||
|
||||
<div v-if="scan">
|
||||
<b-row>
|
||||
|
||||
<qrcode-capture @detect="onDetect" capture="user" ></qrcode-capture>
|
||||
|
||||
</b-row>
|
||||
|
||||
<b-row>
|
||||
|
||||
<b-collapse id="collapse-1" class="mt-2">
|
||||
<b-card >
|
||||
<div v-if="scan">
|
||||
<b-row>
|
||||
<qrcode-capture @detect="onDetect" capture="user" ></qrcode-capture>
|
||||
</b-row>
|
||||
<b-row>
|
||||
<qrcode-stream @decode="onDecode" @detect="onDetect" ></qrcode-stream>
|
||||
<b-alert show variant="secondary">
|
||||
|
||||
<span class="alert-text"><strong>QR Code Scanner</strong> - Scanne den QR Code deines Partners</span>
|
||||
</b-alert>
|
||||
<b-alert show variant="warning" >
|
||||
|
||||
<qrcode-stream @decode="onDecode" @detect="onDetect" ></qrcode-stream>
|
||||
<b-alert show variant="secondary">
|
||||
|
||||
<span class="alert-text"><strong>QR Code Scanner</strong> - Scanne den QR Code deines Partners</span>
|
||||
</b-alert>
|
||||
<b-alert show variant="warning" >
|
||||
|
||||
<span class="alert-text" @click="scan=false"><strong>abrechen!</strong></span>
|
||||
</b-alert>
|
||||
|
||||
|
||||
|
||||
</b-row>
|
||||
<span class="alert-text" @click="scan=false"><strong>abrechen!</strong></span>
|
||||
</b-alert>
|
||||
</b-row>
|
||||
|
||||
</div>
|
||||
<validation-observer v-slot="{handleSubmit}" ref="formValidator">
|
||||
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)" @reset="onReset" v-if="show">
|
||||
|
||||
<br>
|
||||
<qrcode-drop-zone id="input-0" v-model="form.img"></qrcode-drop-zone>
|
||||
<br>
|
||||
<div>
|
||||
<b-input-group
|
||||
id="input-group-1"
|
||||
label="Empfänger:"
|
||||
label-for="input-1"
|
||||
description="We'll never share your email with anyone else."
|
||||
size="lg"
|
||||
class="mb-3"
|
||||
>
|
||||
<b-input-group-prepend>
|
||||
<b-button variant="outline-primary">
|
||||
<img src="img/icons/gradido/qr-scan-pure.png" width="50" @click="scan=true"/></b-button>
|
||||
</b-input-group-prepend>
|
||||
<b-form-input
|
||||
id="input-1"
|
||||
v-model="form.email"
|
||||
type="email"
|
||||
placeholder="E-Mail"
|
||||
:rules="{required: true, email: true}"
|
||||
required
|
||||
style="font-size: xx-large; padding-left:20px"></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<b-input-group id="input-group-2" label="Betrag:" label-for="input-2"
|
||||
</div>
|
||||
<validation-observer v-slot="{handleSubmit}" ref="formValidator">
|
||||
<b-form role="form" @submit.prevent="handleSubmit(onSubmit)" @reset="onReset" v-if="show">
|
||||
<br>
|
||||
<qrcode-drop-zone id="input-0" v-model="form.img"></qrcode-drop-zone>
|
||||
<br>
|
||||
<div>
|
||||
<b-input-group
|
||||
id="input-group-1"
|
||||
label="Empfänger:"
|
||||
label-for="input-1"
|
||||
description="We'll never share your email with anyone else."
|
||||
size="lg"
|
||||
class="mb-3"
|
||||
>
|
||||
<b-input-group-prepend>
|
||||
<b-button variant="outline-primary">
|
||||
<img src="img/icons/gradido/plus.png" width="50">
|
||||
</b-button>
|
||||
</b-input-group-prepend>
|
||||
class="mb-3"
|
||||
>
|
||||
<b-input-group-prepend>
|
||||
<b-button variant="outline-primary">
|
||||
<img src="img/icons/gradido/qr-scan-pure.png" width="50" @click="scan=true"/></b-button>
|
||||
</b-input-group-prepend>
|
||||
<b-form-input
|
||||
id="input-1"
|
||||
v-model="form.email"
|
||||
type="email"
|
||||
placeholder="E-Mail"
|
||||
:rules="{required: true, email: true}"
|
||||
required
|
||||
style="font-size: xx-large; padding-left:20px"></b-form-input>
|
||||
</b-input-group>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<b-input-group id="input-group-2" label="Betrag:" label-for="input-2"
|
||||
size="lg"
|
||||
class="mb-3">
|
||||
<b-input-group-prepend>
|
||||
<b-button variant="outline-primary">
|
||||
<img src="img/icons/gradido/plus.png" width="50">
|
||||
</b-button>
|
||||
</b-input-group-prepend>
|
||||
<b-form-input
|
||||
id="input-2"
|
||||
v-model="form.amount"
|
||||
@ -85,37 +74,34 @@
|
||||
style="font-size: xx-large; padding-left:20px">
|
||||
</b-form-input>
|
||||
|
||||
<b-input-group-prepend>
|
||||
|
||||
<b-button >
|
||||
<div class="h1">GDD</div>
|
||||
</b-button>
|
||||
<b-input-group-prepend>
|
||||
<b-button >
|
||||
<div class="h1">GDD</div>
|
||||
</b-button>
|
||||
</b-input-group-prepend>
|
||||
|
||||
</b-input-group>
|
||||
|
||||
<b-input-group >
|
||||
<b-input-group-prepend>
|
||||
|
||||
<b-button >
|
||||
<h1><b-icon icon="chat-right-text"></b-icon></h1>
|
||||
</b-button>
|
||||
</b-input-group-prepend>
|
||||
<b-form-textarea v-model="form.memo"></b-form-textarea>
|
||||
</b-input-group>
|
||||
</b-input-group>
|
||||
<b-input-group>
|
||||
<b-input-group-prepend>
|
||||
<b-button >
|
||||
<h1><b-icon icon="chat-right-text"></b-icon></h1>
|
||||
</b-button>
|
||||
</b-input-group-prepend>
|
||||
<b-form-textarea v-model="form.memo"></b-form-textarea>
|
||||
</b-input-group>
|
||||
|
||||
</div>
|
||||
<br>
|
||||
<b-button type="submit" variant="primary">jetzt versenden</b-button>
|
||||
<b-button type="reset" variant="danger">Cancel</b-button>
|
||||
<br>
|
||||
</b-form>
|
||||
</validation-observer>
|
||||
</div>
|
||||
<br>
|
||||
<b-button type="submit" variant="primary">jetzt versenden</b-button>
|
||||
<b-button type="reset" variant="danger">Cancel</b-button>
|
||||
<br>
|
||||
</b-form>
|
||||
</validation-observer>
|
||||
|
||||
</b-card>
|
||||
</b-collapse>
|
||||
</b-card>
|
||||
</b-collapse>
|
||||
</b-col>
|
||||
</b-row>
|
||||
</b-row>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@ -176,16 +162,17 @@ export default {
|
||||
async onSubmit() {
|
||||
//event.preventDefault()
|
||||
console.log("onSubmit", this.form)
|
||||
console.log("this.form.img", this.form.img)
|
||||
console.log("this.form.email", this.form.email)
|
||||
console.log("this.form.amount", this.form.amount)
|
||||
console.log("this.form.memo", this.form.memo)
|
||||
//console.log("this.form.img", this.form.img)
|
||||
//console.log("this.form.email", this.form.email)
|
||||
//console.log("this.form.amount", this.form.amount)
|
||||
//console.log("this.form.memo", this.form.memo)
|
||||
|
||||
this.$store.state.ajaxCreateData.session_id = this.$cookies.get('gdd_session_id')
|
||||
this.$store.state.ajaxCreateData.email = this.form.email,
|
||||
this.$store.state.ajaxCreateData.amount = this.form.amount,
|
||||
this.$store.state.ajaxCreateData.memo = this.form.memo,
|
||||
|
||||
this.$store.state.ajaxCreateData.email = this.form.email
|
||||
this.$store.state.ajaxCreateData.amount = this.form.amount
|
||||
this.$store.state.ajaxCreateData.memo = this.form.memo
|
||||
this.$store.state.ajaxCreateData.target_date = Date.now()
|
||||
|
||||
this.$store.dispatch('ajaxCreate')
|
||||
},
|
||||
onReset(event) {
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
type="gradient-red"
|
||||
sub-title="balance_gdd"
|
||||
class="mb-4">
|
||||
{{ balance_gdd }} GDD
|
||||
{{ setComma($store.state.user.balance) }} GDD
|
||||
<template slot="footer">
|
||||
<span class="text-success mr-2">Wird immer angezeigt</span>
|
||||
</template>
|
||||
@ -15,9 +15,9 @@
|
||||
<b-col xl="6" md="6">
|
||||
<stats-card :title="$t('site.overview.gradido_received')"
|
||||
type="gradient-orange"
|
||||
:sub-title="balance_gdt"
|
||||
sub-title="balance_gdt"
|
||||
class="mb-4">
|
||||
{{ balance_gdt }} GDT
|
||||
{{ setComma($store.state.user.balance_gdt) }} GDT
|
||||
<template slot="footer">
|
||||
<span class="text-nowrap">Wird nur angezeigt wenn user GDT besitzt.</span>
|
||||
</template>
|
||||
@ -33,8 +33,14 @@ export default {
|
||||
data(){
|
||||
return {
|
||||
balance_gdd: this.$store.state.user.balance,
|
||||
balance_gdt: "0",
|
||||
balance_gdt: this.$store.state.user.balance_gdt,
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
setComma(int){
|
||||
return int / 10000
|
||||
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
||||
@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div>
|
||||
<!--
|
||||
|
||||
<b-table striped hover :items="items" :fields="fields" :tbody-tr-class="rowClass" responsive="true" >
|
||||
<template #cell(status)="row">
|
||||
<img v-if="row.item.status === 'sent' " src="img/icons/gradido/minus.png" width="50" />
|
||||
<img v-if="row.item.type === 'send' " src="img/icons/gradido/minus.png" width="50" />
|
||||
<img v-else src="img/icons/gradido/plus-low.png" width="50" />
|
||||
</template>
|
||||
<template #cell(details)="row">
|
||||
@ -12,16 +12,16 @@
|
||||
</b-button>
|
||||
</template>
|
||||
|
||||
<-- Table details -- >
|
||||
<!-- Table details -->
|
||||
<template #row-details="row">
|
||||
<b-card>
|
||||
<b-row class="mb-2">
|
||||
<b-col sm="3" class="text-sm-right"><b>{{ $t('site.overview.table.amount') }}:</b></b-col>
|
||||
<b-col>{{ row.item.amount }} GDD</b-col>
|
||||
<b-col>{{ row.item.balance }} GDD</b-col>
|
||||
</b-row>
|
||||
<b-row class="mb-2">
|
||||
<b-col sm="3" class="text-sm-right"><b>{{ $t('site.overview.table.decay') }}: </b></b-col>
|
||||
<b-col>{{ row.item.isActive }}0.0032 GDD</b-col>
|
||||
<b-col>{{ row.item.memo }} </b-col>
|
||||
</b-row>
|
||||
<b-row class="mb-2">
|
||||
<b-col sm="3" class="text-sm-right"><b>{{ $t('site.overview.table.sender') }}: </b></b-col>
|
||||
@ -33,16 +33,16 @@
|
||||
</b-card>
|
||||
</template>
|
||||
</b-table>
|
||||
-->
|
||||
|
||||
<hr>
|
||||
|
||||
<b-list-group >
|
||||
<b-list-group-item v-for="item in items" :key="item.id">
|
||||
<div class="d-flex w-100 justify-content-between" @click="toogle(item)" >
|
||||
<b-icon v-if="item.status === 'sent'" icon="box-arrow-left" class="m-1" font-scale="2" style="color:red"></b-icon>
|
||||
<b-icon v-if="item.type === 'send'" icon="box-arrow-left" class="m-1" font-scale="2" style="color:red"></b-icon>
|
||||
<b-icon v-else icon="box-arrow-right" class="m-1" font-scale="2" style="color:green" ></b-icon>
|
||||
<h1 class="mb-1">{{item.betrag}} <small>GDD</small></h1>
|
||||
<h2 class="text-muted"><small>{{item.datum}}</small> - {{item.name}}</h2>
|
||||
<h1 class="mb-1">{{ setComma(item.balance) }} <small>GDD</small></h1>
|
||||
<h2 class="text-muted"><small>{{item.date}}</small> - {{item.name}}</h2>
|
||||
</div>
|
||||
</b-list-group-item>
|
||||
</b-list-group>
|
||||
@ -51,36 +51,58 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
|
||||
import axios from 'axios';
|
||||
|
||||
export default {
|
||||
name: 'GddTable',
|
||||
data(){
|
||||
return {
|
||||
form: [],
|
||||
fields: [ 'status', 'betrag', 'name', 'datum', 'details'],
|
||||
items: [
|
||||
{ id: 1, betrag: 1000, name: 'Dickerson', datum: '12.12.20', datel: '12.12.2020 14:04', status: 'received' },
|
||||
{ id: 2, betrag: 302, name: 'Larsen', datum: '22.06.20', datel: '22.06.2020 22:23', status: 'sent' },
|
||||
{ id: 3, betrag: 89, name: 'Geneva', datum: '15.04.20', datel: '15.04.2020 12:55', status: 'sent' },
|
||||
{ id: 4, betrag: 1000, name: 'Community', datum: '10.03.20', datel: '10.03.2020 18:20', status: 'received'}
|
||||
]
|
||||
fields: [ 'balance', 'date', 'memo', 'name', 'transaction_id', 'type','details'],
|
||||
items: []
|
||||
};
|
||||
},
|
||||
|
||||
created() {
|
||||
|
||||
axios.get("http://localhost/state-balances/ajaxListTransactions/"+ this.$store.state.session_id).then((result) => {
|
||||
//console.log("result",result)
|
||||
//console.log("result.state",result.data.state)
|
||||
//
|
||||
//console.log("result.data.state == 'success'",result.data.state == "success")
|
||||
|
||||
//console.log("result.count",result.data.count)
|
||||
// console.log("result.gdtSum",result.data.gdtSum)
|
||||
// console.log("result.transactions",result.data.transactions)
|
||||
//commit('transactions', result.data.transactions)
|
||||
this.$store.state.user.balance_gdt = result.data.gdtSum
|
||||
this.items = result.data.transactions
|
||||
|
||||
}, (error) => {
|
||||
console.log(error);
|
||||
});
|
||||
|
||||
|
||||
},
|
||||
|
||||
methods: {
|
||||
rowClass(item, type) {
|
||||
if (!item || type !== 'row') return
|
||||
if (item.status === 'received') return 'table-success'
|
||||
if (item.status === 'sent') return 'table-warning'
|
||||
if (item.status === 'earned') return 'table-primary'
|
||||
if (item.type === 'receive') return 'table-success'
|
||||
if (item.type === 'send') return 'table-warning'
|
||||
if (item.type === 'creation') return 'table-primary'
|
||||
},
|
||||
toogle(item) {
|
||||
const temp = '<b-collapse visible v-bind:id="item.id">xxx <small class="text-muted">porta</small></b-collapse>'
|
||||
|
||||
},
|
||||
setComma(int){
|
||||
return int / 10000
|
||||
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
}
|
||||
|
||||
|
||||
};
|
||||
</script>
|
||||
<style>
|
||||
|
||||
@ -74,6 +74,7 @@
|
||||
</template>
|
||||
<script>
|
||||
export default {
|
||||
name: "login",
|
||||
data() {
|
||||
return {
|
||||
model: {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user