Files
newfreeplanet_OLD/src/components/CRegistration/CRegistration.ts
Surya Paolo 2b44dfbcb6 Registrazione con scelta se Telegram o Email.
(anche da link personale)
2022-12-16 00:47:05 +01:00

79 lines
1.6 KiB
TypeScript
Executable File

import { tools } from '@store/Modules/tools'
import { computed, defineComponent, onMounted, reactive, ref, watch } from 'vue'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { DefaultProfile, useUserStore } from '@store/UserStore'
import { useRoute, useRouter } from 'vue-router'
import { static_data } from '@/db/static_data'
import { useGlobalStore } from '@store/globalStore'
export default defineComponent({
name: 'CRegistration',
emits: ['regEventEmail'],
components: { },
props: {
invited: {
type: String,
required: false,
default: '',
},
regexpire: {
type: String,
required: false,
default: '',
},
},
setup(props, { emit }) {
const $q = useQuasar()
const { t } = useI18n()
const userStore = useUserStore()
const globalStore = useGlobalStore()
const $route = useRoute()
const $router = useRouter()
const site = ref(globalStore.site)
const chooseReg = ref(false)
const noInvited = ref(false)
const start = ref(false)
const slide= ref('start')
function clickToRegister() {
if (site.value.confpages.enableRegByBot) {
$router.push('/bot')
} else {
$router.push('/signup')
}
}
function mounted() {
if (props.invited) {
start.value = true
chooseReg.value = true
slide.value = 'second'
}
}
function regEventEmail() {
emit('regEventEmail', props.invited)
}
onMounted(mounted)
return {
tools,
site,
clickToRegister,
chooseReg,
start,
noInvited,
slide,
regEventEmail,
}
},
})