send form variable in store

This commit is contained in:
ogerly 2021-03-25 11:20:17 +01:00
parent 39ba3a2386
commit 584526c199
4 changed files with 39 additions and 33 deletions

View File

@ -13,6 +13,9 @@ export const store = new Vuex.Store({
sizeDE: 'normal', sizeDE: 'normal',
sizeGB: 'big', sizeGB: 'big',
loginfail: false, loginfail: false,
row_form: true,
row_check: false,
row_thx: false,
user: { user: {
name: '', name: '',
balance: 0, balance: 0,

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<b-row v-show="row_form"> <b-row v-show="$store.state.row_form">
<b-col xl="12" md="12"> <b-col xl="12" md="12">
<b-alert variant="warning" show dismissible> <b-alert variant="warning" show dismissible>
<strong>Achtung!</strong> <strong>Achtung!</strong>
@ -140,19 +140,7 @@
</b-card> </b-card>
</b-col> </b-col>
</b-row> </b-row>
<b-row v-show="row_thx"> <b-row v-show="$store.state.row_check">
<b-col>
<div class="display-1 p-4">
Danke
<hr />
Deine Zahlung wurde erfolgreich versendet.
</div>
<b-button variant="success" @click="onReset">schließen</b-button>
<hr />
</b-col>
</b-row>
<b-row v-show="row_check">
<b-col> <b-col>
<div class="display-4 p-4">Bestätige deine Zahlung. Prüfe bitte nochmal alle Daten!</div> <div class="display-4 p-4">Bestätige deine Zahlung. Prüfe bitte nochmal alle Daten!</div>
@ -177,7 +165,25 @@
<b-badge variant="primary" pill>Datum</b-badge> <b-badge variant="primary" pill>Datum</b-badge>
</b-list-group-item> </b-list-group-item>
</b-list-group> </b-list-group>
<b-button variant="success" @click="sendTransaction">jetzt versenden</b-button> <hr>
<b-row>
<b-col><b-button @click="onReset">abbrechen</b-button></b-col>
<b-col class="text-right"><b-button variant="success" @click="sendTransaction">jetzt versenden</b-button></b-col>
</b-row>
</b-col>
</b-row>
<b-row v-show="$store.state.row_thx">
<b-col>
<div class="display-1 p-4">
Danke
<hr />
Deine Zahlung wurde erfolgreich versendet.
</div>
<b-button variant="success" @click="onReset">schließen</b-button>
<hr />
</b-col> </b-col>
</b-row> </b-row>
</div> </div>
@ -204,10 +210,7 @@ export default {
amount: '', amount: '',
memo: '', memo: '',
}, },
send: false, send: false
row_form: true,
row_check: false,
row_thx: false,
} }
}, },
computed: { computed: {
@ -228,9 +231,9 @@ export default {
//console.log('qr-email', arr[0].email) //console.log('qr-email', arr[0].email)
//console.log('qr-amount', arr[0].amount) //console.log('qr-amount', arr[0].amount)
this.row_form = false this.$store.state.row_form = false
this.row_check = true this.$store.state.row_check = true
this.row_thx = false this.$store.state.row_thx = false
}, },
async onSubmit() { async onSubmit() {
//event.preventDefault() //event.preventDefault()
@ -241,15 +244,15 @@ export default {
this.$store.state.ajaxCreateData.memo = this.form.memo this.$store.state.ajaxCreateData.memo = this.form.memo
this.$store.state.ajaxCreateData.target_date = Date.now() this.$store.state.ajaxCreateData.target_date = Date.now()
this.row_form = false this.$store.state.row_form = false
this.row_check = true this.$store.state.row_check = true
this.row_thx = false this.$store.state.row_thx = false
}, },
sendTransaction() { sendTransaction() {
this.$store.dispatch('ajaxCreate') this.$store.dispatch('ajaxCreate')
this.row_form = false this.$store.state.row_form = false
this.row_check = false this.$store.state.row_check = false
this.row_thx = true this.$store.state.row_thx = true
}, },
onReset(event) { onReset(event) {
event.preventDefault() event.preventDefault()
@ -259,9 +262,9 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.show = true this.show = true
}) })
this.row_form = true this.$store.state.row_form = true
this.row_check = false this.$store.state.row_check = false
this.row_thx = false this.$store.state.row_thx = false
}, },
}, },
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<b-row> <b-row v-show="$store.state.row_form">
<b-col xl="6" md="6"> <b-col xl="6" md="6">
<stats-card type="gradient-red" sub-title="balance_gdd" class="mb-4 h1"> <stats-card type="gradient-red" sub-title="balance_gdd" class="mb-4 h1">
{{ $n($store.state.user.balance) }} GDD {{ $n($store.state.user.balance) }} GDD

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<b-list-group> <b-list-group v-show="$store.state.row_form">
<b-list-group-item <b-list-group-item
v-for="item in filteredItems" v-for="item in filteredItems"
:key="item.id" :key="item.id"