Bugfix order process/account update
This commit is contained in:
@@ -4,6 +4,8 @@ import { useBasketStore } from '@/stores/basket.store';
|
||||
import outlinedButton from '@/components/basics/outlinedButton.vue';
|
||||
import { ModelRef, ref } from 'vue';
|
||||
import { useAccountStore } from '@/stores/account.store';
|
||||
import { AddressModel } from '@/data/models/user/addressModel';
|
||||
import { PaymentModel } from '@/data/models/user/paymentModel';
|
||||
|
||||
const basketStore = useBasketStore()
|
||||
const accountStore = useAccountStore()
|
||||
@@ -32,6 +34,20 @@ async function doOrder() {
|
||||
|
||||
orderingInProgress.value = false
|
||||
}
|
||||
|
||||
function addressItemProps(item: AddressModel) {
|
||||
return {
|
||||
title: item.street + " " + item.houseNumber,
|
||||
subtitle: item.postalCode + " " + item.city
|
||||
}
|
||||
}
|
||||
|
||||
function paymentItemProps(item: PaymentModel) {
|
||||
return {
|
||||
title: item.bankName,
|
||||
subtitle: item.iban
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<template>
|
||||
@@ -42,64 +58,33 @@ async function doOrder() {
|
||||
max-width="800"
|
||||
persistent
|
||||
>
|
||||
<v-radio-group class="pa-0" v-model="basketStore.usedAddress">
|
||||
<v-list-subheader>
|
||||
{{ $t('account.userData.address', accountStore.userAccount.addresses.length) }}
|
||||
</v-list-subheader>
|
||||
|
||||
<v-list-item
|
||||
v-for="address in accountStore.userAccount.addresses"
|
||||
>
|
||||
|
||||
<v-list-item-title>
|
||||
<v-radio :label="address.street + '' + address.houseNumber" />
|
||||
</v-list-item-title>
|
||||
|
||||
<v-list-item-subtitle>
|
||||
{{ address.postalCode }} {{ address.city }}
|
||||
</v-list-item-subtitle>
|
||||
|
||||
<!-- <v-radio-group
|
||||
v-model="basketStore.usedAddress"
|
||||
:error="addressError"
|
||||
>
|
||||
<v-radio
|
||||
v-for="address in accountStore.userAccount.addresses"
|
||||
:value="address"
|
||||
:label="address.street + ' ' + address.houseNumber + ', ' + address.postalCode + ' ' + address.city"
|
||||
|
||||
<v-container>
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-select
|
||||
v-model="basketStore.usedAddress"
|
||||
:items="accountStore.userAccount.addresses"
|
||||
:item-props="addressItemProps"
|
||||
:label="$t('account.userData.address')"
|
||||
variant="outlined"
|
||||
hide-details
|
||||
/>
|
||||
</v-radio-group> -->
|
||||
</v-list-item>
|
||||
</v-radio-group>
|
||||
</v-col>
|
||||
</v-row>
|
||||
|
||||
<v-list>
|
||||
<v-list-subheader>
|
||||
{{ $t('account.userData.payment', accountStore.userAccount.payments.length) }}
|
||||
</v-list-subheader>
|
||||
|
||||
<v-list-item v-for="payment in accountStore.userAccount.payments">
|
||||
<template #prepend="{ isActive }">
|
||||
<v-list-item-action start>
|
||||
<v-radio :model-value="isActive" />
|
||||
</v-list-item-action>
|
||||
</template>
|
||||
|
||||
<v-list-item-title>{{ payment.bankName }}</v-list-item-title>
|
||||
|
||||
<v-list-item-subtitle>{{ payment.iban }}</v-list-item-subtitle>
|
||||
<!-- <v-radio-group
|
||||
v-model="basketStore.usedPayment"
|
||||
>
|
||||
<v-radio
|
||||
|
||||
:value="payment"
|
||||
:label="payment.bankName + ': ' + payment.iban"
|
||||
:error="paymentError"
|
||||
<v-row>
|
||||
<v-col>
|
||||
<v-select
|
||||
v-model="basketStore.usedPayment"
|
||||
:items="accountStore.userAccount.payments"
|
||||
:item-props="paymentItemProps"
|
||||
:label="$t('account.userData.payment')"
|
||||
variant="outlined"
|
||||
hide-details
|
||||
/>
|
||||
</v-radio-group> -->
|
||||
</v-list-item>
|
||||
</v-list>
|
||||
</v-col>
|
||||
</v-row>
|
||||
</v-container>
|
||||
|
||||
<template #actions>
|
||||
<outlined-button
|
||||
|
||||
Reference in New Issue
Block a user