diff --git a/.env.development b/.env.development index 7c0d3ff5..c4b5774e 100755 --- a/.env.development +++ b/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.3" + APP_VERSION="0.3.5" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/insiemesipuo.app/.env.development b/_ALL_SITES/insiemesipuo.app/.env.development index e7d325fb..115156b0 100755 --- a/_ALL_SITES/insiemesipuo.app/.env.development +++ b/_ALL_SITES/insiemesipuo.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.3" + APP_VERSION="0.3.5" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/popolodelnuovomondo.app/.env.development b/_ALL_SITES/popolodelnuovomondo.app/.env.development index d0db3b69..33daf0c9 100755 --- a/_ALL_SITES/popolodelnuovomondo.app/.env.development +++ b/_ALL_SITES/popolodelnuovomondo.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.3" + APP_VERSION="0.3.5" SERVICE_WORKER_FILE="service-worker.js" APP_ID="12" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/riso.app/.env.development b/_ALL_SITES/riso.app/.env.development index 7c0d3ff5..c4b5774e 100755 --- a/_ALL_SITES/riso.app/.env.development +++ b/_ALL_SITES/riso.app/.env.development @@ -1,4 +1,4 @@ -APP_VERSION="0.3.3" + APP_VERSION="0.3.5" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL="newfreeplanet" diff --git a/_ALL_SITES/riso.app/.env.test b/_ALL_SITES/riso.app/.env.test index bceb6759..e0199691 100755 --- a/_ALL_SITES/riso.app/.env.test +++ b/_ALL_SITES/riso.app/.env.test @@ -1,4 +1,4 @@ -APP_VERSION="0.3.3" + APP_VERSION="0.3.5" SERVICE_WORKER_FILE="service-worker.js" APP_ID="13" DIRECTORY_LOCAL=newfreeplanet diff --git a/package.json b/package.json index 76be1953..642e1bbc 100755 --- a/package.json +++ b/package.json @@ -33,6 +33,7 @@ "autoprefixer": "^10.4.2", "axios": "^0.26.0", "bcryptjs": "^2.4.3", + "chart.js": "^3.7.1", "core-js": "^3.21.0", "crypto": "^1.0.1", "date-fns": "^2.28.0", @@ -57,6 +58,7 @@ "register-service-worker": "^1.7.2", "vee-validate": "^4.5.8", "vue": "^3.2.31", + "vue-chart-3": "^3.1.2", "vue-class-component": "^8.0.0-rc.1", "vue-country-code": "^1.1.3", "vue-echarts": "^6.0.2", diff --git a/src/common/shared_vuejs.ts b/src/common/shared_vuejs.ts index eddfa054..021a220a 100755 --- a/src/common/shared_vuejs.ts +++ b/src/common/shared_vuejs.ts @@ -110,8 +110,6 @@ export const shared_consts = { TABLES_PERM_CHANGE_FOR_USERS: ['myskills', 'mybachecas', 'mygoods'], TABLES_VISU_LISTA_USER: ['myskills', 'mybachecas', 'mygoods', 'users'], - - TABLES_VISU_IMG: ['myskills', 'mybachecas', 'mygoods', 'mygroups'], TABLES_DIRECTORY_A_PARTE: ['mygroups'], diff --git a/src/components/CBigBtn/CBigBtn.vue b/src/components/CBigBtn/CBigBtn.vue index 363a7cb3..a137e168 100755 --- a/src/components/CBigBtn/CBigBtn.vue +++ b/src/components/CBigBtn/CBigBtn.vue @@ -1,11 +1,11 @@ Errore di Connessione al Server

{{globalStore.getMsgServerError()}}

+

Se l'Errore persiste, significa che questo browser non riesce a collegarsi col Server.
+ Soluzione: Provare ad installare un altro browser:
+ 👉🏻 Clicca per installare Opera per Android.

[]) + const myarrdata = ref([]) + const myarrsum = ref([]) + + // @ts-ignore + const chartData = computed>(() => ({ + labels: myarrlabel.value, + datasets: [ + { + label: 'Totali', + data: myarrsum.value, + backgroundColor: tools.colourNameToHex('green'), + }, + { + label: props.title, + data: myarrdata.value, + borderColor: tools.colourNameToHex('red'), + backgroundColor: tools.colourNameToHex(props.color), + fill: true, + }, + ], + })) + + const options = computed>(() => ({ + elements: { + line: { + tension: 0.4 + } + }, + interaction: { + intersect: false + }, + })) + + const { lineChartProps, lineChartRef } = useLineChart({ + chartData, + options, + + }) + + function mounted() { + myarrdata.value = [] + myarrlabel.value = [] + myarrsum.value = [] + + let somma = 0 + if (props.sum) + somma = props.offset + + let rec: any + + let ind = 1 + + for (rec of props.mydata) { + if (props.sum) { + somma += rec.count + } else { + somma = rec.count + } + //myarrlabel.value.push(rec._id) + myarrlabel.value.push(ind) + myarrdata.value.push(rec.count) + myarrsum.value.push(somma) + ind++ + } + } + + function getoffset() { + return props.offset + } + + onMounted(mounted) + + return { + tools, + getoffset, + q, + options, + lineChartProps, + lineChartRef, + myarrdata, + myarrlabel, + } + }, +}) diff --git a/src/components/CLineChart/CLineChart.vue b/src/components/CLineChart/CLineChart.vue new file mode 100755 index 00000000..9861d767 --- /dev/null +++ b/src/components/CLineChart/CLineChart.vue @@ -0,0 +1,19 @@ + + + + + diff --git a/src/components/CLineChart/index.ts b/src/components/CLineChart/index.ts new file mode 100755 index 00000000..07de45af --- /dev/null +++ b/src/components/CLineChart/index.ts @@ -0,0 +1 @@ +export {default as CLineChart} from './CLineChart.vue' diff --git a/src/components/CMainView/CMainView.ts b/src/components/CMainView/CMainView.ts index 82269114..d5de6456 100755 --- a/src/components/CMainView/CMainView.ts +++ b/src/components/CMainView/CMainView.ts @@ -4,7 +4,7 @@ import { useRouter } from 'vue-router' import { useGlobalStore } from '@store/globalStore' import { useI18n } from '@/boot/i18n' import { tools } from '@store/Modules/tools' -import { costanti } from '@store/Modules/costanti' +import { costanti, IMainCard } from '@store/Modules/costanti' import { CBigBtn } from '@/components/CBigBtn' @@ -22,11 +22,12 @@ export default defineComponent({ const showInfo = ref(false) const cardsbig = computed(() => { - return costanti.MAINCARDS.filter((rec: any) => !rec.small) + // @ts-ignore + return costanti.MAINCARDS.filter((rec: IMainCard) => !rec.small && rec.visible) }) const cardssmall = computed(() => { - return costanti.MAINCARDS.filter((rec: any) => rec.small) + return costanti.MAINCARDS.filter((rec: any) => rec.small && rec.visible) }) return { diff --git a/src/components/CMyFieldRec/CMyFieldRec.ts b/src/components/CMyFieldRec/CMyFieldRec.ts index 0b0982e2..c66b7baa 100755 --- a/src/components/CMyFieldRec/CMyFieldRec.ts +++ b/src/components/CMyFieldRec/CMyFieldRec.ts @@ -85,6 +85,11 @@ export default defineComponent({ tupe: Boolean, required: false, default: false, + }, + fieldtype: { + tupe: String, + required: false, + default: '', } }, components: { CMyPopupEdit }, @@ -141,7 +146,7 @@ export default defineComponent({ console.log('showandsel CMyFieldDb', row, col, newval) if (newval !== valinitial) - setValDb($q, mykey.value, newval, col.fieldtype, false, props.table, mysubkey.value, props.id, props.indrec, mysubsubkey.value) + setValDb($q, mykey.value, newval, props.fieldtype || col.fieldtype, false, props.table, mysubkey.value, props.id, props.indrec, mysubsubkey.value) } function withBorder() { diff --git a/src/components/CMyFieldRec/CMyFieldRec.vue b/src/components/CMyFieldRec/CMyFieldRec.vue index 9c3c6f14..458ede7a 100755 --- a/src/components/CMyFieldRec/CMyFieldRec.vue +++ b/src/components/CMyFieldRec/CMyFieldRec.vue @@ -28,7 +28,7 @@ :field="mykey" :subfield="mysubkey" :mysubsubkey="mysubsubkey" - :type="col.fieldtype" + :type="fieldtype || col.fieldtype" :serv="false" :disable="disable" :jointable="jointable" diff --git a/src/components/CSignUp/CSignUp.ts b/src/components/CSignUp/CSignUp.ts index 4d4f4507..2cdecaa4 100755 --- a/src/components/CSignUp/CSignUp.ts +++ b/src/components/CSignUp/CSignUp.ts @@ -56,6 +56,11 @@ export default defineComponent({ required: false, default: true, }, + need_Telegram: { + type: Boolean, + required: false, + default: false, + }, }, setup(props, { emit }) { const $q = useQuasar() @@ -289,6 +294,7 @@ export default defineComponent({ signup, iamadult, v$, + t, allowSubmit, myRuleEmail, } diff --git a/src/components/CSignUp/CSignUp.vue b/src/components/CSignUp/CSignUp.vue index 3f8e977b..e72d71ec 100755 --- a/src/components/CSignUp/CSignUp.vue +++ b/src/components/CSignUp/CSignUp.vue @@ -4,6 +4,14 @@

+ + + +

diff --git a/src/components/CStatusReg/CStatusReg.scss b/src/components/CStatusReg/CStatusReg.scss new file mode 100755 index 00000000..e69de29b diff --git a/src/components/CStatusReg/CStatusReg.ts b/src/components/CStatusReg/CStatusReg.ts new file mode 100755 index 00000000..bb9e8fd9 --- /dev/null +++ b/src/components/CStatusReg/CStatusReg.ts @@ -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(null) + const numpolled = ref(0) + + const datastat = ref({ + 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, + } + + } +}) diff --git a/src/components/CStatusReg/CStatusReg.vue b/src/components/CStatusReg/CStatusReg.vue new file mode 100755 index 00000000..8b587426 --- /dev/null +++ b/src/components/CStatusReg/CStatusReg.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/src/components/CStatusReg/index.ts b/src/components/CStatusReg/index.ts new file mode 100755 index 00000000..270f4a4c --- /dev/null +++ b/src/components/CStatusReg/index.ts @@ -0,0 +1 @@ +export {default as CStatusReg} from './CStatusReg.vue' diff --git a/src/components/CUserNonVerif/CUserNonVerif.vue b/src/components/CUserNonVerif/CUserNonVerif.vue index 1cc92643..614b6316 100755 --- a/src/components/CUserNonVerif/CUserNonVerif.vue +++ b/src/components/CUserNonVerif/CUserNonVerif.vue @@ -4,9 +4,9 @@ - +