Nuovo Sistema di registrazione, Completato.
This commit is contained in:
@@ -15,8 +15,8 @@ MONGODB_HOST="http://localhost:3000"
|
||||
LOGO_REG='riso-logo-full.png'
|
||||
TEST_NAME="Paolo"
|
||||
TEST_SURNAME="Arena"
|
||||
TEST_EMAIL="paolo@freeplanet.app"
|
||||
TEST_USERNAME="paoloar773"
|
||||
TEST_EMAIL=""
|
||||
TEST_USERNAME=""
|
||||
TEST_PASSWORD=""
|
||||
TEST_APORTADOR=""
|
||||
PUBLICKEY_PUSH='BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<div class="q-ma-sm">
|
||||
<div class="column cursor-pointer" @click="copytoclip">
|
||||
<q-field outlined :label="title" stack-label class="text-center cursor-pointer" label-color="text-blue">
|
||||
<div class="bg-white column cursor-pointer" @click="copytoclip">
|
||||
<q-field outlined :label="title" stack-label class="text-center cursor-pointer" label-color="blue">
|
||||
<template v-slot:prepend v-if="!tools.isMobile()">
|
||||
<q-btn round dense flat icon="far fa-copy"/>
|
||||
</template>
|
||||
|
||||
@@ -31,4 +31,8 @@
|
||||
border-radius: 32px;
|
||||
}
|
||||
|
||||
|
||||
.myuserinvitante{
|
||||
font-weight: bold;
|
||||
color: red;
|
||||
font-size: 1.5rem;
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import { Logo } from '@/components/logo'
|
||||
// import 'vue-country-code/dist/vue-country-code.css'
|
||||
|
||||
import { CTitleBanner } from '../CTitleBanner'
|
||||
import { CCopyBtn } from '../CCopyBtn'
|
||||
import { PagePolicy } from '../PagePolicy'
|
||||
import { computed, defineComponent, reactive, ref, watch } from 'vue'
|
||||
import { CSignIn } from '@/components/CSignIn'
|
||||
@@ -30,7 +31,7 @@ import { useGlobalStore } from '@store/globalStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CSignUp',
|
||||
components: { Logo, CTitleBanner, PagePolicy },
|
||||
components: { Logo, CTitleBanner, PagePolicy, CCopyBtn },
|
||||
props: {
|
||||
showadultcheck: {
|
||||
type: Boolean,
|
||||
@@ -76,6 +77,8 @@ export default defineComponent({
|
||||
const duplicate_username = ref(false)
|
||||
const visureg = ref(false)
|
||||
const showpolicy = ref(false)
|
||||
const visubuttBOT = ref(false)
|
||||
const isalreadyReg = ref(false)
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
@@ -238,12 +241,15 @@ export default defineComponent({
|
||||
signup.username = value.trim()
|
||||
}
|
||||
|
||||
function created() {
|
||||
async function created() {
|
||||
|
||||
console.log('$route.params', $route.params)
|
||||
|
||||
|
||||
signup.aportador_solidario = !!$route.params.invited ? $route.params.invited.toString() : ''
|
||||
signup.username = !!$route.params.usernameteleg ? $route.params.usernameteleg.toString() : ''
|
||||
if (signup.username)
|
||||
isalreadyReg.value = await tools.registeredusername(signup.username);
|
||||
signup.profile.username_telegram = signup.username
|
||||
if (!!$route.params.idteleg) {
|
||||
signup.profile.teleg_id = $route.params.idteleg ? parseInt($route.params.idteleg.toString()) : 0
|
||||
@@ -260,11 +266,17 @@ export default defineComponent({
|
||||
|
||||
console.log('signup.aportador_solidario', signup.aportador_solidario)
|
||||
|
||||
if (!signup.username || !signup.profile.teleg_id) {
|
||||
window.location.href = tools.getLinkBotTelegram()
|
||||
if (tools.getAskToVerifyReg()) {
|
||||
|
||||
if (!signup.username || !signup.profile.teleg_id) {
|
||||
tools.copyStringToClipboard($q, signup.aportador_solidario, true)
|
||||
visubuttBOT.value = true
|
||||
// window.location.href = tools.getLinkBotTelegram()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function myRuleEmail(val: string) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
@@ -311,6 +323,8 @@ export default defineComponent({
|
||||
myRuleEmail,
|
||||
visureg,
|
||||
showpolicy,
|
||||
visubuttBOT,
|
||||
isalreadyReg,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -23,24 +23,50 @@
|
||||
class="text-center">
|
||||
<div>
|
||||
|
||||
<p>
|
||||
<div>
|
||||
<logo></logo>
|
||||
|
||||
<q-btn class="q-ma-sm" color="positive" icon="fas fa-home" label="Se sei già Registrato CLICCA QUI" to="/"></q-btn>
|
||||
|
||||
<CTitleBanner :title="$t('pages.SignUp')"></CTitleBanner>
|
||||
<div v-if="!isalreadyReg">
|
||||
<CTitleBanner :title="$t('pages.SignUp')"></CTitleBanner>
|
||||
|
||||
<q-banner
|
||||
rounded
|
||||
class="bg-warning text-black"
|
||||
style="text-align: center;"
|
||||
>
|
||||
<span class="mybanner" v-html="t('pages.need_Telegram')"></span>
|
||||
</q-banner>
|
||||
</p>
|
||||
<q-banner
|
||||
rounded
|
||||
class="bg-warning text-black"
|
||||
style="text-align: center;"
|
||||
>
|
||||
<span class="mybanner" v-html="t('pages.need_Telegram')"></span>
|
||||
</q-banner>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="q-gutter-sm">
|
||||
<div v-if="visubuttBOT" class="q-gutter-md">
|
||||
<q-banner
|
||||
rounded
|
||||
class="bg-green-5 text-white"
|
||||
style="text-align: center;"
|
||||
>
|
||||
<span class="mybanner" v-html="t('pages.Registrazione_Con_Bot')"></span>
|
||||
|
||||
<CCopyBtn :title="$t('reg.invitante')" :texttocopy="signup.aportador_solidario">
|
||||
|
||||
</CCopyBtn>
|
||||
|
||||
<span class="myuserinvitante">{{}}</span>
|
||||
<div class="q-ma-md">
|
||||
<q-btn rounded color="primary" icon="fab fa-telegram" :label="$t('components.authentication.telegram.regbot', {botname: tools.getBotName() })"
|
||||
type="a"
|
||||
:href="tools.getLinkBotTelegram()" target="_blank"></q-btn>
|
||||
<br>
|
||||
</div>
|
||||
</q-banner>
|
||||
|
||||
</div>
|
||||
|
||||
<div v-else-if="!isalreadyReg" class="q-gutter-sm">
|
||||
|
||||
<q-input
|
||||
v-if="showaportador && signup.aportador_solidario !== tools.APORTADOR_NONE"
|
||||
@@ -81,7 +107,7 @@
|
||||
|
||||
<q-input
|
||||
v-model="signup.username"
|
||||
:readonly="true"
|
||||
:readonly="tools.getAskToVerifyReg()"
|
||||
rounded outlined
|
||||
@blur="v$.username.$touch"
|
||||
@update:model-value="changeusername"
|
||||
@@ -89,7 +115,7 @@
|
||||
@keydown.space="(event) => event.preventDefault()"
|
||||
maxlength="20"
|
||||
debounce="1000"
|
||||
:error-message="tools.errorMsg( 'username', v$.username)"
|
||||
:error-message="tools.errorMsg( 'username', v$.username) || (isalreadyReg ? 'L\'Username è gia stato registrato!' : '')"
|
||||
:label="$t('reg.username_reg')">
|
||||
|
||||
<template v-slot:prepend>
|
||||
|
||||
@@ -47,6 +47,7 @@ const msg_website_it = {
|
||||
invita: 'Invita Persone',
|
||||
SignUp: 'Nuova Registrazione',
|
||||
need_Telegram: 'Per poter utilizzare la Piattaforma occorre avere Telegram installato.<br><a href="https://play.google.com/store/apps/details?id=org.telegram.messenger" target="_blank">Clicca qui per scaricarlo</a>',
|
||||
Registrazione_Con_Bot: 'Per Registrarsi occorre prima verificarsi su Telegram sul <strong>BOT RISO</strong>',
|
||||
SignUpIscrizione: 'Diventa Socio CNM',
|
||||
SignUp_alreadylista: 'Registrazione per quelli che erano già nella lista di Notevole (del 2019) !',
|
||||
SignUp2: 'Registrazione',
|
||||
|
||||
@@ -147,6 +147,10 @@ export interface IMyPage {
|
||||
internalpage?: boolean
|
||||
}
|
||||
|
||||
export interface IOption {
|
||||
options: number
|
||||
}
|
||||
|
||||
export interface ISites {
|
||||
_id?: string
|
||||
attiva?: boolean
|
||||
@@ -166,6 +170,7 @@ export interface ISites {
|
||||
telegram_key_test?: string
|
||||
telegram_bot_name_test?: string
|
||||
pathreg_add?: string
|
||||
confsite: IOption
|
||||
}
|
||||
|
||||
export interface INewsToSent {
|
||||
@@ -304,6 +309,7 @@ export interface IGlobalState {
|
||||
catgrps: ICatGrp[],
|
||||
provinces: IProvince[],
|
||||
datastat?: INotData
|
||||
site?: ISites,
|
||||
}
|
||||
|
||||
export interface IMenuList {
|
||||
|
||||
@@ -221,6 +221,7 @@ const msg_it = {
|
||||
open: 'Clicca sul bottone qui sotto, si aprirà una chat Telegram speciale (chiamata BOT)',
|
||||
ifclose: 'poi premi "AVVIA" o "START" e segui le istruzioni indicate.',
|
||||
openbot: 'Entra qui',
|
||||
regbot: 'Verifica Telegram',
|
||||
},
|
||||
login: {
|
||||
facebook: 'Facebook',
|
||||
@@ -437,6 +438,7 @@ const msg_it = {
|
||||
teleg_id_old: 'OLD Tel ID',
|
||||
teleg_auth: 'Codice Autorizzazione',
|
||||
click_per_copiare: 'Cliccaci sopra per copiarlo sugli appunti',
|
||||
invitante: 'Username di chi ti ha invitato',
|
||||
link_reg: 'Clicca per copiare il link da condividere agli Amici',
|
||||
link_reg_and_msg: 'Condividi Link ad Amici',
|
||||
copia_messaggio: 'Copia Messaggio',
|
||||
|
||||
@@ -3357,14 +3357,14 @@ export const tools = {
|
||||
}
|
||||
},
|
||||
|
||||
localStSetItem(item: string, value : string) {
|
||||
localStSetItem(item: string, value: string) {
|
||||
if (localStorage.getItem('cookie-id') === 'decline')
|
||||
return null
|
||||
|
||||
localStorage.setItem(item, value)
|
||||
},
|
||||
|
||||
localStReal(item: string, value : string) {
|
||||
localStReal(item: string, value: string) {
|
||||
localStorage.setItem(item, value)
|
||||
},
|
||||
|
||||
@@ -4557,6 +4557,22 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
async registeredusername(username: string) {
|
||||
|
||||
const VALIDATE_USER_URL = tools.getServerHost() + ''
|
||||
|
||||
let onSuccess = (res: AxiosResponse) => {
|
||||
return res.status === PayloadMessageTypes.statusfound
|
||||
}
|
||||
|
||||
return Axios.get(VALIDATE_USER_URL + '/users/' + process.env.APP_ID + '/' + username)
|
||||
.then(onSuccess)
|
||||
.catch((err) => {
|
||||
return false
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
isEmail(email: string) {
|
||||
const res = /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/
|
||||
return res.test(String(email).toLowerCase())
|
||||
@@ -5359,7 +5375,7 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
getFieldSearchByTable: function (mytable: string, tablejoin: string, field: string) {
|
||||
getFieldSearchByTable(mytable: string, tablejoin: string, field: string) {
|
||||
let ris = field
|
||||
if (mytable === 'users') {
|
||||
if (tablejoin === 'cities') {
|
||||
@@ -5376,6 +5392,22 @@ export const tools = {
|
||||
return ris
|
||||
},
|
||||
|
||||
getConfSiteOptionEnabled(option: number): any {
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (globalStore.site) {
|
||||
if (globalStore.site.confsite.hasOwnProperty('options')) {
|
||||
return this.isBitActive(globalStore.site.confsite.options, option)
|
||||
}
|
||||
}
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
getAskToVerifyReg(): boolean {
|
||||
return this.getConfSiteOptionEnabled(shared_consts.ConfSite.Need_Aportador_On_DataReg_To_Verify_Reg)
|
||||
},
|
||||
|
||||
|
||||
// getLocale() {
|
||||
|
||||
@@ -128,6 +128,11 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
sectors: [],
|
||||
sectorgoods: [],
|
||||
catgrps: [],
|
||||
site: {
|
||||
confsite: {
|
||||
options: 0
|
||||
},
|
||||
},
|
||||
provinces: [],
|
||||
}),
|
||||
|
||||
@@ -1308,6 +1313,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
this.sectorgoods = (res.data.sectorgoods) ? [...res.data.sectorgoods] : []
|
||||
this.provinces = (res.data.provinces) ? [...res.data.provinces] : []
|
||||
this.catgrps = (res.data.catgrps) ? [...res.data.catgrps] : []
|
||||
this.site = (res.data.site) ? res.data.site : {}
|
||||
this.adtypes = (res.data.adtypes) ? [...res.data.adtypes] : []
|
||||
this.adtypegoods = (res.data.adtypegoods) ? [...res.data.adtypegoods] : []
|
||||
|
||||
@@ -1499,7 +1505,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
let obj = {}
|
||||
|
||||
arr.push(this.getItemDate(1, -30, 30, 'Eventi Passati'))
|
||||
arr.push(this.getItemDate(1, -30, 30, 'Eventi Passati'))
|
||||
arr.push(this.getItemDate(2, 0, 14, 'Da Oggi a 2 sett.'))
|
||||
arr.push(this.getItemDate(3, 14, 60, 'Eventi Futuri'))
|
||||
|
||||
|
||||
Reference in New Issue
Block a user