|
|
|
@@ -149,9 +149,14 @@
|
|
|
|
:placeholder="[[$t('plz')]]"
|
|
|
|
:placeholder="[[$t('plz')]]"
|
|
|
|
id="postal_code"
|
|
|
|
id="postal_code"
|
|
|
|
autocomplete="postal-code"
|
|
|
|
autocomplete="postal-code"
|
|
|
|
|
|
|
|
:class="{ 'border-red-500': (!isPostalCode(userdetails.address.zipcode, 'DE')), 'border-green-300': (isPostalCode(userdetails.address.zipcode, 'DE')) }"
|
|
|
|
class="dark:bg-gray-800 mt-1 block w-full shadow-sm sm:text-sm border-gray-300 border-2 bg-gray-50 text-gray-500 rounded-md p-2"
|
|
|
|
class="dark:bg-gray-800 mt-1 block w-full shadow-sm sm:text-sm border-gray-300 border-2 bg-gray-50 text-gray-500 rounded-md p-2"
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<p
|
|
|
|
|
|
|
|
v-if="!isPostalCode(userdetails.address.zipcode, 'DE')"
|
|
|
|
|
|
|
|
class="text-sm"
|
|
|
|
|
|
|
|
>{{ $t('please_provide_a_valid_zipcode') }}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="flex items-start mt-6">
|
|
|
|
<div class="flex items-start mt-6">
|
|
|
|
@@ -206,6 +211,7 @@ import { computed, ref, reactive, watch } from "vue";
|
|
|
|
import axios from "redaxios";
|
|
|
|
import axios from "redaxios";
|
|
|
|
import isEmail from 'validator/es/lib/isEmail';
|
|
|
|
import isEmail from 'validator/es/lib/isEmail';
|
|
|
|
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
|
|
|
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
|
|
|
|
|
|
|
import isPostalCode from 'validator/es/lib/isPostalCode';
|
|
|
|
import { useToast } from "vue-toastification";
|
|
|
|
import { useToast } from "vue-toastification";
|
|
|
|
|
|
|
|
|
|
|
|
let userdetails = ref({ firstname: "", lastname: "", middlename: "", mail: "", phone: "", address: { street: "", address2: "", city: "", zipcode: "" } });
|
|
|
|
let userdetails = ref({ firstname: "", lastname: "", middlename: "", mail: "", phone: "", address: { street: "", address2: "", city: "", zipcode: "" } });
|
|
|
|
@@ -215,7 +221,7 @@ let agb_accepted = ref(false);
|
|
|
|
const state = reactive({
|
|
|
|
const state = reactive({
|
|
|
|
submit_enabled: computed(() => agb_accepted.value === true && isEmail(userdetails.value.mail)
|
|
|
|
submit_enabled: computed(() => agb_accepted.value === true && isEmail(userdetails.value.mail)
|
|
|
|
&& userdetails.value.firstname
|
|
|
|
&& userdetails.value.firstname
|
|
|
|
&& userdetails.value.lastname && (provide_address.value === false || provide_address.value === true && (userdetails.value.address.street.trim() && userdetails.value.address.city.trim() && userdetails.value.address.zipcode.trim())))
|
|
|
|
&& userdetails.value.lastname && (provide_address.value === false || provide_address.value === true && (userdetails.value.address.street.trim() && userdetails.value.address.city.trim() && isPostalCode(userdetails.value.address.zipcode, "DE"))))
|
|
|
|
})
|
|
|
|
})
|
|
|
|
const toast = useToast();
|
|
|
|
const toast = useToast();
|
|
|
|
function login() {
|
|
|
|
function login() {
|
|
|
|
@@ -237,7 +243,7 @@ function login() {
|
|
|
|
address1: userdetails.address.street,
|
|
|
|
address1: userdetails.address.street,
|
|
|
|
address2: userdetails.address.address2 || "",
|
|
|
|
address2: userdetails.address.address2 || "",
|
|
|
|
city: userdetails.address.city,
|
|
|
|
city: userdetails.address.city,
|
|
|
|
postalcode: userdetails.address.zipcode,
|
|
|
|
postalcode: isPostalCode(userdetails.address.zipcode),
|
|
|
|
country: "DE",
|
|
|
|
country: "DE",
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|