Se la window viene attivata, e se sono in fase di registrazione, allora controllo se ci sono aggiornamenti ogni 10 secondi, loadSite

Corretto che il link di registrazione se era in minuscolo l'username e venivi registrato in maiuscolo, non lo prendeva.
L'immagine di telegram occorre salvare anche la versione SMALL
Corretto filtro, se cambiavo Regione, non mi resettava la Provincia e la Città
This commit is contained in:
paoloar77
2022-03-10 00:28:07 +01:00
parent 00939b053a
commit b597a9ad4b
18 changed files with 189 additions and 65 deletions

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.7" APP_VERSION="0.3.8"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.7" APP_VERSION="0.3.8"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.7" APP_VERSION="0.3.8"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="12" APP_ID="12"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.7" APP_VERSION="0.3.8"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet" DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.3.7" APP_VERSION="0.3.8"
SERVICE_WORKER_FILE="service-worker.js" SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13" APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet DIRECTORY_LOCAL=newfreeplanet

View File

@@ -240,6 +240,7 @@ module.exports = configure((ctx) => ({
'Notify', 'Notify',
'Cookies', 'Cookies',
'Loading', 'Loading',
'AppVisibility',
], ],
iconSet: 'fontawesome-v5', iconSet: 'fontawesome-v5',
lang: 'it', // Quasar language lang: 'it', // Quasar language

View File

@@ -71,30 +71,7 @@ export default {
if (chiamaautologin) { if (chiamaautologin) {
// console.log('CHIAMA autologin_FromLocalStorage') // console.log('CHIAMA autologin_FromLocalStorage')
await userStore.autologin_FromLocalStorage($router) await userStore.autologin_FromLocalStorage($router, $q)
.then((loadstorage: any) => {
if (loadstorage) {
if ($q.screen.gt.sm) {
globalStore.setleftDrawerOpen(true)
}
/*if (toolsext.getLocale() !== '') {
// console.log('SETLOCALE :', this.$i18n.locale)
$i18n.locale = toolsext.getLocale() // Set Lang
} else {
userStore.setlang($router, this.$i18n.locale)
}*/
// console.log('lang CARICATO:', this.$i18n.locale)
//++Todo PWA: globalroutines('loadapp', '')
// Create Subscription to Push Notification
globalStore.createPushSubscription()
}
})
} else { } else {
globalStore.finishLoading = true globalStore.finishLoading = true
} }

View File

@@ -10,14 +10,23 @@
<div class="text-h6 text-center"> <div class="text-h6 text-center">
Accedi al menu inserendo le tue credenziali per entrare 🔑<br> Accedi al menu inserendo le tue credenziali per entrare 🔑<br>
<div class="text-center"> <div class="text-center">
<q-btn color="white" text-color="blue" label="Clicca qui per Accedere" @click="tools.openrighttoolbar()"/> <q-btn push color="white" text-color="blue" label="Clicca qui per Accedere" @click="tools.openrighttoolbar()"/>
</div> </div>
<br> <br>
📝 Non sei <strong>Registrato</strong>?<br> 📝 Non sei <strong>Registrato</strong>?<br>
👉🏻 Chiedi in chat il link a chi ti ha <strong>invitato</strong>.<br> 👉🏻 Chiedi in chat il link a chi ti ha <strong>invitato</strong><br>
oppure chiedi sul <a href="https://riso.app/gruppi_territoriali">Gruppo Territoriale di RISO</a> scegliendo la tua provincia !
</div> </div>
<br> <br>
</q-banner> </q-banner>
<q-banner rounded class="bg-green-8 text-white">
<div class="text-h6 text-center">
Visualizza le FAQ (Risposte alle domande più frequenti)<br>
<div class="text-center">
<q-btn color="white" push glossy text-color="black" label="Apri le FAQ" to="/faq"/>
</div>
</div>
</q-banner>
</div> </div>
<div <div

View File

@@ -335,6 +335,52 @@ export default defineComponent({
} }
function setProvinceByRegion(tableprov: string, tabregion: string, newval: any) {
const recRegion = searchList.value.find((rec) => rec.table === tabregion)
if (recRegion)
tools.setCookie(tools.COOK_SEARCH + tabregion, newval)
for (const item of searchList.value) {
if (item.table === tableprov) {
const valsaved = tools.getCookie(tools.COOK_SEARCH + tableprov + '_' + newval, costanti.FILTER_TUTTI)
const rec = searchList.value.find((rec) => rec.table === tableprov) // check if exist
let trovato = false
let arrvalues = []
if (rec) {
arrvalues = valoriopt.value(rec.value, false, false)
if (arrvalues)
trovato = arrvalues.find((rec: any) => rec[rec.key] === valsaved)
}
if (valsaved && trovato)
item.value = valsaved
else {
if (arrvalues) {
item.value = costanti.FILTER_TUTTI
}
}
} else if (item.table === toolsext.TABCITIES) {
const valsaved = tools.getCookie(tools.COOK_SEARCH + toolsext.TABCITIES + '_' + newval, costanti.FILTER_TUTTI)
const rec = searchList.value.find((rec) => rec.table === toolsext.TABCITIES) // check if exist
let trovato = false
let arrvalues = []
if (rec) {
arrvalues = valoriopt.value(rec.value, false, false)
if (arrvalues)
trovato = arrvalues.find((rec: any) => rec[rec.key] === valsaved)
}
if (valsaved && trovato)
item.value = valsaved
else {
if (arrvalues) {
item.value = costanti.FILTER_TUTTI
}
}
}
}
}
function searchval(newval: any, table: any) { function searchval(newval: any, table: any) {
console.log('searchval', newval, table) console.log('searchval', newval, table)
tools.setCookie(tools.COOK_SEARCH + table, newval) tools.setCookie(tools.COOK_SEARCH + table, newval)
@@ -346,6 +392,8 @@ export default defineComponent({
} }
} else if (table === toolsext.TABSECTORS) { } else if (table === toolsext.TABSECTORS) {
setCategBySector(toolsext.TABSKILLS, table, newval) setCategBySector(toolsext.TABSKILLS, table, newval)
} else if (table === toolsext.TABREGIONS) {
setProvinceByRegion(toolsext.TABPROVINCE, table, newval)
}else if (table === 'goods') { }else if (table === 'goods') {
setCategBySector('sectorgoods', table, newval) setCategBySector('sectorgoods', table, newval)
} }

View File

@@ -9,14 +9,14 @@ import { useQuasar } from 'quasar'
import { Chart, ChartData, ChartOptions, registerables } from 'chart.js' import { Chart, ChartData, ChartOptions, registerables } from 'chart.js'
import { LineChart, useLineChart } from 'vue-chart-3' import { BarChart, useBarChart } from 'vue-chart-3'
Chart.register(...registerables) Chart.register(...registerables)
export default defineComponent({ export default defineComponent({
name: 'CLineChart', name: 'CBarChart',
components: { LineChart }, components: { BarChart },
props: { props: {
mydata: { required: false, default: [] }, mydata: { required: false, default: [] },
title: { required: false, default: false }, title: { required: false, default: false },
@@ -38,14 +38,14 @@ export default defineComponent({
const myarrsum = ref(<any>[]) const myarrsum = ref(<any>[])
// @ts-ignore // @ts-ignore
const chartData = computed<ChartData<'line'>>(() => ({ const chartData = computed<ChartData<'bar'>>(() => ({
labels: myarrlabel.value, labels: myarrlabel.value,
datasets: [ datasets: [
{ /*{
label: 'Totali', label: 'Totali',
data: myarrsum.value, data: myarrsum.value,
backgroundColor: tools.colourNameToHex('green'), backgroundColor: tools.colourNameToHex('green'),
}, },*/
{ {
label: props.title, label: props.title,
data: myarrdata.value, data: myarrdata.value,
@@ -56,18 +56,20 @@ export default defineComponent({
], ],
})) }))
const options = computed<ChartOptions<'line'>>(() => ({ const options = computed<ChartOptions<'bar'>>(() => ({
elements: { bar: {
line: {
tension: 0.4
}
}, },
interaction: { interaction: {
intersect: false intersect: false
}, },
scales: {
y: {
beginAtZero: true
}
}
})) }))
const { lineChartProps, lineChartRef } = useLineChart({ const { barChartProps, barChartRef } = useBarChart({
chartData, chartData,
options, options,
@@ -84,7 +86,7 @@ export default defineComponent({
let rec: any let rec: any
let ind = 1 let ind = ''
for (rec of props.mydata) { for (rec of props.mydata) {
if (props.sum) { if (props.sum) {
@@ -92,11 +94,14 @@ export default defineComponent({
} else { } else {
somma = rec.count somma = rec.count
} }
let day = rec._id.split('-')
ind = day[2] + '/' + day[1]
//myarrlabel.value.push(rec._id) //myarrlabel.value.push(rec._id)
myarrlabel.value.push(ind) myarrlabel.value.push(ind)
myarrdata.value.push(rec.count) myarrdata.value.push(rec.count)
myarrsum.value.push(somma) myarrsum.value.push(somma)
ind++ // ind++
} }
} }
@@ -111,8 +116,8 @@ export default defineComponent({
getoffset, getoffset,
q, q,
options, options,
lineChartProps, barChartProps,
lineChartRef, barChartRef,
myarrdata, myarrdata,
myarrlabel, myarrlabel,
} }

View File

@@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<LineChart v-bind="lineChartProps" /> <BarChart v-bind="barChartProps" />
<!--<DoughnutChart ref="doughnutRef" :chartData="objdata" :options="options" />--> <!--<DoughnutChart ref="doughnutRef" :chartData="objdata" :options="options" />-->

View File

@@ -12,17 +12,17 @@
<q-banner <q-banner
v-if="!tools.isUsernameTelegOk()" v-if="!tools.isUsernameTelegOk()"
inline-actions rounded class="bg-green-4 text-black"> inline-actions rounded class="bg-green-4 text-black">
<br>🔑 Ora torna su Telegram ed imposta l'<b>Username di Telegram</b>:<br> <div class="text-subtitle1">🔑 E' necessario ora impostare un <b>Username su Telegram</b>:</div>
💬 In questo modo le persone potranno contattarti (sia su Telegram sia dalla APP) <strong>senza aver bisogno di condividere il tuo numero di cellulare</strong>.<br>
<br> <br>
💬 In questo modo le persone potranno contattarti su Telegram senza aver bisogno del tuo numero di cellulare, e potranno farlo anche dalla APP.<br> 👉🏻 1. Vai su Telegram, e nella pagina iniziale (dove vedi tutte le chat), premi sull'icona (tre linee orizzontali) del menu principale in alto a sinistra.<br>
<br>
👉🏻 1. Su telegram premi sull'icona (tre linee orizzontali) del menu principale in alto a sinistra.<br>
👉🏻 2. Seleziona la voce <b>Impostazioni</b> nel menu.<br> 👉🏻 2. Seleziona la voce <b>Impostazioni</b> nel menu.<br>
👉🏻 3.Premi su <b>Username</b> nella sezione account.<br> 👉🏻 3. Premi su <b>Username</b> nella sezione account.<br>
👉🏻 4. Digita il tuo username. (deve essere un nome ancora libero e non già usato da altri).<br> 👉🏻 4. Digita un <strong>username qualsiasi</strong> a tua scelta (deve essere un nome ancora libero e non già usato da altri, <u>non deve per forza coincidere con l'username che hai scelto per la APP</u>).<br>
👉🏻 5. Per confermare premi sull'icona con la spunta (V) in alto a destra.<br> 👉🏻 5. Per confermare premi sull'icona con la spunta (V) in alto a destra.<br>
🏁 Infine vai sul <b>BOT RISO</b> Telegram e scrivi OK nel messaggio. 🏁 Infine vai sul <b>BOT RISO</b> Telegram e scrivi OK nel messaggio. Ti comparirà un <strong>messaggio di Benvenuto</strong>.
<q-btn rounded color="primary" icon="fab fa-telegram" label="Apri il BOT" <q-btn rounded color="primary" icon="fab fa-telegram" label="Apri il BOT"
type="a" type="a"
:href="tools.getLinkBotTelegram()" target="_blank"></q-btn> :href="tools.getLinkBotTelegram()" target="_blank"></q-btn>
@@ -32,6 +32,10 @@
L'USERNAME SU TELEGRAM</a><br> L'USERNAME SU TELEGRAM</a><br>
<br> <br>
Se hai difficoltà, contatta la Chat del Supporto Tecnico: "Help - RISO"
<br><strong>CLICCANDO QUI</strong> 👉🏻 <a href="https://t.me/+dTHFNIwkc_phNmQ8" target="_blank"><strong>Help - RISO</strong></a>
<br><br>
</q-banner> </q-banner>
<q-banner v-else <q-banner v-else
inline-actions rounded class="bg-orange text-black"> inline-actions rounded class="bg-orange text-black">

View File

@@ -1,4 +1,4 @@
import { defineComponent, ref, computed } from 'vue' import { defineComponent, ref, computed, onMounted, watch, onBeforeUnmount } from 'vue'
import MixinBase from '@src/mixins/mixin-base' import MixinBase from '@src/mixins/mixin-base'
import { CCopyBtn } from '../CCopyBtn' import { CCopyBtn } from '../CCopyBtn'
@@ -6,6 +6,7 @@ import { useUserStore } from '@store/UserStore'
import { useQuasar } from 'quasar' import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n' import { useI18n } from '@/boot/i18n'
import { tools } from '@store/Modules/tools' import { tools } from '@store/Modules/tools'
import { useRouter } from 'vue-router'
export default defineComponent({ export default defineComponent({
name: 'CVerifyTelegram', name: 'CVerifyTelegram',
@@ -16,7 +17,58 @@ export default defineComponent({
const { t } = useI18n() const { t } = useI18n()
const userStore = useUserStore() const userStore = useUserStore()
const $router = useRouter()
const polling = ref()
watch(() => $q.appVisible, (value: any, oldval: any) => {
console.log('visible', value)
if (value && !oldval) {
// console.log('Ora è visibile !')
start()
}
if (!value && oldval) {
// console.log('Ora è invisibile !')
end()
}
})
function refresh() {
console.log('refresh')
userStore.autologin_FromLocalStorage($router, $q)
}
function load() {
start()
}
function start() {
refresh()
if (tools.notFinishReg()) {
if (!polling.value) {
polling.value = setInterval(() => {
refresh()
}, 10000)
}
}
}
function end() {
if (polling.value) {
clearInterval(polling.value)
polling.value = null
}
}
function beforeDestroy() {
end()
}
onMounted(load)
onBeforeUnmount(beforeDestroy)
return { return {
tools, tools,

View File

@@ -2661,7 +2661,7 @@ export const fieldsTable = {
value: 'provinces', value: 'provinces',
label: 'Provincia', label: 'Provincia',
columns: colProvinces, columns: colProvinces,
colkey: '_id', colkey: 'prov',
collabel: 'descr', collabel: 'descr',
remote: true, remote: true,
}, },

View File

@@ -4141,7 +4141,7 @@ export const tools = {
return userStore.my.username return userStore.my.username
else else
return false return false
}catch (e) { } catch (e) {
return '' return ''
} }
}, },
@@ -5033,6 +5033,10 @@ export const tools = {
return userStore.isUsernameTelegOk() return userStore.isUsernameTelegOk()
}, },
notFinishReg() {
return !this.isUserOk()
},
getParamsByTable(table: string) { getParamsByTable(table: string) {
let obj = { let obj = {
@@ -5277,15 +5281,15 @@ export const tools = {
const mycolchiaro = tools.colourNameToHex(newcol) const mycolchiaro = tools.colourNameToHex(newcol)
return 'background: ' + mycol + return 'background: ' + mycol +
' background: -webkit-linear-gradient('+degree+'deg, ' + mycol + ', ' + mycolchiaro + ') !important; ' + ' background: -webkit-linear-gradient(' + degree + 'deg, ' + mycol + ', ' + mycolchiaro + ') !important; ' +
' background: linear-gradient('+degree+'deg, ' + mycol + ', ' + mycolchiaro + ') !important;' ' background: linear-gradient(' + degree + 'deg, ' + mycol + ', ' + mycolchiaro + ') !important;'
}, },
getCurrentUrl(){ getCurrentUrl() {
return window.location.pathname return window.location.pathname
}, },
isCurrentUrlSignUp(){ isCurrentUrlSignUp() {
return window.location.pathname.indexOf('signup') >= 0 return window.location.pathname.indexOf('signup') >= 0
}, },

View File

@@ -62,6 +62,9 @@ export const toolsext = {
TABMYGROUPS: 'mygroups', TABMYGROUPS: 'mygroups',
TABSKILLS: 'skills', TABSKILLS: 'skills',
TABSECTORS: 'sectors', TABSECTORS: 'sectors',
TABREGIONS: 'regions',
TABCITIES: 'cities',
TABPROVINCE: 'provinces',
TABMYSKILLS: 'myskills', TABMYSKILLS: 'myskills',
TABMYGOODS: 'mygoods', TABMYGOODS: 'mygoods',
TABMYBACHECAS: 'mybachecas', TABMYBACHECAS: 'mybachecas',

View File

@@ -263,7 +263,7 @@ export const useUserStore = defineStore('UserStore', {
}, },
isUserOk(): boolean { isUserOk(): boolean {
return this.my.profile.teleg_id! > 0 && this.my.verified_by_aportador! return this.my.profile.teleg_id! > 0 && this.my.verified_by_aportador! && this.isUsernameTelegOk()
// return this.my.verified_email! && this.my.profile.teleg_id! > 0 && this.my.verified_by_aportador! // return this.my.verified_email! && this.my.profile.teleg_id! > 0 && this.my.verified_by_aportador!
}, },
@@ -838,7 +838,7 @@ export const useUserStore = defineStore('UserStore', {
// console.log('setGlobal: END') // console.log('setGlobal: END')
}, },
async autologin_FromLocalStorage($router: Router) { async autologin_FromLocalStorage($router: Router, $q: any) {
try { try {
const globalStore = useGlobalStore() const globalStore = useGlobalStore()
@@ -903,6 +903,27 @@ export const useUserStore = defineStore('UserStore', {
} }
return await this.setGlobal($router, isLogged) return await this.setGlobal($router, isLogged)
.then((loadstorage: any) => {
if (loadstorage) {
if ($q.screen.gt.sm) {
globalStore.setleftDrawerOpen(true)
}
/*if (toolsext.getLocale() !== '') {
// console.log('SETLOCALE :', this.$i18n.locale)
$i18n.locale = toolsext.getLocale() // Set Lang
} else {
userStore.setlang($router, this.$i18n.locale)
}*/
//++Todo PWA: globalroutines('loadapp', '')
// Create Subscription to Push Notification
globalStore.createPushSubscription()
}
})
// console.log('autologin _id STATE ', this._id) // console.log('autologin _id STATE ', this._id)

View File

@@ -537,7 +537,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
} }
}, },
createPushSubscription() { async createPushSubscription() {
// If Already subscribed, don't send to the Server DB // If Already subscribed, don't send to the Server DB
// if (state.wasAlreadySubOnDb) { // if (state.wasAlreadySubOnDb) {