Iscrizione Conacreis e Arcadei
This commit is contained in:
@@ -14,7 +14,7 @@ import { useGlobalStore } from '@store/globalStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import MixinUsers from '@/mixins/mixin-users'
|
||||
import useVuelidate from '@vuelidate/core'
|
||||
import { email, minLength, required } from 'vuelidate/lib/validators'
|
||||
import { email, minLength, required } from '@vuelidate/validators'
|
||||
|
||||
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
|
||||
|
||||
@@ -29,9 +29,6 @@ export default defineComponent({
|
||||
const globalStore = useGlobalStore()
|
||||
const { t } = useI18n()
|
||||
|
||||
// @ts-ignore
|
||||
const v$ = useVuelidate(validations, signup)
|
||||
|
||||
const countryname = ref('')
|
||||
const countryborn = ref('')
|
||||
const iamadult = ref(false)
|
||||
@@ -43,7 +40,7 @@ export default defineComponent({
|
||||
|
||||
const { getMyUsername } = MixinUsers()
|
||||
|
||||
const signup = ref({
|
||||
const signup = reactive({
|
||||
accetta_carta_costituzionale_on: false,
|
||||
newsletter_on: false,
|
||||
terms: false
|
||||
@@ -102,12 +99,15 @@ export default defineComponent({
|
||||
return valid
|
||||
})
|
||||
|
||||
// @ts-ignore
|
||||
const v$ = useVuelidate(validations, signup)
|
||||
|
||||
function created() {
|
||||
if (!!getMyUsername() && (!userStore.my.profile.socio)) {
|
||||
signup.value.name = userStore.my.name
|
||||
signup.value.surname = mySurname.toString()
|
||||
signup.value.email = Email.toString()
|
||||
signup.value.cell_phone = myCell.toString()
|
||||
signup.name = userStore.my.name
|
||||
signup.surname = mySurname.toString()
|
||||
signup.email = Email.toString()
|
||||
signup.cell_phone = myCell.toString()
|
||||
}
|
||||
v$.value.$reset()
|
||||
}
|
||||
@@ -116,8 +116,8 @@ export default defineComponent({
|
||||
|
||||
const error = v$.value.$error || v$.value.$invalid
|
||||
|
||||
// console.log('v', v$, 'error', error, 'terms', signup.value.terms, 'carta', signup.value.accetta_carta_costituzionale_on)
|
||||
return !error && signup.value.terms && signup.value.accetta_carta_costituzionale_on
|
||||
// console.log('v', v$, 'error', error, 'terms', signup.terms, 'carta', signup.accetta_carta_costituzionale_on)
|
||||
return !error && signup.terms && signup.accetta_carta_costituzionale_on
|
||||
}
|
||||
|
||||
function errorMsg(cosa: string, item: any) {
|
||||
@@ -176,39 +176,39 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function submitOk() {
|
||||
v$.value.signup.value.touch()
|
||||
v$.value.signup.touch()
|
||||
|
||||
if (signup.value) {
|
||||
signup.value.email = tools.removespaces(signup.value.email!)
|
||||
signup.value.email = signup.value.email.toLowerCase()
|
||||
if (signup) {
|
||||
signup.email = tools.removespaces(signup.email!)
|
||||
signup.email = signup.email.toLowerCase()
|
||||
|
||||
signup.value.residency_country = tools.CapitalizeAllWords(signup.value.residency_country)
|
||||
signup.value.residency_address = tools.CapitalizeAllWords(signup.value.residency_address)
|
||||
signup.value.residency_city = tools.CapitalizeAllWords(signup.value.residency_city)
|
||||
signup.value.residency_province = signup.value.residency_province!.toUpperCase()
|
||||
signup.value.born_province = signup.value.born_province!.toUpperCase()
|
||||
signup.residency_country = tools.CapitalizeAllWords(signup.residency_country)
|
||||
signup.residency_address = tools.CapitalizeAllWords(signup.residency_address)
|
||||
signup.residency_city = tools.CapitalizeAllWords(signup.residency_city)
|
||||
signup.residency_province = signup.residency_province!.toUpperCase()
|
||||
signup.born_province = signup.born_province!.toUpperCase()
|
||||
|
||||
duplicate_email.value = false
|
||||
duplicate_username.value = false
|
||||
|
||||
if (!signup.value.terms) {
|
||||
if (!signup.terms) {
|
||||
tools.showNotif($q, t('reg.err.terms'))
|
||||
return
|
||||
}
|
||||
|
||||
if (!signup.value.accetta_carta_costituzionale_on) {
|
||||
if (!signup.accetta_carta_costituzionale_on) {
|
||||
tools.showNotif($q, t('reg.err.accetta_carta_costituzionale_on'))
|
||||
return
|
||||
}
|
||||
|
||||
if (v$.value.signup.value.$error) {
|
||||
if (v$.value.signup.$error) {
|
||||
tools.showNotif($q, t('reg.err.errore_generico'))
|
||||
return
|
||||
}
|
||||
|
||||
signup.value.name = tools.CapitalizeAllWords(signup.value.name)
|
||||
signup.value.surname = tools.CapitalizeAllWords(signup.value.surname)
|
||||
signup.value.annoTesseramento = 2023
|
||||
signup.name = tools.CapitalizeAllWords(signup.name)
|
||||
signup.surname = tools.CapitalizeAllWords(signup.surname)
|
||||
signup.annoTesseramento = 2023
|
||||
|
||||
$q.loading.show({ message: t('reg.iscrizioneincorso') })
|
||||
|
||||
@@ -227,13 +227,13 @@ export default defineComponent({
|
||||
|
||||
function selectcountry({ name, iso2, dialCode }: {name: string, iso2: string, dialCode: string}) {
|
||||
// console.log(name, iso2, dialCode)
|
||||
signup.value.residency_country = name
|
||||
signup.residency_country = name
|
||||
countryname.value = name
|
||||
}
|
||||
|
||||
function selectcountryborn({ name, iso2, dialCode }: {name: string, iso2: string, dialCode: string}) {
|
||||
// console.log(name, iso2, dialCode)
|
||||
signup.value.born_country = name
|
||||
signup.born_country = name
|
||||
countryborn.value = name
|
||||
}
|
||||
|
||||
@@ -246,7 +246,8 @@ export default defineComponent({
|
||||
submitOk,
|
||||
errorMsg,
|
||||
allowSubmit,
|
||||
|
||||
signup,
|
||||
v$,
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -150,13 +150,6 @@
|
||||
:label="$t('reg.nationality')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
<vue-country-code
|
||||
@onSelect="selectcountry"
|
||||
:preferredCountries="tools.getprefCountries"
|
||||
:dropdownOptions="{ disabledDialCode: true }"
|
||||
>
|
||||
|
||||
</vue-country-code>
|
||||
</template>
|
||||
|
||||
</q-input>
|
||||
@@ -238,13 +231,7 @@
|
||||
:label="$t('reg.nationality_born')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
<vue-country-code
|
||||
@onSelect="selectcountryborn"
|
||||
:preferredCountries="tools.getprefCountries"
|
||||
:dropdownOptions="{ disabledDialCode: true }"
|
||||
>
|
||||
|
||||
</vue-country-code>
|
||||
</template>
|
||||
|
||||
</q-input>
|
||||
|
||||
Reference in New Issue
Block a user