parent
9d970b02b8
commit
b5eade9633
|
@ -149,9 +149,14 @@
|
|||
:placeholder="[[$t('plz')]]"
|
||||
id="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"
|
||||
/>
|
||||
</div>
|
||||
<p
|
||||
v-if="!isPostalCode(userdetails.address.zipcode, 'DE')"
|
||||
class="text-sm"
|
||||
>{{ $t('please_provide_a_valid_zipcode') }}</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex items-start mt-6">
|
||||
|
@ -206,6 +211,7 @@ import { computed, ref, reactive, watch } from "vue";
|
|||
import axios from "redaxios";
|
||||
import isEmail from 'validator/es/lib/isEmail';
|
||||
import isMobilePhone from 'validator/es/lib/isMobilePhone';
|
||||
import isPostalCode from 'validator/es/lib/isPostalCode';
|
||||
import { useToast } from "vue-toastification";
|
||||
|
||||
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({
|
||||
submit_enabled: computed(() => agb_accepted.value === true && isEmail(userdetails.value.mail)
|
||||
&& 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();
|
||||
function login() {
|
||||
|
@ -237,7 +243,7 @@ function login() {
|
|||
address1: userdetails.address.street,
|
||||
address2: userdetails.address.address2 || "",
|
||||
city: userdetails.address.city,
|
||||
postalcode: userdetails.address.zipcode,
|
||||
postalcode: isPostalCode(userdetails.address.zipcode),
|
||||
country: "DE",
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"nachname": "Nachname",
|
||||
"ort": "Ort",
|
||||
"phone_number": "Telefonnummer",
|
||||
"please_provide_a_valid_zipcode": "Bitte geben Sie eine gültige Postleitzahl an...",
|
||||
"please_provide_valid_mail": "Bitte geben Sie eine gültige E-Mail Adresse an",
|
||||
"plz": "PLZ",
|
||||
"provide_address": "Adresse angeben?",
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
"nachname": "Lastname",
|
||||
"ort": "City",
|
||||
"phone_number": "Phone Number",
|
||||
"please_provide_a_valid_zipcode": "Please provide a valid zipcode...",
|
||||
"please_provide_valid_mail": "Please provide a valid mail address.",
|
||||
"plz": "zipcode",
|
||||
"provide_address": "Provide a postal address?",
|
||||
|
|
Loading…
Reference in New Issue