diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index e776b50..3fd6e57 100644 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -1,4 +1,10 @@ export const shared_consts = { + Accepted: { + CHECK_READ_GUIDELINES: 1, + CHECK_SEE_VIDEO_PRINCIPI: 2, + }, + + ALL_SAW_AND_ACCEPTED: 3, FILTER_EXTRALIST_NOT_REGISTERED: 1, FILTER_EXTRALIST_NOT_CONTACTED: 2, diff --git a/src/components/CCopyBtn/CCopyBtn.ts b/src/components/CCopyBtn/CCopyBtn.ts index 5116673..de55b23 100644 --- a/src/components/CCopyBtn/CCopyBtn.ts +++ b/src/components/CCopyBtn/CCopyBtn.ts @@ -19,7 +19,7 @@ export default class CCopyBtn extends Vue { } public copytoclip() { - tools.copyStringToClipboard(this, this.texttocopy) + tools.copyStringToClipboard(this, this.texttocopy, true) } } diff --git a/src/components/CGallery/CGallery.ts b/src/components/CGallery/CGallery.ts index f8d1ef3..4eee514 100644 --- a/src/components/CGallery/CGallery.ts +++ b/src/components/CGallery/CGallery.ts @@ -190,7 +190,7 @@ export default class CGallery extends MixinBase { public copytoclipboard(rec) { const filename = this.getfullname(rec) - tools.copyStringToClipboard(this, filename) + tools.copyStringToClipboard(this, filename, true) } public async deleteFile(rec) { diff --git a/src/components/CMyDashboard/CMyDashboard.ts b/src/components/CMyDashboard/CMyDashboard.ts index dd27898..9aa4432 100644 --- a/src/components/CMyDashboard/CMyDashboard.ts +++ b/src/components/CMyDashboard/CMyDashboard.ts @@ -18,6 +18,7 @@ import { tools } from '../../store/Modules/tools' import { lists } from '../../store/Modules/lists' import { validations } from './CMyDashboard-validate' import { validationMixin } from 'vuelidate' +import { shared_consts } from '../../common/shared_vuejs' @Component({ mixins: [validationMixin], @@ -76,15 +77,29 @@ export default class CMyDashboard extends MixinUsers { info: '', }, { - icon: 'fas fa-video', - textlang: 'steps.zoom_partecipa', + icon: 'fas fa-file-signature', + textlang: 'steps.linee_guida', textadd(user) { return '' }, isok(user) { if (user) if (user.profile) - return user.profile.saw_zoom_presentation + return tools.isBitActive(user.profile.saw_and_accepted, shared_consts.Accepted.CHECK_READ_GUIDELINES) + return false + }, + info: '', + }, + { + icon: 'fas fa-tv', + textlang: 'steps.video_intro', + textadd(user) { + return '' + }, + isok(user) { + if (user) + if (user.profile) + return tools.isBitActive(user.profile.saw_and_accepted, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI) return false }, info: '', diff --git a/src/components/CMyDashboard/CMyDashboard.vue b/src/components/CMyDashboard/CMyDashboard.vue index 2670bb0..d5cd4b4 100644 --- a/src/components/CMyDashboard/CMyDashboard.vue +++ b/src/components/CMyDashboard/CMyDashboard.vue @@ -57,6 +57,17 @@ +
+ + +
+ -
- {{$t('reg.submit')}} +
diff --git a/src/components/CSignUp/CSignUp.vue b/src/components/CSignUp/CSignUp.vue index 850eef7..a62e2ed 100644 --- a/src/components/CSignUp/CSignUp.vue +++ b/src/components/CSignUp/CSignUp.vue @@ -167,8 +167,7 @@
- - {{$t('reg.submit')}} +
diff --git a/src/components/CSignUpNotevole/CSignUpNotevole.ts b/src/components/CSignUpNotevole/CSignUpNotevole.ts index 55c2699..70cf8bf 100644 --- a/src/components/CSignUpNotevole/CSignUpNotevole.ts +++ b/src/components/CSignUpNotevole/CSignUpNotevole.ts @@ -68,6 +68,10 @@ export default class CSignUpNotevole extends MixinBase { this.$v.$reset() this.signup.aportador_solidario = this.$route.params.invited + + if (!this.signup.aportador_solidario) + this.signup.aportador_solidario = tools.getCookie(tools.APORTADOR_SOLIDARIO, this.signup.aportador_solidario) + if (!this.signup.aportador_solidario) { this.signup.aportador_solidario = tools.APORTADOR_NONE } diff --git a/src/components/CSignUpNotevole/CSignUpNotevole.vue b/src/components/CSignUpNotevole/CSignUpNotevole.vue index 3195f02..cbc3bcc 100644 --- a/src/components/CSignUpNotevole/CSignUpNotevole.vue +++ b/src/components/CSignUpNotevole/CSignUpNotevole.vue @@ -202,8 +202,7 @@
- - {{$t('privacy_policy')}} +
@@ -229,8 +228,7 @@
- - {{$t('reg.submit')}} +
diff --git a/src/components/CStatus/CStatus.ts b/src/components/CStatus/CStatus.ts index 884b77e..8ba4895 100644 --- a/src/components/CStatus/CStatus.ts +++ b/src/components/CStatus/CStatus.ts @@ -13,16 +13,21 @@ import { CVerifyEmail } from '../CVerifyTelegram' import { CCopyBtn } from '../CCopyBtn' import { CVideo } from '../CVideo' import { CRequisiti } from '../CRequisiti' +import { shared_consts } from '../../common/shared_vuejs' +import { CGuidelines } from '../CGuidelines' +import { CVideoPromo } from '../CVideoPromo' @Component({ - components: { CTitleBanner, CMyFieldDb, CMyInnerPage, CVerifyTelegram, CVerifyEmail, CCopyBtn, CVideo, CRequisiti } + components: { CTitleBanner, CMyFieldDb, CMyInnerPage, CVerifyTelegram, CVerifyEmail, CCopyBtn, CVideo, CRequisiti, CGuidelines, CVideoPromo } }) export default class CStatus extends MixinBase { + @Prop({ required: false, default: false }) public dense: boolean public $v public $t: any - public step = 1 - public NUMSTEP_START = 3 + public step = 0 + public steptodo = 0 + public NUMSTEP_OBBLIGATORI = 9 get numpayment() { if (UserStore.state.my.profile) @@ -33,15 +38,86 @@ export default class CStatus extends MixinBase { } public arrsteps = [ + // { + // title: 'steps.chat_biblio', + // descr: 'steps.chat_biblio_long', + // page: '', + // funccheck(index) { + // return true + // }, + // funccheck_error(index) { + // return false + // } + // }, + { - title: 'steps.chat_biblio', - descr: 'steps.chat_biblio_long', + title: 'reg.email', + descr: '', page: '', + icon: 'mail', funccheck(index) { - return true + return UserStore.state.my.verified_email }, funccheck_error(index) { - return false + return true + }, + funcok() { + return 'pages.statusreg.verified' + }, + funcko() { + return 'pages.statusreg.nonverified' + } + }, + { + title: 'reg.telegram', + descr: '', + page: '', + icon: 'fab fa-telegram', + funccheck(index) { + return UserStore.state.my.profile.teleg_id > 0 + }, + funccheck_error(index) { + return true + }, + funcok() { + return 'pages.statusreg.verified' + }, + funcko() { + return 'pages.statusreg.nonverified' + }, + }, + { + title: 'steps.linee_guida', + descr: '', + page: '', + funccheck(index) { + return tools.isBitActive(UserStore.state.my.profile.saw_and_accepted, shared_consts.Accepted.CHECK_READ_GUIDELINES) + }, + funccheck_error(index) { + return true + }, + funcok() { + return '' + }, + funcko() { + return '' + } + }, + { + title: 'steps.video_intro', + descr: '', + page: '', + funccheck(index) { + return tools.isBitActive(UserStore.state.my.profile.saw_and_accepted, shared_consts.Accepted.CHECK_SEE_VIDEO_PRINCIPI) + }, + funccheck_error(index) { + return true + }, + funcok() { + return '' + }, + funcko() { + return '' } }, { @@ -53,7 +129,13 @@ export default class CStatus extends MixinBase { }, funccheck_error(index) { return true - } + }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, { title: 'steps.dream', @@ -69,6 +151,12 @@ export default class CStatus extends MixinBase { funccheck_error(index) { return true }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, { title: 'steps.paymenttype', @@ -91,6 +179,12 @@ export default class CStatus extends MixinBase { funccheck_error(index) { return true }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, { title: 'steps.sharemovement', @@ -103,6 +197,12 @@ export default class CStatus extends MixinBase { funccheck_error(index) { return true }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, { title: 'steps.enter_prog', @@ -114,6 +214,12 @@ export default class CStatus extends MixinBase { funccheck_error(index) { return false }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, { title: 'steps.collaborate', @@ -125,6 +231,12 @@ export default class CStatus extends MixinBase { funccheck_error(index) { return false }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, { title: 'steps.dono', @@ -136,6 +248,12 @@ export default class CStatus extends MixinBase { funccheck_error(index) { return false }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, { title: 'steps.support', @@ -147,6 +265,12 @@ export default class CStatus extends MixinBase { funccheck_error(index) { return false }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, { title: 'steps.ricevo_dono', @@ -158,45 +282,40 @@ export default class CStatus extends MixinBase { funccheck_error(index) { return false }, + funcok() { + return '' + }, + funcko() { + return '' + }, }, - - /* - sharemovement: 'Condivido il movimento', - sharemovement_long: 'Condivido il movimento con almeno 2 amici e li guido alla registrazione e agli zoom', - enter_prog: 'entro in Programmazione', - enter_prog_long: 'entro in programmazione, e vengo aggiunto al Mandala, ed entro così nella chat corrispondente.', - collaborate: 'Collaborazione', - collaborate_long: 'Continuo a collaborare con il miei compagni, per arrivare al giorno della programmazione dove si attiverà il mio Mandala', - dono: 'Dono', - dono_long: 'Faccio il mio dono al proprietario della Bigliettera', - support: 'Sostengo il movimento', - support_long: 'Continuo a sostenere il movimento partecipando attivamente! Organizzando zoom e partecipando, sostenendo, informando, aiutando e diffondendo', - ricevo_dono: 'Ricevo il mio dono e CELEBRO', - ricevo_dono_long: 'Ricevo il mio dono e CELEBRO', - */ - ] public setstep() { - if (this.isEmailVerified) { - this.step = 2 - if (this.TelegVerificato) { - this.step = 3 - for (let indstep = 0; indstep < this.arrsteps.length; indstep++) { - if (this.arrsteps[indstep].funccheck(indstep)) { - this.step++ - } - } - // if (this.numpayment > 0) { - // this.step = 4 - // } + this.step = 0 + for (let indstep = 0; indstep < this.arrsteps.length; indstep++) { + if (this.arrsteps[indstep].funccheck(indstep)) { + this.step++ + } else { + return } } - // console.log('step', this.step) } - public mounted() { + public setsteptodo() { + this.steptodo = 0 + for (let indstep = 0; indstep < this.arrsteps.length; indstep++) { + if (this.arrsteps[indstep].funccheck(indstep)) { + this.steptodo++ + } else { + return + } + } + } + + public created() { this.setstep() + this.setsteptodo() } get TelegVerificato() { @@ -207,18 +326,11 @@ export default class CStatus extends MixinBase { return UserStore.state.my.verified_email } - get emailtext() { - if (this.isEmailVerified) - return `Email ` + this.$t('pages.statusreg.verified') - else - return `Email ` + this.$t('pages.statusreg.nonverified') - } - get telegramtext() { if (this.TelegVerificato) - return `Telegram ` + this.$t('pages.statusreg.verified') + return this.$t('reg.telegram') + ' ' + this.$t('pages.statusreg.verified') else - return `Telegram ` + this.$t('pages.statusreg.nonverified') + return this.$t('reg.telegram') + ' ' + this.$t('pages.statusreg.nonverified') } get paymenttext() { @@ -226,7 +338,7 @@ export default class CStatus extends MixinBase { } get getlaststep() { - return this.arrsteps.length + this.NUMSTEP_START - 1 + return this.arrsteps.length - 1 } public getnuminvitati() { @@ -240,7 +352,7 @@ export default class CStatus extends MixinBase { public getnuminvitati_attivi() { if (UserStore.state.my) if (UserStore.state.my.calcstat) - // console.log('numinvitati', UserStore.state.my.calcstat) + // console.log('numinvitati', UserStore.state.my.calcstat) return UserStore.state.my.calcstat.numinvitati_attivi return 0 @@ -249,6 +361,9 @@ export default class CStatus extends MixinBase { public gettextstep(step) { let tit = this.$t(step.title) + if (step.funcok()) + tit += ' ' + this.$t(step.funcok()) + if (step.title === 'steps.sharemovement') { tit += ' (' + this.getnuminvitati_attivi() + ' / ' + this.getnuminvitati() + ' invitati Attivi)' } else if (step.title === 'steps.paymenttype') { @@ -263,7 +378,7 @@ export default class CStatus extends MixinBase { } public copylink() { - tools.copyStringToClipboard(this, this.getRefLink) + tools.copyStringToClipboard(this, this.getRefLink, true) } public getiferror(checkerror, value) { @@ -300,12 +415,12 @@ export default class CStatus extends MixinBase { return 'https://t.me/joinchat/AL2qKExZKvenLgpVhOyefQ' } - public geticonstep(title) { - if (title === 'steps.chat_biblio') { - return 'settings' - } else { + public geticonstep(mystep) { + if (!!mystep.icon) + return mystep.icon + else return 'check-circle' - } + } public geticoncolor(title) { @@ -349,6 +464,48 @@ export default class CStatus extends MixinBase { return false } + get percstep() { + return (this.getstep / this.NUMSTEP_OBBLIGATORI) + } + get getstep() { + let mystep = 0 + for (let indstep = 0; indstep < this.arrsteps.length; indstep++) { + if (this.arrsteps[indstep].funccheck(indstep)) { + mystep++ + } + } + return mystep + } + get progressstep() { + return this.$t(this.arrsteps[this.steptodo].title) + } + + get strpercstep() { + return 'Completati ' + (this.getstep + 1) + ' passi su ' + this.NUMSTEP_OBBLIGATORI + } + + get stepcompleti() { + return this.getstep + 1 === this.NUMSTEP_OBBLIGATORI + } + + public scrolltostep(mystep) { + this.step = mystep + if (mystep > 0 ) + mystep -= 1 + const element = document.getElementById('step' + mystep) + tools.scrollToElement(element) + + } + + public nextstep(index) { + this.step = index + 1 + this.setsteptodo() + + setTimeout(() => { + this.scrolltostep(this.step) + }, 500) + + } } diff --git a/src/components/CStatus/CStatus.vue b/src/components/CStatus/CStatus.vue index 58fe3ec..3eb2cc1 100644 --- a/src/components/CStatus/CStatus.vue +++ b/src/components/CStatus/CStatus.vue @@ -1,44 +1,68 @@ diff --git a/src/components/CStatusReg/CStatusReg.vue b/src/components/CStatusReg/CStatusReg.vue index ff0314a..aa8feb0 100644 --- a/src/components/CStatusReg/CStatusReg.vue +++ b/src/components/CStatusReg/CStatusReg.vue @@ -11,13 +11,14 @@
- - - + + + - -
diff --git a/src/components/CTitleBanner/CTitleBanner.ts b/src/components/CTitleBanner/CTitleBanner.ts index 0094880..77a4538 100644 --- a/src/components/CTitleBanner/CTitleBanner.ts +++ b/src/components/CTitleBanner/CTitleBanner.ts @@ -34,9 +34,9 @@ export default class CTitleBanner extends Vue { @Prop({ required: false, default: true }) public visible: boolean @Prop({ required: false, default: false }) public canopen: boolean - public myvisible: boolean = true + public myvisible: boolean = false - public mounted() { + public created() { this.myvisible = this.visible } diff --git a/src/components/CTitleBanner/CTitleBanner.vue b/src/components/CTitleBanner/CTitleBanner.vue index 9d6f5dc..62002fa 100644 --- a/src/components/CTitleBanner/CTitleBanner.vue +++ b/src/components/CTitleBanner/CTitleBanner.vue @@ -19,7 +19,7 @@ -
+
diff --git a/src/components/index.ts b/src/components/index.ts index 04a50a2..176eae8 100644 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -53,3 +53,5 @@ export * from './CUserBadge' export * from './CMyDashboard' export * from './CLegenda' export * from './CRequisito' +export * from './CGuidelines' +export * from './CVideoPromo' diff --git a/src/mixins/mixin-base.ts b/src/mixins/mixin-base.ts index 861ff2b..8b8e075 100644 --- a/src/mixins/mixin-base.ts +++ b/src/mixins/mixin-base.ts @@ -37,9 +37,17 @@ export default class MixinBase extends MixinMetaTags { } public getValDb(keystr, serv, def?, table?, subkey?) { + return tools.getValDb(keystr, serv, def, table, subkey) } + public getValDbLang(keystr, serv, def?, table?, subkey?) { + let ris = tools.getValDb(keystr + '_' + tools.getLocale(), serv, def, table, subkey) + if (ris === def) + ris = tools.getValDb(keystr + '_it', serv, def, table, subkey) + return ris + } + public async setValDb(key, value, type, serv: boolean, table?, subkey?) { // console.log('setValDb', key, value, serv, table, subkey) diff --git a/src/model/GlobalStore.ts b/src/model/GlobalStore.ts index 7cd17ea..84326fc 100644 --- a/src/model/GlobalStore.ts +++ b/src/model/GlobalStore.ts @@ -330,6 +330,7 @@ export interface IFunctionality { SHOW_ONLY_POLICY?: boolean SHOW_MESSAGES?: boolean BOOKING_EVENTS?: boolean + ENABLE_REG_AYNI?: boolean } export interface IParamsQuery { diff --git a/src/model/NotevoleStore.ts b/src/model/NotevoleStore.ts index e3eb3a2..4e88e1a 100644 --- a/src/model/NotevoleStore.ts +++ b/src/model/NotevoleStore.ts @@ -14,6 +14,7 @@ export interface INotData { num_teleg_attivo?: number num_teleg_pending?: number num_part_zoom?: number + num_part_accepted?: number num_users_dream?: number arr_nations?: string lastsreg?: IUserFields[] diff --git a/src/model/UserStore.ts b/src/model/UserStore.ts index 3b16812..2681775 100644 --- a/src/model/UserStore.ts +++ b/src/model/UserStore.ts @@ -23,6 +23,7 @@ export interface IUserProfile { paymenttypes?: IPaymentType[] manage_telegram?: boolean saw_zoom_presentation?: boolean + saw_and_accepted?: boolean } export interface IPaymentType { @@ -93,7 +94,6 @@ export interface IUserState { isManager?: boolean isTeacher?: boolean usersList?: IUserFields[] - permissionsList?: IPerm[] countusers?: number lastparamquery?: any } diff --git a/src/rootgen/admin/newsletter/newsletter.vue b/src/rootgen/admin/newsletter/newsletter.vue index 0196e31..e594fb2 100644 --- a/src/rootgen/admin/newsletter/newsletter.vue +++ b/src/rootgen/admin/newsletter/newsletter.vue @@ -197,10 +197,10 @@ jointable="templemail"> - - Crea Nuovo Invio Newsletter Schedulato tra 1 minuto + Crea Nuovo Invio Newsletter Schedulato tra 3 minuti