Aggiunto messaggio nella registrazione, dicendo che occorre avere Telegram installato.
PASSARE TUTTI I _DOC e mettergli .lean() prima dello then() -> velocizza le Query di Mongodb "Floriterapia costellazioni familiari coach motivazionale Tecniche Essene" Inserimento Gruppi: anche il comune obbligatorio Far comparire le ultime persone registrate Mettere il controllo dell'abilitazione del BOT Telegram solo dopo che conosco il suo username, e cosi gli metto anche il contatto telegram. risolto foto profilo di telegram che non si salvava in automatico tolto il controllo della email aggiunto msg se errore al server, installare altro browser.
This commit is contained in:
0
src/components/CStatusReg/CStatusReg.scss
Executable file
0
src/components/CStatusReg/CStatusReg.scss
Executable file
172
src/components/CStatusReg/CStatusReg.ts
Executable file
172
src/components/CStatusReg/CStatusReg.ts
Executable file
@@ -0,0 +1,172 @@
|
||||
import {
|
||||
computed,
|
||||
defineComponent, onBeforeMount, onBeforeUnmount, onMounted, ref, toRef, toRefs, watch,
|
||||
} from 'vue'
|
||||
|
||||
import { INotData } from '../../model/index'
|
||||
import MixinBase from '@src/mixins/mixin-base'
|
||||
import { CTitleBanner } from '@components'
|
||||
import { CCardState } from '../CCardState'
|
||||
import { CMyFieldRec } from '../CMyFieldRec'
|
||||
import { CCardStat } from '../CCardStat'
|
||||
import { CLineChart } from '@components'
|
||||
|
||||
// import { CGeoChart } from '@components'
|
||||
// import { CListNationality } from '@components'
|
||||
|
||||
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { costanti } from '@costanti'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CStatusReg',
|
||||
props: {},
|
||||
components: { CTitleBanner, CCardState, CCardStat, CLineChart, CMyFieldRec },
|
||||
setup(props, { attrs, slots, emit }) {
|
||||
const { t } = useI18n()
|
||||
const globalStore = useGlobalStore()
|
||||
const userStore = useUserStore()
|
||||
|
||||
const NUMSEC_TO_POLLING = ref(300)
|
||||
const MAXNUM_POLLING = ref(10)
|
||||
|
||||
const myloadingload = ref(false)
|
||||
const eseguipolling = ref(false)
|
||||
const polling = ref(<any>null)
|
||||
const numpolled = ref(0)
|
||||
|
||||
const datastat = ref(<any>{
|
||||
num_reg: 0,
|
||||
num_passeggeri: 0,
|
||||
num_imbarcati: 0,
|
||||
num_teleg_attivo: 0,
|
||||
email_non_verif: 0,
|
||||
num_teleg_pending: 0,
|
||||
lastsreg: [],
|
||||
checkuser: { verified_email: false }
|
||||
})
|
||||
|
||||
const visustat = computed(() => {
|
||||
return datastat.value.num_reg! > 0
|
||||
})
|
||||
|
||||
const telegnonattivi = computed(() => {
|
||||
return datastat.value.num_reg! - datastat.value.num_teleg_attivo!
|
||||
})
|
||||
|
||||
const emailnonverif = computed(() => {
|
||||
return datastat.value.email_non_verif
|
||||
})
|
||||
|
||||
const lastsreg = computed(() => {
|
||||
return datastat.value.lastsreg
|
||||
})
|
||||
|
||||
function checkifpolling() {
|
||||
if (userStore.my.profile) {
|
||||
if (!tools.isUserOk() && tools.appid() === tools.IDAPP_RISO)
|
||||
NUMSEC_TO_POLLING.value = 10
|
||||
}
|
||||
|
||||
if (eseguipolling.value) {
|
||||
clearInterval(polling.value)
|
||||
polling.value = null
|
||||
if (numpolled.value > 100) {
|
||||
NUMSEC_TO_POLLING.value = 60 * 5
|
||||
}
|
||||
if (numpolled.value < MAXNUM_POLLING.value) {
|
||||
if (!polling.value) {
|
||||
polling.value = setInterval(() => {
|
||||
load()
|
||||
numpolled.value++
|
||||
}, NUMSEC_TO_POLLING.value * 1000)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function beforeDestroy() {
|
||||
clearInterval(polling.value)
|
||||
}
|
||||
|
||||
function created() {
|
||||
if (tools.isManager()) {
|
||||
MAXNUM_POLLING.value = 100
|
||||
}
|
||||
load()
|
||||
}
|
||||
|
||||
async function load() {
|
||||
// console.log('load')
|
||||
myloadingload.value = true
|
||||
datastat.value = await globalStore.getStatSite()
|
||||
|
||||
// console.log('datastat.value.lastsreg')
|
||||
// console.table(datastat.value.lastsreg)
|
||||
|
||||
// console.log('newsstate')
|
||||
// console.table('GlobalStore.state.serv_settings', GlobalStore.state.serv_settings)
|
||||
|
||||
eseguipolling.value = true
|
||||
|
||||
// console.log('eseguipolling', eseguipolling)
|
||||
myloadingload.value = false
|
||||
|
||||
if (userStore.my) {
|
||||
if (datastat.value.checkuser) {
|
||||
if (datastat.value.checkuser.verified_email && !userStore.my.verified_email) {
|
||||
userStore.my.verified_email = true
|
||||
riaggiorna()
|
||||
}
|
||||
if (userStore.my.profile && datastat.value.checkuser.profile) {
|
||||
if ((userStore.my.profile.teleg_id! <= 0 && datastat.value.checkuser.profile.teleg_id > 0) ||
|
||||
(userStore.my.profile.teleg_id! !== datastat.value.checkuser.profile.teleg_id!)) {
|
||||
userStore.my.profile.teleg_id = datastat.value.checkuser.profile.teleg_id
|
||||
riaggiorna()
|
||||
}
|
||||
if ((userStore.my.profile.teleg_checkcode! <= 0 && datastat.value.checkuser.profile.teleg_checkcode > 0) ||
|
||||
(userStore.my.profile.teleg_checkcode !== datastat.value.checkuser.profile.teleg_checkcode)) {
|
||||
userStore.my.profile.teleg_checkcode = datastat.value.checkuser.profile.teleg_checkcode
|
||||
riaggiorna()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
checkifpolling()
|
||||
}
|
||||
|
||||
function riaggiorna() {
|
||||
// clearInterval(polling)
|
||||
// polling = null
|
||||
checkifpolling()
|
||||
}
|
||||
|
||||
function calcperc(val1: number, valmax: number) {
|
||||
if (valmax > 0)
|
||||
return (val1 / valmax * 100)
|
||||
else
|
||||
return 0
|
||||
}
|
||||
|
||||
created()
|
||||
|
||||
onBeforeUnmount(beforeDestroy)
|
||||
|
||||
return {
|
||||
calcperc,
|
||||
riaggiorna,
|
||||
visustat,
|
||||
telegnonattivi,
|
||||
emailnonverif,
|
||||
lastsreg,
|
||||
datastat,
|
||||
tools,
|
||||
costanti,
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
112
src/components/CStatusReg/CStatusReg.vue
Executable file
112
src/components/CStatusReg/CStatusReg.vue
Executable file
@@ -0,0 +1,112 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="visustat">
|
||||
<CTitleBanner class="q-pa-xs" :title="$t('pages.status')" bgcolor="bg-primary" clcolor="text-white"
|
||||
mystyle="" myclass="myshad" :canopen="true">
|
||||
|
||||
|
||||
<div class="flex flex-center">
|
||||
|
||||
<CCardState :mytext="$t('pages.statusreg.reg')" :myval="datastat.num_reg"
|
||||
:myperc="100"></CCardState>
|
||||
|
||||
<div class="q-pa-xs" v-if="datastat.num_part_accepted > 1">
|
||||
<CCardStat :mytext="$t('stat.accepted')" :myval="datastat.num_part_accepted"></CCardStat>
|
||||
<!--<CCardStat :mytext="$t('stat.modalita_pagamento')"
|
||||
:myval="datastat.num_modalita_pagamento"></CCardStat>-->
|
||||
<!--<CCardStat :mytext="$t('stat.requisiti')" :myval="datastat.num_requisiti"></CCardStat>-->
|
||||
<!--<CCardStat :mytext="$t('stat.qualificati')" :myval="datastat.num_qualificati"></CCardStat>-->
|
||||
<!--<CCardStat v-if="emailnonverif" :mytext="$t('stat.email_not_verif')" :myval="emailnonverif"
|
||||
mycol="negative"></CCardStat>
|
||||
<CCardStat v-if="telegnonattivi" :mytext="$t('stat.telegram_non_attivi')"
|
||||
:myval="telegnonattivi"
|
||||
mycol="negative"></CCardStat>
|
||||
<CCardStat v-if="datastat.num_teleg_pending > 0" :mytext="$t('stat.telegram_pendenti')"
|
||||
:myval="datastat.num_teleg_pending" mycol="negative"></CCardStat>-->
|
||||
</div>
|
||||
|
||||
<div class="column animazione">
|
||||
<div class="text-center">{{$t('pages.statusreg.newreg')}}</div>
|
||||
<transition-group name="fade" mode="out-in"
|
||||
appear
|
||||
enter-active-class="animazione fadeIn"
|
||||
leave-active-class="animazione fadeOut">
|
||||
|
||||
<q-item v-for="(user, index) in lastsreg" :key="index" class="q-mb-xs animated"
|
||||
v-ripple>
|
||||
|
||||
<!--
|
||||
<q-item-section avatar>
|
||||
<q-avatar v-if="tools.geticon(user.profile.nationality)"
|
||||
:class="tools.geticon(user.profile.nationality)">
|
||||
|
||||
</q-avatar>
|
||||
<q-avatar v-else color="primary" text-color="white" class="text-center">
|
||||
{{ tools.capitalize(user.profile.nationality) }}
|
||||
</q-avatar>
|
||||
</q-item-section>-->
|
||||
|
||||
<q-item-section>
|
||||
<q-item-label lines="1">
|
||||
<CMyFieldRec
|
||||
table="users"
|
||||
:id="user._id"
|
||||
:rec="user"
|
||||
field="username"
|
||||
:canEdit="false"
|
||||
:canModify="false"
|
||||
:type="costanti.FieldType.username_chip">
|
||||
</CMyFieldRec>
|
||||
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side>
|
||||
<q-item-label>{{ tools.getstrDateTimeShort(user.date_reg) }}</q-item-label>
|
||||
<q-chip outline color="green" text-color="white" icon-right="fas fa-user-plus"
|
||||
size="xs"></q-chip>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</transition-group>
|
||||
</div>
|
||||
|
||||
<!--<CGeoChart :mydata="datastat.arr_nations">
|
||||
|
||||
</CGeoChart>-->
|
||||
|
||||
<div class="row q-pa-sm text-center justify-center">
|
||||
<!--
|
||||
<div class="clBorderZoom">
|
||||
<CListNationality :mydata="datastat.arr_nations">
|
||||
|
||||
</CListNationality>
|
||||
</div>-->
|
||||
<div class="clBorderTutor">
|
||||
<CLineChart :mydata="datastat.reg_daily" :title="$t('stat.reg_daily')" color="blue" bordercolor="blue" :sum="true">
|
||||
|
||||
</CLineChart>
|
||||
|
||||
<!--<CLineChart :mydata="datastat.reg_weekly" :title="$t('stat.reg_weekly')" color="blue" bordercolor="green" :sum="true">
|
||||
|
||||
</CLineChart>-->
|
||||
|
||||
|
||||
<!--<CLineChart :mydata="datastat.reg_daily" :title="$t('stat.reg_total')"
|
||||
:offset="datastat.numreg_untilday" :sum="true"
|
||||
:mycolors="['#0b0', '#666']">
|
||||
|
||||
</CLineChart>-->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</CTitleBanner>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CStatusReg.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CStatusReg.scss';
|
||||
</style>
|
||||
1
src/components/CStatusReg/index.ts
Executable file
1
src/components/CStatusReg/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CStatusReg} from './CStatusReg.vue'
|
||||
Reference in New Issue
Block a user