- menu BOT
- verified_by_aportador
This commit is contained in:
@@ -431,7 +431,11 @@ export default defineComponent({
|
||||
// if (serverData.length > 0)
|
||||
// serverData.splice(0, serverData.length, ...returnedData)
|
||||
// else
|
||||
serverData.value = [...returnedData.value]
|
||||
try {
|
||||
serverData.value = [...returnedData.value]
|
||||
}catch (e) {
|
||||
serverData.value = []
|
||||
}
|
||||
}
|
||||
|
||||
// console.log('serverData', serverData)
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''"/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
<q-item-label>{{ scope.opt.descr }}</q-item-label>
|
||||
<q-item-label>{{ scope.opt[optlab] }}</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</template>
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Logo } from '../../components/logo'
|
||||
// import 'vue-country-code/dist/vue-country-code.css'
|
||||
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
import { computed, defineComponent, reactive, ref } from 'vue'
|
||||
import { computed, defineComponent, reactive, ref, watch } from 'vue'
|
||||
import { CSignIn } from '@/components/CSignIn'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
@@ -16,10 +16,12 @@ import useValidate from '@vuelidate/core'
|
||||
import useVuelidate from '@vuelidate/core'
|
||||
|
||||
import { email, minLength, required, sameAs } from '@vuelidate/validators'
|
||||
|
||||
// import { ValidationRuleset } from 'vuelidate'
|
||||
import { complexity, registeredemail, registereduser } from '../../validation'
|
||||
import { complexity, registeredemail, registereduser, aportadorexist } from '../../validation'
|
||||
|
||||
import 'vue3-tel-input/dist/vue3-tel-input.css'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
|
||||
|
||||
@@ -37,6 +39,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
showaportador: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
shownationality: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
@@ -47,13 +54,15 @@ export default defineComponent({
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const userStore = useUserStore()
|
||||
const $route = useRoute()
|
||||
const $router = useRouter()
|
||||
|
||||
const countryname = ref('')
|
||||
const iamadult = ref(false)
|
||||
const duplicate_email = ref(false)
|
||||
const duplicate_username = ref(false)
|
||||
|
||||
const signup = reactive(<ISignupOptions> {
|
||||
const signup = reactive(<ISignupOptions>{
|
||||
email: process.env.TEST_EMAIL || '',
|
||||
username: process.env.TEST_USERNAME || '',
|
||||
name: process.env.TEST_NAME || '',
|
||||
@@ -95,12 +104,30 @@ export default defineComponent({
|
||||
terms: {
|
||||
required,
|
||||
},
|
||||
aportador_solidario: {
|
||||
aportadorexist,
|
||||
required
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
// @ts-ignore
|
||||
const v$ = useVuelidate(validations, signup)
|
||||
|
||||
const invited = ref($route.params.invited)
|
||||
|
||||
watch(() => invited, (to: any, from: any) => {
|
||||
if (props.showaportador) {
|
||||
console.log('changeaportador', $route.params.invited)
|
||||
if (!signup.aportador_solidario) {
|
||||
if ($route.params.invited) {
|
||||
// @ts-ignore
|
||||
signup.aportador_solidario = $route.params.invited
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
function allowSubmit() {
|
||||
|
||||
let error = v$.value.$error || v$.value.$invalid
|
||||
@@ -162,7 +189,7 @@ export default defineComponent({
|
||||
console.log(signup)
|
||||
return userStore.signup(tools.clone(signup))
|
||||
.then((ris: any) => {
|
||||
if (tools.SignUpcheckErrors($q, ris.code, ris.msg))
|
||||
if (tools.SignUpcheckErrors($q, $router, ris.code, ris.msg))
|
||||
$q.loading.hide()
|
||||
}).catch((error: string) => {
|
||||
console.log('ERROR = ' + error)
|
||||
@@ -179,7 +206,7 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function selectcountry({ name, iso2, dialCode }: { name: string, iso2: string, dialCode: string }) {
|
||||
function selectcountry({ name, iso2, dialCode }: {name: string, iso2: string, dialCode: string}) {
|
||||
// console.log(name, iso2, dialCode)
|
||||
signup.profile.nationality = iso2
|
||||
countryname.value = name
|
||||
@@ -189,6 +216,27 @@ export default defineComponent({
|
||||
signup.username = value.trim()
|
||||
}
|
||||
|
||||
function created() {
|
||||
|
||||
console.log('$route.params', $route.params)
|
||||
|
||||
// @ts-ignore
|
||||
signup.aportador_solidario = $route.params.invited
|
||||
|
||||
console.log('1) aportador_solidario', signup.aportador_solidario)
|
||||
|
||||
if (!signup.aportador_solidario)
|
||||
signup.aportador_solidario = tools.getCookie(tools.APORTADOR_SOLIDARIO, signup.aportador_solidario)
|
||||
|
||||
if (!signup.aportador_solidario || signup.aportador_solidario === 'undefined') {
|
||||
signup.aportador_solidario = tools.APORTADOR_NONE
|
||||
}
|
||||
|
||||
console.log('signup.aportador_solidario', signup.aportador_solidario)
|
||||
}
|
||||
|
||||
created()
|
||||
|
||||
return {
|
||||
changeemail,
|
||||
changeusername,
|
||||
|
||||
@@ -6,10 +6,28 @@
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<!--Prova URL : {{env('PROVA_PAOLO')}}-->
|
||||
|
||||
<div class="q-gutter-sm">
|
||||
|
||||
<q-input
|
||||
v-if="showaportador && signup.aportador_solidario !== tools.APORTADOR_NONE"
|
||||
bg-color="lightblue"
|
||||
:readonly="true"
|
||||
v-model="signup.aportador_solidario"
|
||||
rounded outlined
|
||||
@blur="v$.aportador_solidario.$touch"
|
||||
:error="v$.aportador_solidario.$error"
|
||||
:error-message="tools.errorMsg('aportador_solidario', v$.aportador_solidario)"
|
||||
maxlength="20"
|
||||
debounce="1000"
|
||||
|
||||
:label="$t('reg.aportador_solidario')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
<q-icon name="person"/>
|
||||
</template>
|
||||
|
||||
</q-input>
|
||||
|
||||
<q-input
|
||||
v-model="signup.email"
|
||||
rounded outlined
|
||||
@@ -172,6 +190,7 @@
|
||||
<q-btn rounded size="lg" color="positive" @click="submitOk" :disabled='!allowSubmit()' :label="$t('reg.submit')">
|
||||
</q-btn>
|
||||
</div>
|
||||
<br /><br /><br />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
@@ -212,7 +212,7 @@
|
||||
<div v-show="!isLogged()">
|
||||
|
||||
<div class="q-ma-md" style="">
|
||||
<CSigninNoreg :showregbutt="true">
|
||||
<CSigninNoreg :showregbutt="static_data.functionality.SHOW_REG_BUTTON">
|
||||
|
||||
</CSigninNoreg>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user