Merged in feature/VBV-711-bezahlung-optionen-sichtbarer-machen (pull request #386)
VBV-711: Bezahlungs Optionen Sichtbarer Machen Approved-by: Dario Aebersold Approved-by: Daniel Egger
This commit is contained in:
commit
6b61f448f0
|
|
@ -0,0 +1,36 @@
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { t } from "i18next";
|
||||||
|
|
||||||
|
const model = defineModel<{
|
||||||
|
payment_method: string;
|
||||||
|
}>({ required: true });
|
||||||
|
|
||||||
|
const paymentMethods = [
|
||||||
|
{ value: "credit_card", label: t("a.Debit-/Kreditkarte/Twint") },
|
||||||
|
{ value: "cembra_byjuno", label: t("a.Rechnung") },
|
||||||
|
];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="col-span-full">
|
||||||
|
<div class="mt-2">
|
||||||
|
<select
|
||||||
|
id="paymentMethod"
|
||||||
|
v-model="model.payment_method"
|
||||||
|
required
|
||||||
|
name="paymentMethod"
|
||||||
|
class="block w-full border-0 py-1.5 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6"
|
||||||
|
>
|
||||||
|
<option v-for="pm in paymentMethods" :key="pm.value" :value="pm.value">
|
||||||
|
{{ pm.label }}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="model.payment_method === 'cembra_byjuno'" class="col-span-full">
|
||||||
|
<p class="mt-4">
|
||||||
|
{{ $t("shop.paymentCembraByjunoMessage") }}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
@ -2,42 +2,22 @@
|
||||||
import ItDatePicker from "@/components/ui/ItDatePicker.vue";
|
import ItDatePicker from "@/components/ui/ItDatePicker.vue";
|
||||||
import { useEntities } from "@/services/entities";
|
import { useEntities } from "@/services/entities";
|
||||||
import "@vuepic/vue-datepicker/dist/main.css";
|
import "@vuepic/vue-datepicker/dist/main.css";
|
||||||
import { t } from "i18next";
|
|
||||||
import { computed } from "vue";
|
|
||||||
|
|
||||||
const props = defineProps<{
|
const model = defineModel<{
|
||||||
modelValue: {
|
first_name: string;
|
||||||
first_name: string;
|
last_name: string;
|
||||||
last_name: string;
|
street: string;
|
||||||
street: string;
|
street_number: string;
|
||||||
street_number: string;
|
postal_code: string;
|
||||||
postal_code: string;
|
city: string;
|
||||||
city: string;
|
country_code: string;
|
||||||
country_code: string;
|
payment_method: string;
|
||||||
payment_method: string;
|
|
||||||
|
|
||||||
phone_number: string;
|
phone_number: string;
|
||||||
birth_date: string;
|
birth_date: string;
|
||||||
};
|
}>({ required: true });
|
||||||
}>();
|
|
||||||
|
|
||||||
const emit = defineEmits(["update:modelValue"]);
|
|
||||||
|
|
||||||
const { countries } = useEntities();
|
const { countries } = useEntities();
|
||||||
|
|
||||||
const paymentMethods = [
|
|
||||||
{ value: "credit_card", label: t("a.Debit-/Kreditkarte/Twint") },
|
|
||||||
{ value: "cembra_byjuno", label: t("a.Rechnung") },
|
|
||||||
];
|
|
||||||
|
|
||||||
const address = computed({
|
|
||||||
get() {
|
|
||||||
return props.modelValue;
|
|
||||||
},
|
|
||||||
set(value) {
|
|
||||||
emit("update:modelValue", value);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|
@ -49,7 +29,7 @@ const address = computed({
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<input
|
<input
|
||||||
id="first-name"
|
id="first-name"
|
||||||
v-model="address.first_name"
|
v-model="model.first_name"
|
||||||
type="text"
|
type="text"
|
||||||
name="first-name"
|
name="first-name"
|
||||||
required
|
required
|
||||||
|
|
@ -66,7 +46,7 @@ const address = computed({
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<input
|
<input
|
||||||
id="last-name"
|
id="last-name"
|
||||||
v-model="address.last_name"
|
v-model="model.last_name"
|
||||||
type="text"
|
type="text"
|
||||||
name="last-name"
|
name="last-name"
|
||||||
required
|
required
|
||||||
|
|
@ -86,7 +66,7 @@ const address = computed({
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<input
|
<input
|
||||||
id="street-address"
|
id="street-address"
|
||||||
v-model="address.street"
|
v-model="model.street"
|
||||||
type="text"
|
type="text"
|
||||||
required
|
required
|
||||||
name="street-address"
|
name="street-address"
|
||||||
|
|
@ -106,7 +86,7 @@ const address = computed({
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<input
|
<input
|
||||||
id="street-number"
|
id="street-number"
|
||||||
v-model="address.street_number"
|
v-model="model.street_number"
|
||||||
name="street-number"
|
name="street-number"
|
||||||
type="text"
|
type="text"
|
||||||
autocomplete="street-number"
|
autocomplete="street-number"
|
||||||
|
|
@ -125,7 +105,7 @@ const address = computed({
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<input
|
<input
|
||||||
id="postal-code"
|
id="postal-code"
|
||||||
v-model="address.postal_code"
|
v-model="model.postal_code"
|
||||||
type="text"
|
type="text"
|
||||||
required
|
required
|
||||||
name="postal-code"
|
name="postal-code"
|
||||||
|
|
@ -142,7 +122,7 @@ const address = computed({
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<input
|
<input
|
||||||
id="city"
|
id="city"
|
||||||
v-model="address.city"
|
v-model="model.city"
|
||||||
type="text"
|
type="text"
|
||||||
name="city"
|
name="city"
|
||||||
required
|
required
|
||||||
|
|
@ -159,7 +139,7 @@ const address = computed({
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<select
|
<select
|
||||||
id="country"
|
id="country"
|
||||||
v-model="address.country_code"
|
v-model="model.country_code"
|
||||||
required
|
required
|
||||||
name="country"
|
name="country"
|
||||||
autocomplete="country-name"
|
autocomplete="country-name"
|
||||||
|
|
@ -176,42 +156,14 @@ const address = computed({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-span-full">
|
<div v-if="model.payment_method === 'cembra_byjuno'" class="col-span-full">
|
||||||
<label
|
|
||||||
for="paymentMethod"
|
|
||||||
class="block text-sm font-medium leading-6 text-gray-900"
|
|
||||||
>
|
|
||||||
{{ $t("a.Zahlungsart") }}
|
|
||||||
</label>
|
|
||||||
<div class="mt-2">
|
|
||||||
<select
|
|
||||||
id="paymentMethod"
|
|
||||||
v-model="address.payment_method"
|
|
||||||
required
|
|
||||||
name="paymentMethod"
|
|
||||||
class="block w-full border-0 py-1.5 text-gray-900 ring-1 ring-inset ring-gray-300 focus:ring-2 focus:ring-inset focus:ring-blue-600 sm:text-sm sm:leading-6"
|
|
||||||
>
|
|
||||||
<option v-for="pm in paymentMethods" :key="pm.value" :value="pm.value">
|
|
||||||
{{ pm.label }}
|
|
||||||
</option>
|
|
||||||
</select>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="address.payment_method === 'cembra_byjuno'" class="col-span-full">
|
|
||||||
<p class="mt-4">
|
|
||||||
{{ $t("shop.paymentCembraByjunoMessage") }}
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="address.payment_method === 'cembra_byjuno'" class="col-span-full">
|
|
||||||
<label for="phone" class="block text-sm font-medium leading-6 text-gray-900">
|
<label for="phone" class="block text-sm font-medium leading-6 text-gray-900">
|
||||||
{{ $t("a.Telefonnummer") }}
|
{{ $t("a.Telefonnummer") }}
|
||||||
</label>
|
</label>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<input
|
<input
|
||||||
id="phone"
|
id="phone"
|
||||||
v-model="address.phone_number"
|
v-model="model.phone_number"
|
||||||
type="text"
|
type="text"
|
||||||
name="phone"
|
name="phone"
|
||||||
autocomplete="phone-number"
|
autocomplete="phone-number"
|
||||||
|
|
@ -220,12 +172,12 @@ const address = computed({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="address.payment_method === 'cembra_byjuno'" class="col-span-full">
|
<div v-if="model.payment_method === 'cembra_byjuno'" class="col-span-full">
|
||||||
<label for="birth-date" class="block text-sm font-medium leading-6 text-gray-900">
|
<label for="birth-date" class="block text-sm font-medium leading-6 text-gray-900">
|
||||||
{{ $t("a.Geburtsdatum") }}
|
{{ $t("a.Geburtsdatum") }}
|
||||||
</label>
|
</label>
|
||||||
<div class="mt-2">
|
<div class="mt-2">
|
||||||
<ItDatePicker v-model="address.birth_date"></ItDatePicker>
|
<ItDatePicker v-model="model.birth_date"></ItDatePicker>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import DatatransCembraDeviceFingerprint from "@/components/onboarding/DatatransCembraDeviceFingerprint.vue";
|
import DatatransCembraDeviceFingerprint from "@/components/onboarding/DatatransCembraDeviceFingerprint.vue";
|
||||||
import OrganisationAddress from "@/components/onboarding/OrganisationAddress.vue";
|
import OrganisationAddress from "@/components/onboarding/OrganisationAddress.vue";
|
||||||
|
import PaymentMethod from "@/components/onboarding/PaymentMethod.vue";
|
||||||
import PersonalAddress from "@/components/onboarding/PersonalAddress.vue";
|
import PersonalAddress from "@/components/onboarding/PersonalAddress.vue";
|
||||||
import WizardPage from "@/components/onboarding/WizardPage.vue";
|
import WizardPage from "@/components/onboarding/WizardPage.vue";
|
||||||
import {
|
import {
|
||||||
|
|
@ -272,6 +273,9 @@ const executePayment = async () => {
|
||||||
}}
|
}}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
<h3 class="mb-4 mt-10">{{ $t("a.Zahlungsart") }}</h3>
|
||||||
|
<PaymentMethod v-model="address" />
|
||||||
|
|
||||||
<h3 class="mb-4 mt-10">{{ $t("a.Adresse") }}</h3>
|
<h3 class="mb-4 mt-10">{{ $t("a.Adresse") }}</h3>
|
||||||
<p class="mb-2">
|
<p class="mb-2">
|
||||||
{{
|
{{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue