- menu BOT

- verified_by_aportador
This commit is contained in:
paoloar77
2021-12-29 18:26:41 +01:00
parent f29c9e0413
commit 664b469d99
30 changed files with 505 additions and 60 deletions

View File

@@ -16,7 +16,7 @@ LOGO_REG="freeplanet-logo-full.svg"
TEST_NAME="Paolo"
TEST_SURNAME="Arena"
TEST_EMAIL="paolo@freeplanet.app"
TEST_USERNAME="paoloar77"
TEST_USERNAME="paoloar773"
TEST_PASSWORD="passpao1fr@1A"
TEST_APORTADOR=""
PUBLICKEY_PUSH='BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8'

View File

@@ -111,7 +111,7 @@ module.exports = {
},
fieldsUserToChange() {
return ['_id', 'index', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'ipaddr', 'lasttimeonline', 'profile', 'calcstat', 'news_on', 'aportador_solidario', 'made_gift', 'ind_order', 'old_order', 'numinvitati', 'numinvitatiattivi', 'qualified']
return ['_id', 'index', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'verified_by_aportador', 'ipaddr', 'lasttimeonline', 'profile', 'calcstat', 'news_on', 'aportador_solidario', 'made_gift', 'ind_order', 'old_order', 'numinvitati', 'numinvitatiattivi', 'qualified']
},
};

View File

@@ -58,6 +58,50 @@ export const shared_consts = {
Outcoming: 2,
},
BOTTYPE_NONE: 0,
BOTTYPE_PAGE: 1,
BOTTYPE_LINK: 2,
BOTTYPE_TEXT: 3,
BotType: [
{
value: 0,
label: '[Nessuno]',
},
{
value: 1,
label: 'Pagina',
},
{
value: 2,
label: 'Link',
},
{
value: 3,
label: 'Testo',
},
],
VISIB_ALL: 0,
VISIB_ONLYIF_VERIFIED: 1,
VISIB_ONLY_MANAGER: 2,
VISIB_ONLY_ADMIN: 4,
Visibility: [
{
value: 1,
label: 'Verificato',
},
{
value: 2,
label: 'Gestione',
},
{
value: 4,
label: 'Admin',
},
],
Permissions: {
Admin: {
value: 1,
@@ -228,7 +272,7 @@ export const shared_consts = {
},
fieldsUserToChange() {
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
return ['_id', 'username', 'email', 'name', 'surname', 'perm', 'date_reg', 'verified_email', 'verified_by_aportador', 'img', 'ipaddr', 'lasttimeonline', 'profile', 'news_on']
},
}

View File

@@ -431,7 +431,11 @@ export default defineComponent({
// if (serverData.length > 0)
// serverData.splice(0, serverData.length, ...returnedData)
// else
try {
serverData.value = [...returnedData.value]
}catch (e) {
serverData.value = []
}
}
// console.log('serverData', serverData)

View File

@@ -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>

View File

@@ -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,6 +54,8 @@ 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)
@@ -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)
@@ -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,

View File

@@ -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>

View File

@@ -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>

View File

