- 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_NAME="Paolo"
TEST_SURNAME="Arena" TEST_SURNAME="Arena"
TEST_EMAIL="paolo@freeplanet.app" TEST_EMAIL="paolo@freeplanet.app"
TEST_USERNAME="paoloar77" TEST_USERNAME="paoloar773"
TEST_PASSWORD="passpao1fr@1A" TEST_PASSWORD="passpao1fr@1A"
TEST_APORTADOR="" TEST_APORTADOR=""
PUBLICKEY_PUSH='BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8' PUBLICKEY_PUSH='BDncvMiUZmjaCG2Kr1V9N0_33hOG-AuNSbHSvL24y2dzBiUjAxKm02emx5SeJvz2IGmtRf6YqCgopeQwCwUmZw8'

View File

@@ -111,7 +111,7 @@ module.exports = {
}, },
fieldsUserToChange() { 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, 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: { Permissions: {
Admin: { Admin: {
value: 1, value: 1,
@@ -228,7 +272,7 @@ export const shared_consts = {
}, },
fieldsUserToChange() { 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) // if (serverData.length > 0)
// serverData.splice(0, serverData.length, ...returnedData) // serverData.splice(0, serverData.length, ...returnedData)
// else // else
serverData.value = [...returnedData.value] try {
serverData.value = [...returnedData.value]
}catch (e) {
serverData.value = []
}
} }
// console.log('serverData', serverData) // console.log('serverData', serverData)

View File

@@ -85,7 +85,7 @@
<q-icon :name="scope.opt.icon ? scope.opt.icon : ''"/> <q-icon :name="scope.opt.icon ? scope.opt.icon : ''"/>
</q-item-section> </q-item-section>
<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-section>
</q-item> </q-item>
</template> </template>

View File

@@ -7,7 +7,7 @@ import { Logo } from '../../components/logo'
// import 'vue-country-code/dist/vue-country-code.css' // import 'vue-country-code/dist/vue-country-code.css'
import { CTitleBanner } from '../CTitleBanner' 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 { CSignIn } from '@/components/CSignIn'
import { useQuasar } from 'quasar' import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n' import { useI18n } from '@/boot/i18n'
@@ -16,10 +16,12 @@ import useValidate from '@vuelidate/core'
import useVuelidate from '@vuelidate/core' import useVuelidate from '@vuelidate/core'
import { email, minLength, required, sameAs } from '@vuelidate/validators' import { email, minLength, required, sameAs } from '@vuelidate/validators'
// import { ValidationRuleset } from 'vuelidate' // 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 'vue3-tel-input/dist/vue3-tel-input.css'
import { useRoute, useRouter } from 'vue-router'
// import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar' // import {Loading, QSpinnerFacebook, QSpinnerGears} from 'quasar'
@@ -37,6 +39,11 @@ export default defineComponent({
required: false, required: false,
default: false, default: false,
}, },
showaportador: {
type: Boolean,
required: false,
default: false,
},
shownationality: { shownationality: {
type: Boolean, type: Boolean,
required: false, required: false,
@@ -47,13 +54,15 @@ export default defineComponent({
const $q = useQuasar() const $q = useQuasar()
const { t } = useI18n() const { t } = useI18n()
const userStore = useUserStore() const userStore = useUserStore()
const $route = useRoute()
const $router = useRouter()
const countryname = ref('') const countryname = ref('')
const iamadult = ref(false) const iamadult = ref(false)
const duplicate_email = ref(false) const duplicate_email = ref(false)
const duplicate_username = ref(false) const duplicate_username = ref(false)
const signup = reactive(<ISignupOptions> { const signup = reactive(<ISignupOptions>{
email: process.env.TEST_EMAIL || '', email: process.env.TEST_EMAIL || '',
username: process.env.TEST_USERNAME || '', username: process.env.TEST_USERNAME || '',
name: process.env.TEST_NAME || '', name: process.env.TEST_NAME || '',
@@ -95,12 +104,30 @@ export default defineComponent({
terms: { terms: {
required, required,
}, },
aportador_solidario: {
aportadorexist,
required
}
} }
}) })
// @ts-ignore // @ts-ignore
const v$ = useVuelidate(validations, signup) 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() { function allowSubmit() {
let error = v$.value.$error || v$.value.$invalid let error = v$.value.$error || v$.value.$invalid
@@ -162,7 +189,7 @@ export default defineComponent({
console.log(signup) console.log(signup)
return userStore.signup(tools.clone(signup)) return userStore.signup(tools.clone(signup))
.then((ris: any) => { .then((ris: any) => {
if (tools.SignUpcheckErrors($q, ris.code, ris.msg)) if (tools.SignUpcheckErrors($q, $router, ris.code, ris.msg))
$q.loading.hide() $q.loading.hide()
}).catch((error: string) => { }).catch((error: string) => {
console.log('ERROR = ' + error) 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) // console.log(name, iso2, dialCode)
signup.profile.nationality = iso2 signup.profile.nationality = iso2
countryname.value = name countryname.value = name
@@ -189,6 +216,27 @@ export default defineComponent({
signup.username = value.trim() 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 { return {
changeemail, changeemail,
changeusername, changeusername,

View File

@@ -6,10 +6,28 @@
</p> </p>
</div> </div>
<!--Prova URL : {{env('PROVA_PAOLO')}}-->
<div class="q-gutter-sm"> <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 <q-input
v-model="signup.email" v-model="signup.email"
rounded outlined rounded outlined
@@ -172,6 +190,7 @@
<q-btn rounded size="lg" color="positive" @click="submitOk" :disabled='!allowSubmit()' :label="$t('reg.submit')"> <q-btn rounded size="lg" color="positive" @click="submitOk" :disabled='!allowSubmit()' :label="$t('reg.submit')">
</q-btn> </q-btn>
</div> </div>
<br /><br /><br />
</div> </div>
</div> </div>

View File

@@ -212,7 +212,7 @@
<div v-show="!isLogged()"> <div v-show="!isLogged()">
<div class="q-ma-md" style=""> <div class="q-ma-md" style="">
<CSigninNoreg :showregbutt="true"> <CSigninNoreg :showregbutt="static_data.functionality.SHOW_REG_BUTTON">
</CSigninNoreg> </CSigninNoreg>
</div> </div>

View File

@@ -96,7 +96,34 @@ const msg_website_it = {
ecommerce: 'Prodotti', ecommerce: 'Prodotti',
ecommerce_menu: 'ECommerce1', ecommerce_menu: 'ECommerce1',
hours: 'Ore', 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: { msg: {
myAppName: 'FreePlanet', myAppName: 'FreePlanet',

View File

@@ -9,7 +9,7 @@ const functionality: IFunctionality = {
PWA: true, PWA: true,
SHOW_USER_MENU: true, // Cambiare con true SHOW_USER_MENU: true, // Cambiare con true
SHOW_PROFILE: true, SHOW_PROFILE: true,
SHOW_REG_BUTTON: true, SHOW_REG_BUTTON: false,
ENABLE_REGISTRATION: true, // Cambiare con true ENABLE_REGISTRATION: true, // Cambiare con true
ENABLE_REG_AYNI: false, ENABLE_REG_AYNI: false,
SHOW_NEWSLETTER: false, SHOW_NEWSLETTER: false,
@@ -258,6 +258,20 @@ const routes_manager: IListRoutes[] = [
onlyManager: true, onlyManager: true,
onlyEditor: 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, active: true,
path: '/admin/newsletter', path: '/admin/newsletter',
@@ -468,7 +482,7 @@ const baseroutes: IListRoutes[] = [
{ {
active: functionality.ENABLE_REGISTRATION, active: functionality.ENABLE_REGISTRATION,
order: 1000, order: 1000,
path: '/signup', path: '/signup/:invited',
materialIcon: 'how_to_reg', materialIcon: 'how_to_reg',
name: 'pages.SignUp', name: 'pages.SignUp',
component: () => import('@/views/login/signup/signup.vue'), component: () => import('@/views/login/signup/signup.vue'),

View File

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

View File

@@ -64,6 +64,20 @@ export interface IResp {
surname?: string 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 { export interface IMyPage {
_id?: string _id?: string
author_username?: string author_username?: string
@@ -423,8 +437,8 @@ export interface IFunctionality {
SHOW_MESSAGES?: boolean SHOW_MESSAGES?: boolean
BOOKING_EVENTS?: boolean BOOKING_EVENTS?: boolean
ENABLE_REG_AYNI?: boolean ENABLE_REG_AYNI?: boolean
ENABLE_REG_SIP?: boolean
ENABLE_REG_CNM?: boolean ENABLE_REG_CNM?: boolean
ENABLE_REG_ISP?: boolean
} }
export interface IParLookup { export interface IParLookup {

View File

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

View File

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

View File

@@ -26,7 +26,7 @@
</div> </div>
<div v-else> <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 rounded size="lg" color="primary" @click="openrighttoolbar">{{ $t('login.enter') }}
</q-btn> </q-btn>
</div> </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) => { watch(idparam, (newval, oldval) => {
console.log('$route.params.idparam')
tab.value = idparam.value tab.value = idparam.value
}) })

View File

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

View File

@@ -52,6 +52,7 @@ const msg_it = {
media: 'Media', media: 'Media',
gallery: 'Gallerie', gallery: 'Gallerie',
listaflotte: 'Flotte', listaflotte: 'Flotte',
bot: 'Bot',
}, },
manage: { manage: {
menu: 'Segreteria', menu: 'Segreteria',
@@ -358,6 +359,7 @@ const msg_it = {
invitante_regalato: 'Invitante Regalato', invitante_regalato: 'Invitante Regalato',
legenda: 'Legenda', legenda: 'Legenda',
aportador_solidario: 'Chi ti ha Invitato', aportador_solidario: 'Chi ti ha Invitato',
verified_by_aportador: 'Verificato dall\'Invitante',
username_regala_invitato: 'Username del Destinatario del regalo', username_regala_invitato: 'Username del Destinatario del regalo',
aportador_solidario_nome_completo: 'Nominativo Invitante', aportador_solidario_nome_completo: 'Nominativo Invitante',
aportador_solidario_nome_completo_orig: 'Invitante Originario', aportador_solidario_nome_completo_orig: 'Invitante Originario',
@@ -788,7 +790,19 @@ const msg_it = {
}, },
contribtype: { contribtype: {
name: 'Contributo' 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), 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 = [ export const colopzemail = [
AddCol({ name: 'key', label_trans: 'col.key' }), AddCol({ name: 'key', label_trans: 'col.key' }),
AddCol({ name: 'label_it', label_trans: 'col.label' }), AddCol({ name: 'label_it', label_trans: 'col.label' }),
@@ -1229,6 +1245,135 @@ export const fieldsTable = {
AddCol(DuplicateRec), 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: [ colTableExtraList: [
// AddCol({ name: '_id', label_trans: 'reg.id' }), // AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'username', label_trans: 'reg.username_short' }), AddCol({ name: 'username', label_trans: 'reg.username_short' }),
@@ -1468,6 +1613,24 @@ export const fieldsTable = {
colicon: 'icon', colicon: 'icon',
noshow: true, 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', value: 'accepted',
label: 'Condizioni', 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) console.log('SignUpcheckErrors', riscode)
const endload = true const endload = true
@@ -3105,13 +3105,13 @@ export const tools = {
const msg2 = t('fetch.errore_generico') + userStore.getMsgError(riscode) const msg2 = t('fetch.errore_generico') + userStore.getMsgError(riscode)
this.showNotif(mythisq, msg2) this.showNotif(mythisq, msg2)
} else if (riscode === this.OK) { } 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') }), { this.showNotif(mythisq, t('components.authentication.email_verification.link_sent', { botname: t('ws.botname') }), {
color: 'green', color: 'green',
textColor: 'black', textColor: 'black',
}) })
} else if (riscode === serv_constants.RIS_ISCRIZIONE_OK) { } 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') }), { this.showNotif(mythisq, t('components.authentication.iscrizione_ok', { botname: t('ws.botname') }), {
color: 'green', color: 'green',
textColor: 'black', textColor: 'black',
@@ -4276,7 +4276,7 @@ export const tools = {
if (!item.$error) { if (!item.$error) {
return '' return ''
} }
console.log('errorMsg', cosa, item) // console.log('errorMsg', cosa, item)
if (item.email) { if (item.email) {
if (item.email.$invalid) if (item.email.$invalid)

View File

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

View File

@@ -31,6 +31,7 @@ export const DefaultUser: IUserFields = {
password: '', password: '',
tokens: [], tokens: [],
verified_email: false, verified_email: false,
verified_by_aportador: false,
aportador_solidario: '', aportador_solidario: '',
made_gift: false, made_gift: false,
profile: { profile: {
@@ -60,7 +61,7 @@ export const DefaultProfile: IUserProfile = {
nationality: '', nationality: '',
intcode_cell: '', intcode_cell: '',
cell: process.env.TEST_CELL || '', cell: process.env.TEST_CELL || '',
dateofbirth: new Date(), dateofbirth: null,
sex: 0, sex: 0,
country_pay: '', country_pay: '',
email_paypal: '', email_paypal: '',
@@ -175,8 +176,14 @@ export const useUserStore = defineStore('UserStore', {
return '' return ''
}, },
getRefLink(username: string): string {
if (username === '')
username = this.my.username
return tools.getUrlSite() + '/signup/' + username
},
isUserOk(): boolean { 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 { getNameSurnameByUserId(userId: string): string {
@@ -398,23 +405,28 @@ export const useUserStore = defineStore('UserStore', {
}, },
authUser(data: IUserFields) { authUser(data: IUserFields) {
this.my = { ...data } try {
if (!this.my.profile) { this.my = { ...data }
this.my.profile = DefaultProfile if (!this.my.profile) {
this.my.profile = DefaultProfile
}
this.isAdmin = tools.isBitActive(this.my.perm, shared_consts.Permissions.Admin.value)
this.isManager = tools.isBitActive(this.my.perm, shared_consts.Permissions.Manager.value)
this.isTutor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Tutor.value)
this.isZoomeri = tools.isBitActive(this.my.perm, shared_consts.Permissions.Zoomeri.value)
this.isDepartment = tools.isBitActive(this.my.perm, shared_consts.Permissions.Department.value)
this.isTeacher = tools.isBitActive(this.my.perm, shared_consts.Permissions.Teacher.value)
this.isEditor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Editor.value)
this.my.tokens = []
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)
} }
this.isAdmin = tools.isBitActive(this.my.perm, shared_consts.Permissions.Admin.value)
this.isManager = tools.isBitActive(this.my.perm, shared_consts.Permissions.Manager.value)
this.isTutor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Tutor.value)
this.isZoomeri = tools.isBitActive(this.my.perm, shared_consts.Permissions.Zoomeri.value)
this.isDepartment = tools.isBitActive(this.my.perm, shared_consts.Permissions.Department.value)
this.isTeacher = tools.isBitActive(this.my.perm, shared_consts.Permissions.Teacher.value)
this.isEditor = tools.isBitActive(this.my.perm, shared_consts.Permissions.Editor.value)
this.my.tokens = []
this.resetArrToken(this.my.tokens)
this.my.tokens.push({ access: 'auth', token: this.x_auth_token, data_login: tools.getDateNow() })
}, },
updateLocalStorage(myuser: IUserFields) { updateLocalStorage(myuser: IUserFields) {
@@ -436,6 +448,7 @@ export const useUserStore = defineStore('UserStore', {
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString()) localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(toolsext.localStorage.isLogged, String(true)) localStorage.setItem(toolsext.localStorage.isLogged, String(true))
localStorage.setItem(toolsext.localStorage.verified_email, String(myuser.verified_email)) 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.teleg_id, String(myuser.profile.teleg_id))
localStorage.setItem(toolsext.localStorage.made_gift, String(myuser.made_gift)) localStorage.setItem(toolsext.localStorage.made_gift, String(myuser.made_gift))
localStorage.setItem(toolsext.localStorage.wasAlreadySubOnDb, String(globalStore.wasAlreadySubOnDb)) 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)) return bcrypt.hash(authData.password!, bcrypt.genSaltSync(12))
.then((hashedPassword: string) => { .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.lang = mylang
authData.password = String(hashedPassword) 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.token, this.x_auth_token)
localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString()) localStorage.setItem(toolsext.localStorage.expirationDate, expirationDate.toString())
localStorage.setItem(toolsext.localStorage.verified_email, String(false)) 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 // Even if you has registered, you have to SignIn first
this.isLogged = false this.isLogged = false
// dispatch('storeUser', authData); // dispatch('storeUser', authData);
// dispatch('setLogoutTimer', myres.data.expiresIn); // dispatch('setLogoutTimer', myres.data.expiresIn);
console.log('OK')
return { code: tools.OK, msg: '' } return { code: tools.OK, msg: '' }
} else { } else {
console.log('ERR GENERICO')
return { code: toolsext.ERR_GENERICO, msg: '' } return { code: toolsext.ERR_GENERICO, msg: '' }
} }
}) })
@@ -674,6 +677,7 @@ export const useUserStore = defineStore('UserStore', {
localStorage.removeItem(toolsext.localStorage.isLogged) localStorage.removeItem(toolsext.localStorage.isLogged)
// localStorage.removeItem(rescodes.localStorage.leftDrawerOpen) // localStorage.removeItem(rescodes.localStorage.leftDrawerOpen)
localStorage.removeItem(toolsext.localStorage.verified_email) localStorage.removeItem(toolsext.localStorage.verified_email)
localStorage.removeItem(toolsext.localStorage.verified_by_aportador)
localStorage.removeItem(toolsext.localStorage.teleg_id) localStorage.removeItem(toolsext.localStorage.teleg_id)
localStorage.removeItem(toolsext.localStorage.made_gift) localStorage.removeItem(toolsext.localStorage.made_gift)
localStorage.removeItem(toolsext.localStorage.categorySel) localStorage.removeItem(toolsext.localStorage.categorySel)
@@ -759,6 +763,7 @@ export const useUserStore = defineStore('UserStore', {
const name = String(localStorage.getItem(toolsext.localStorage.name)) const name = String(localStorage.getItem(toolsext.localStorage.name))
const surname = String(localStorage.getItem(toolsext.localStorage.surname)) const surname = String(localStorage.getItem(toolsext.localStorage.surname))
const verified_email = localStorage.getItem(toolsext.localStorage.verified_email) === 'true' 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 made_gift = localStorage.getItem(toolsext.localStorage.made_gift) === 'true'
const myperm = localStorage.getItem(toolsext.localStorage.perm) const myperm = localStorage.getItem(toolsext.localStorage.perm)
let perm = 0 let perm = 0
@@ -780,6 +785,7 @@ export const useUserStore = defineStore('UserStore', {
name, name,
surname, surname,
verified_email, verified_email,
verified_by_aportador,
made_gift, made_gift,
perm, perm,
profile: { img, teleg_id, myshares: [] }, 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 === 'accepted') return [shared_consts.Accepted.CHECK_READ_GUIDELINES, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI]
if (table === 'fieldstype') return costanti.FieldTypeArr if (table === 'fieldstype') return costanti.FieldTypeArr
if (table === 'metodo_pagamento') return tools.SelectMetodiPagamento 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) let myarr = this.getListByTable(table)

View File

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

View File

@@ -15,19 +15,19 @@
</div> </div>
</div> </div>
<q-banner <q-banner
v-if="!isEmailVerified" v-if="!isEmailVerified()"
rounded rounded
class="bg-warning text-black" class="bg-warning text-black"
color="primary q-title" color="primary q-title"
style="text-align: center;"> 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> </div>
</q-banner> </q-banner>
<br> <br>
<q-banner <q-banner
v-if="!isEmailVerified" v-if="!isEmailVerified()"
rounded rounded
class="bg-warning text-black" class="bg-warning text-black"
color="primary q-title" color="primary q-title"

View File

@@ -4,6 +4,7 @@ import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n' import { useI18n } from '@/boot/i18n'
import { useUserStore } from '@store/UserStore' import { useUserStore } from '@store/UserStore'
import { useRoute } from 'vue-router' import { useRoute } from 'vue-router'
import { tools } from '@store/Modules/tools'
export default defineComponent({ export default defineComponent({
name: 'SignUp', name: 'SignUp',
@@ -21,6 +22,15 @@ export default defineComponent({
adult.value = !!$route.params.invited 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 {} return {}
}, },
}) })

View File

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