@@ -96,7 +96,34 @@ const msg_website_it = {
ecommerce: 'Prodotti',
ecommerce_menu: 'ECommerce1',
hours: 'Ore',
department: 'Uffici'
department: 'Uffici',
title: 'Titolo',
path: 'Percorso',
img1: 'Immagine 1',
contentfield: 'Testo 1',
video1: 'Video 1',
ratio1: 'Ratio 1',
img2: 'Immagine 2',
content2: 'Testo 2',
video2: 'Video 2',
ratio2: 'Ratio 2',
img3: 'Immagine 3',
content3: 'Testo 3',
video3: 'Video 3',
ratio3: 'Ratio 3',
content4: 'Testo 4',
active: 'Attiva',
inmenu: 'Sul Menu',
submenu: 'SottoMenu',
infooter: 'Sul Footer',
internalpage: 'Pagina Interna',
order: 'Posizione',
icon: 'Icona',
imgback: 'Immagine di Sfondo',
onlyif_logged: 'Solo se Loggati',
only_residenti: 'Solo Residenti',
only_consiglio: 'Solo Consiglieri',
color: 'Colore',
},
msg: {
myAppName: 'FreePlanet',

View File

@@ -9,7 +9,7 @@ const functionality: IFunctionality = {
PWA: true,
SHOW_USER_MENU: true, // Cambiare con true
SHOW_PROFILE: true,
SHOW_REG_BUTTON: true,
SHOW_REG_BUTTON: false,
ENABLE_REGISTRATION: true, // Cambiare con true
ENABLE_REG_AYNI: false,
SHOW_NEWSLETTER: false,
@@ -258,6 +258,20 @@ const routes_manager: IListRoutes[] = [
onlyManager: true,
onlyEditor: true
},
{
active: true,
order: 30,
path: '/admin/bot',
materialIcon: 'fas fa-file-alt',
name: 'otherpages.admin.bot',
component: () => import('@/rootgen/admin/bot/bot.vue'),
inmenu: true,
submenu: true,
level_parent: 0,
level_child: 0.5,
onlyManager: true,
onlyEditor: true
},
{
active: true,
path: '/admin/newsletter',
@@ -468,7 +482,7 @@ const baseroutes: IListRoutes[] = [
{
active: functionality.ENABLE_REGISTRATION,
order: 1000,
path: '/signup',
path: '/signup/:invited',
materialIcon: 'how_to_reg',
name: 'pages.SignUp',
component: () => import('@/views/login/signup/signup.vue'),

View File

@@ -15,6 +15,11 @@ export default function () {
return `${userStore.getImgByUsername(username)}`
}
function getRefLink(username: string) {
const userStore = useUserStore()
return `${userStore.getRefLink(username)}`
}
function isValidUsername(username: string) {
return username && username !== 'nessuno' && username !== 'none'
}
@@ -103,7 +108,7 @@ export default function () {
function Verificato() {
const userStore = useUserStore()
return userStore.my.verified_email
return userStore.my.verified_email && userStore.my.verified_by_aportador
}
function paotest() {

View File

@@ -64,6 +64,20 @@ export interface IResp {
surname?: string
}
export interface IMyBot {
_id?: string
page?: number
index?: number
riga?: number
active?: boolean
main?: boolean
label?: string
type?: number
value?: string
visibility?: number
date_updated?: Date
}
export interface IMyPage {
_id?: string
author_username?: string
@@ -423,8 +437,8 @@ export interface IFunctionality {
SHOW_MESSAGES?: boolean
BOOKING_EVENTS?: boolean
ENABLE_REG_AYNI?: boolean
ENABLE_REG_SIP?: boolean
ENABLE_REG_CNM?: boolean
ENABLE_REG_ISP?: boolean
}
export interface IParLookup {

View File

@@ -2,6 +2,7 @@ import { IUserFields, IUserProfile } from '@src/model/UserStore'
export interface ICheckUser {
verified_email?: boolean
verified_by_aportador?: boolean
teleg_id?: number
profile?: IUserProfile
}

View File

@@ -27,7 +27,7 @@ export interface IUserProfile {
manage_telegram?: boolean
resplist?: any
workerslist?: any
dateofbirth?: Date
dateofbirth?: Date|null
born_city?: string
born_province?: string
born_country?: string
@@ -62,6 +62,7 @@ export interface IUserFields {
ipaddr?: string
perm?: number
verified_email?: boolean
verified_by_aportador?: boolean
aportador_solidario?: string
made_gift?: boolean

View File

@@ -26,7 +26,7 @@
</div>
<div v-else>
<div v-if="!isLogged() && static_data.functionality.ENABLE_REGISTRATION" style="margin:20px; text-align: center;">
<div v-if="!isLogged() && static_data.functionality.ENABLE_REGISTRATION && static_data.functionality.SHOW_REG_BUTTON" style="margin:20px; text-align: center;">
<q-btn rounded size="lg" color="primary" @click="openrighttoolbar">{{ $t('login.enter') }}
</q-btn>
</div>

0
src/rootgen/admin/bot/bot.scss Executable file
View File

40
src/rootgen/admin/bot/bot.ts Executable file
View File

@@ -0,0 +1,40 @@
import { defineComponent, ref, onMounted } from 'vue'
import { CImgText } from '../../../components/CImgText/index'
import { CCard } from '@/components/CCard'
import { CMyPage } from '@/components/CMyPage'
import { CTitleBanner } from '@/components/CTitleBanner'
import { CGridTableRec } from '@/components/CGridTableRec'
import { colmybot } from '@src/store/Modules/fieldsTable'
import MixinMetaTags from '@/mixins/mixin-metatags'
import { IMyBot } from 'model'
import { shared_consts } from '@/common/shared_vuejs'
export default defineComponent({
name: 'Bot',
components: { CImgText, CCard, CMyPage, CTitleBanner, CGridTableRec },
setup() {
const { setmeta } = MixinMetaTags()
function getdefaultnewrec(): IMyBot {
return {
page: 1,
index: 1,
riga: 1,
active: false,
label: '',
type: 0,
value: '',
visibility: shared_consts.VISIB_ALL,
}
}
return {
colmybot,
setmeta,
getdefaultnewrec,
}
}
})

24
src/rootgen/admin/bot/bot.vue Executable file
View File

@@ -0,0 +1,24 @@
<template>
<CMyPage title="Bot" imgbackground="images/bot.jpg" sizes="max-height: 120px">
<div class="q-ma-sm q-gutter-sm q-pa-xs">
<CTitleBanner title="Bot"></CTitleBanner>
<CGridTableRec
prop_mytable="mybots"
prop_mytitle="Configura Bot"
:prop_mycolumns="colmybot"
prop_colkey="_id"
nodataLabel="Nessun Bot Configurato"
:defaultnewrec="getdefaultnewrec"
noresultLabel="Il filtro selezionato non ha trovato nessun risultato">
</CGridTableRec>
</div>
</CMyPage>
</template>
<script lang="ts" src="./bot.ts">
</script>
<style lang="scss" scoped>
@import 'bot.scss';
</style>

View File

@@ -81,7 +81,6 @@ export default defineComponent({
}
watch(idparam, (newval, oldval) => {
console.log('$route.params.idparam')
tab.value = idparam.value
})

View File

@@ -84,6 +84,8 @@ export default defineComponent({
return db_fieldsTable().colTableUsers
} else if (static_data.functionality.ENABLE_REG_CNM) {
return db_fieldsTable().colTableUsersCNM
} else if (static_data.functionality.ENABLE_REG_ISP) {
return db_fieldsTable().colTableUsersISP
} else {
return db_fieldsTable().colTableUsersBase
}

View File

@@ -52,6 +52,7 @@ const msg_it = {
media: 'Media',
gallery: 'Gallerie',
listaflotte: 'Flotte',
bot: 'Bot',
},
manage: {
menu: 'Segreteria',
@@ -358,6 +359,7 @@ const msg_it = {
invitante_regalato: 'Invitante Regalato',
legenda: 'Legenda',
aportador_solidario: 'Chi ti ha Invitato',
verified_by_aportador: 'Verificato dall\'Invitante',
username_regala_invitato: 'Username del Destinatario del regalo',
aportador_solidario_nome_completo: 'Nominativo Invitante',
aportador_solidario_nome_completo_orig: 'Invitante Originario',
@@ -788,7 +790,19 @@ const msg_it = {
},
contribtype: {
name: 'Contributo'
}
},
bot: {
page: 'Pagina',
index: 'Posizione',
riga: 'Riga',
active: 'Attivo',
lang: 'Lingua',
label: 'Etichetta',
type: 'Tipo',
value: 'Contenuto',
visibility: 'Visibilità',
date_updated: 'Ult. Aggiornamento',
},
},
};

View File

@@ -145,6 +145,22 @@ export const colmypage = [
AddCol(DuplicateRec),
]
export const colmybot = [
AddCol({ name: 'page', label_trans: 'bot.page', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'riga', label_trans: 'bot.riga', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'index', label_trans: 'bot.index', fieldtype: costanti.FieldType.number }),
AddCol({ name: 'active', label_trans: 'bot.active', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'lang', label_trans: 'bot.lang' }),
AddCol({ name: 'main', label_trans: 'bot.main', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'label', label_trans: 'bot.label' }),
AddCol({ name: 'type', label_trans: 'bot.type', fieldtype: costanti.FieldType.select, jointable: 'bottype' }),
AddCol({ name: 'value', label_trans: 'bot.value' }),
AddCol({ name: 'visibility', label_trans: 'bot.visibility', fieldtype: costanti.FieldType.binary, jointable: 'visibility' }),
AddCol({ name: 'date_updated', label_trans: 'bot.date_updated', fieldtype: costanti.FieldType.date }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
]
export const colopzemail = [
AddCol({ name: 'key', label_trans: 'col.key' }),
AddCol({ name: 'label_it', label_trans: 'col.label' }),
@@ -1229,6 +1245,135 @@ export const fieldsTable = {
AddCol(DuplicateRec),
],
colTableUsersISP: [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'ind_order', label_trans: 'reg.ind_order' }),
// AddCol({ name: 'sospeso', label_trans: 'reg.sospeso', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'username', label_trans: 'reg.username_short' }),
AddCol({ name: 'name', label_trans: 'reg.name' }),
AddCol({ name: 'surname', label_trans: 'reg.surname' }),
AddCol({ name: 'email', label_trans: 'reg.email' }),
AddCol({ name: 'verified_email', label_trans: 'reg.verified_email', fieldtype: costanti.FieldType.boolean }),
AddCol({ name: 'note', label_trans: 'reg.note' }),
AddCol({ name: 'aportador_solidario', label_trans: 'reg.aportador_solidario' }),
AddCol({ name: 'verified_by_aportador', label_trans: 'reg.verified_by_aportador', fieldtype: costanti.FieldType.boolean }),
AddCol({
name: 'profile.resplist',
field: 'profile',
subfield: 'resplist',
label_trans: 'reg.resplist',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.workerslist',
field: 'profile',
subfield: 'workerslist',
label_trans: 'reg.workerslist',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.special_req',
field: 'profile',
subfield: 'special_req',
label_trans: 'reg.special_req',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.my_dream', field: 'profile', subfield: 'my_dream', label_trans: 'reg.my_dream',
}),
AddCol({ name: 'lang', field: 'lang', label_trans: 'reg.lang' }),
AddCol({
name: 'profile.nationality', field: 'profile', subfield: 'nationality', label_trans: 'reg.nationality',
}),
AddCol({
name: 'profile.cell', field: 'profile', subfield: 'cell', label_trans: 'reg.cell',
}),
AddCol({
name: 'profile.email_paypal',
field: 'profile',
subfield: 'email_paypal',
label_trans: 'reg.email_paypal',
}),
/* AddCol({
name: 'profile.payeer_id',
field: 'profile',
subfield: 'payeer_id',
label_trans: 'reg.payeer_id'
}),
AddCol({
name: 'profile.advcash_id',
field: 'profile',
subfield: 'advcash_id',
label_trans: 'reg.advcash_id'
}),
AddCol({
name: 'profile.revolut',
field: 'profile',
subfield: 'revolut',
label_trans: 'revolut'
}), */
AddCol({
name: 'profile.teleg_id', field: 'profile', subfield: 'teleg_id', label_trans: 'reg.teleg_id',
}),
AddCol({
name: 'profile.teleg_checkcode',
field: 'profile',
subfield: 'teleg_checkcode',
label_trans: 'reg.teleg_checkcode',
}),
AddCol({
name: 'profile.manage_telegram',
field: 'profile',
subfield: 'manage_telegram',
label_trans: 'reg.manage_telegram',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.socio',
field: 'profile',
subfield: 'socio',
label_trans: 'reg.socio',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.socioresidente',
field: 'profile',
subfield: 'socioresidente',
label_trans: 'reg.socioresidente',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({
name: 'profile.consiglio',
field: 'profile',
subfield: 'consiglio',
label_trans: 'reg.consiglio',
fieldtype: costanti.FieldType.boolean,
}),
AddCol({ name: 'profile.motivazioni', field: 'profile', subfield: 'motivazioni', label_trans: 'reg.motivazioni', }),
AddCol({ name: 'profile.biografia', field: 'profile', subfield: 'biografia', label_trans: 'reg.biografia', }),
AddCol({
name: 'profile.paymenttypes',
field: 'profile',
subfield: 'paymenttypes',
label_trans: 'reg.paymenttype',
fieldtype: costanti.FieldType.multiselect,
jointable: 'paymenttypes',
}),
AddCol({
name: 'profile.img', field: 'profile', subfield: 'img', label_trans: 'reg.img', sortable: false,
}),
AddCol({ name: 'date_reg', label_trans: 'reg.date_reg', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'lasttimeonline', label_trans: 'reg.lasttimeonline', fieldtype: costanti.FieldType.date }),
AddCol({
name: 'perm', label_trans: 'reg.perm', fieldtype: costanti.FieldType.binary, jointable: 'permissions', titlepopupedit: 'Permessi'
}),
AddCol({ name: 'ipaddr', label_trans: 'reg.ipaddr' }),
AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
AddCol(DeleteRec),
AddCol(DuplicateRec),
],
colTableExtraList: [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'username', label_trans: 'reg.username_short' }),
@@ -1468,6 +1613,24 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
{
value: 'bottype',
label: 'Tipo di Bot',
columns: colTablePermission,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{
value: 'visibility',
label: 'Visibilità',
columns: colTablePermission,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{
value: 'accepted',
label: 'Condizioni',

View File

@@ -3077,7 +3077,7 @@ export const tools = {
}
},
SignUpcheckErrors(mythisq: any, riscode: number, msg: string) {
SignUpcheckErrors(mythisq: any, $router: any, riscode: number, msg: string) {
console.log('SignUpcheckErrors', riscode)
const endload = true
@@ -3105,13 +3105,13 @@ export const tools = {
const msg2 = t('fetch.errore_generico') + userStore.getMsgError(riscode)
this.showNotif(mythisq, msg2)
} else if (riscode === this.OK) {
mythisq.$router.push('/regok')
$router.push('/regok')
this.showNotif(mythisq, t('components.authentication.email_verification.link_sent', { botname: t('ws.botname') }), {
color: 'green',
textColor: 'black',
})
} else if (riscode === serv_constants.RIS_ISCRIZIONE_OK) {
mythisq.$router.push('/')
$router.push('/')
this.showNotif(mythisq, t('components.authentication.iscrizione_ok', { botname: t('ws.botname') }), {
color: 'green',
textColor: 'black',
@@ -4276,7 +4276,7 @@ export const tools = {
if (!item.$error) {
return ''
}
console.log('errorMsg', cosa, item)
// console.log('errorMsg', cosa, item)
if (item.email) {
if (item.email.$invalid)

View File

@@ -66,6 +66,7 @@ export const toolsext = {
TABGALLERY: 'gallery',
TABMAILINGLIST: 'mailinglist',
TABMYPAGE: 'mypage',
TABMYBOT: 'mybots',
TABCALZOOM: 'calzoom',
TABGROUPS: 'groups',
TABTEMPLEMAIL: 'templemail',
@@ -80,6 +81,7 @@ export const toolsext = {
localStorage: {
teleg_id: 'ti',
verified_email: 'vf',
verified_by_aportador: 'va',
made_gift: 'mg',
wasAlreadySubOnDb: 'sb',
categorySel: 'cs',

View File

@@ -31,6 +31,7 @@ export const DefaultUser: IUserFields = {
password: '',
tokens: [],
verified_email: false,
verified_by_aportador: false,
aportador_solidario: '',
made_gift: false,
profile: {
@@ -60,7 +61,7 @@ export const DefaultProfile: IUserProfile = {
nationality: '',
intcode_cell: '',
cell: process.env.TEST_CELL || '',
dateofbirth: new Date(),
dateofbirth: null,
sex: 0,
country_pay: '',
email_paypal: '',
@@ -175,8 +176,14 @@ export const useUserStore = defineStore('UserStore', {
return ''
},
getRefLink(username: string): string {
if (username === '')
username = this.my.username
return tools.getUrlSite() + '/signup/' + username
},
isUserOk(): boolean {
return this.my.verified_email! && this.my.profile.teleg_id! > 0
return this.my.verified_email! && this.my.profile.teleg_id! > 0 && this.my.verified_by_aportador!
},
getNameSurnameByUserId(userId: string): string {
@@ -398,6 +405,7 @@ export const useUserStore = defineStore('UserStore', {
},
authUser(data: IUserFields) {
try {
this.my = { ...data }
if (!this.my.profile) {
this.my.profile = DefaultProfile
@@ -415,6 +423,10 @@ export const useUserStore = defineStore('UserStore', {
this.resetArrToken(this.my.tokens)
this.my.tokens.push({ access: 'auth', token: this.x_auth_token, data_login: tools.getDateNow() })
} catch (e) {
console.log('Error authUser: ' + e)
}
},
updateLocalStorage(myuser: IUserFields) {
@@ -436,6 +448,7 @@ export const useUserStore = defineStore('UserStore', {
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(toolsext.localStorage.isLogged, String(true))
localStorage.setItem(toolsext.localStorage.verified_email, String(myuser.verified_email))
localStorage.setItem(toolsext.localStorage.verified_by_aportador, String(myuser.verified_by_aportador))
localStorage.setItem(toolsext.localStorage.teleg_id, String(myuser.profile.teleg_id))
localStorage.setItem(toolsext.localStorage.made_gift, String(myuser.made_gift))
localStorage.setItem(toolsext.localStorage.wasAlreadySubOnDb, String(globalStore.wasAlreadySubOnDb))
@@ -461,18 +474,6 @@ export const useUserStore = defineStore('UserStore', {
return bcrypt.hash(authData.password!, bcrypt.genSaltSync(12))
.then((hashedPassword: string) => {
/*
const usertosend = {
lang: mylang,
email: authData.email,
password: String(hashedPassword),
username: authData.username,
name: authData.name,
surname: authData.surname
}
console.log(usertosend)
*/
authData.lang = mylang
authData.password = String(hashedPassword)
@@ -506,14 +507,16 @@ export const useUserStore = defineStore('UserStore', {
localStorage.setItem(toolsext.localStorage.token, this.x_auth_token)
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(toolsext.localStorage.verified_email, String(false))
localStorage.setItem(toolsext.localStorage.verified_by_aportador, String(false))
// Even if you has registered, you have to SignIn first
this.isLogged = false
// dispatch('storeUser', authData);
// dispatch('setLogoutTimer', myres.data.expiresIn);
console.log('OK')
return { code: tools.OK, msg: '' }
} else {
console.log('ERR GENERICO')
return { code: toolsext.ERR_GENERICO, msg: '' }
}
})
@@ -674,6 +677,7 @@ export const useUserStore = defineStore('UserStore', {
localStorage.removeItem(toolsext.localStorage.isLogged)
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
localStorage.removeItem(toolsext.localStorage.verified_email)
localStorage.removeItem(toolsext.localStorage.verified_by_aportador)
localStorage.removeItem(toolsext.localStorage.teleg_id)
localStorage.removeItem(toolsext.localStorage.made_gift)
localStorage.removeItem(toolsext.localStorage.categorySel)
@@ -759,6 +763,7 @@ export const useUserStore = defineStore('UserStore', {
const name = String(localStorage.getItem(toolsext.localStorage.name))
const surname = String(localStorage.getItem(toolsext.localStorage.surname))
const verified_email = localStorage.getItem(toolsext.localStorage.verified_email) === 'true'
const verified_by_aportador = localStorage.getItem(toolsext.localStorage.verified_by_aportador) === 'true'
const made_gift = localStorage.getItem(toolsext.localStorage.made_gift) === 'true'
const myperm = localStorage.getItem(toolsext.localStorage.perm)
let perm = 0
@@ -780,6 +785,7 @@ export const useUserStore = defineStore('UserStore', {
name,
surname,
verified_email,
verified_by_aportador,
made_gift,
perm,
profile: { img, teleg_id, myshares: [] },

View File

@@ -1289,6 +1289,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
if (table === 'accepted') return [shared_consts.Accepted.CHECK_READ_GUIDELINES, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI]
if (table === 'fieldstype') return costanti.FieldTypeArr
if (table === 'metodo_pagamento') return tools.SelectMetodiPagamento
if (table === 'bottype') return shared_consts.BotType
if (table === 'visibility') return shared_consts.Visibility
let myarr = this.getListByTable(table)

View File

@@ -207,6 +207,12 @@
@click="EseguiFunz('CorreggiTabHours')"></q-btn>
<br>
</div>
<div class="row">
<q-btn
label="setVerifiedByAportadorToALL" color="negative"
@click="EseguiFunz('setVerifiedByAportadorToALL')"></q-btn>
<br>
</div>
<q-field

View File

@@ -15,19 +15,19 @@
</div>
</div>
<q-banner
v-if="!isEmailVerified"
v-if="!isEmailVerified()"
rounded
class="bg-warning text-black"
color="primary q-title"
style="text-align: center;">
<div class="mybanner" v-html="$t('components.authentication.email_verification.link_sent', {botname: $t('site.botname') })">
<div class="mybanner" v-html="$t('components.authentication.email_verification.link_sent', {botname: $t('ws.botname') })">
</div>
</q-banner>
<br>
<q-banner
v-if="!isEmailVerified"
v-if="!isEmailVerified()"
rounded
class="bg-warning text-black"
color="primary q-title"

View File

@@ -4,6 +4,7 @@ import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
import { useUserStore } from '@store/UserStore'
import { useRoute } from 'vue-router'
import { tools } from '@store/Modules/tools'
export default defineComponent({
name: 'SignUp',
@@ -21,6 +22,15 @@ export default defineComponent({
adult.value = !!$route.params.invited
})
function created() {
if (!tools.getCookie(tools.APORTADOR_SOLIDARIO, '')) {
// @ts-ignore
tools.setCookie(tools.APORTADOR_SOLIDARIO, $route.params.invited ? $route.params.invited : '')
}
}
created()
return {}
},
})

View File

@@ -1,6 +1,6 @@
<template>
<q-page padding class="signup">
<CSignUp :showcell="true">
<CSignUp :showcell="false" :showaportador="true">
</CSignUp>
</q-page>