- Provincia obbligatoria, chiedo conferma se non vuole entrare nel circuito.
This commit is contained in:
@@ -97,6 +97,7 @@ export default defineComponent({
|
||||
|
||||
if ((step.value === STEP_CIRCUIT - 1) || (step.value === STEP_CIRCUIT )) {
|
||||
mycircuit.value = circuitStore.getCircuitByProvince(strProv.value)
|
||||
userStore.savenoCircuit(isAskedToCircuit())
|
||||
}
|
||||
|
||||
if (step.value === STEP_NAME_SURNAME + 1) {
|
||||
@@ -129,7 +130,9 @@ export default defineComponent({
|
||||
extratitle: function () { return ': ' + contact.value!.profile.resid_province },
|
||||
label: t('tutorial.step_residence'),
|
||||
checkOk: function () { return contact.value ? !!contact.value.profile.resid_province : false },
|
||||
icon: 'house'
|
||||
checkOkReal: function () { return this.checkOk() },
|
||||
icon: 'house',
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
step: STEP_NAME_SURNAME, // 2
|
||||
@@ -137,7 +140,9 @@ export default defineComponent({
|
||||
extratitle: function () { return ': ' + (contact.value ? tools.getNomeUtenteEUsernameByRecUser(contact.value) : '') },
|
||||
label: t('tutorial.step_nomecognome'),
|
||||
checkOk: function () { return ((contact.value ? !!contact.value.name : false) || userStore.my.profile.noNameSurname) },
|
||||
icon: 'user'
|
||||
checkOkReal: function () { return ((contact.value ? !!contact.value.name : false)) },
|
||||
icon: 'user',
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
step: STEP_CIRCUIT,
|
||||
@@ -147,12 +152,20 @@ export default defineComponent({
|
||||
label_ok: t('tutorial.step_circuito_ok'),
|
||||
checkOk: function () {
|
||||
if (mycircuit.value) {
|
||||
return (userStore.IsMyCircuitByName(mycircuit.value.name) ||
|
||||
userStore.IsAskedCircuitByName(mycircuit.value.name))
|
||||
return ((userStore.IsMyCircuitByName(mycircuit.value.name) ||
|
||||
userStore.IsAskedCircuitByName(mycircuit.value.name))) || userStore.my.profile.noCircuit
|
||||
}
|
||||
return false
|
||||
},
|
||||
checkOkReal: function () {
|
||||
if (mycircuit.value) {
|
||||
return ((userStore.IsMyCircuitByName(mycircuit.value.name) ||
|
||||
userStore.IsAskedCircuitByName(mycircuit.value.name)))
|
||||
}
|
||||
return false
|
||||
},
|
||||
icon: 'img: images/1ris_rosso_100.png',
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
step: 4,
|
||||
@@ -162,7 +175,9 @@ export default defineComponent({
|
||||
checkOk: function () {
|
||||
return userStore.my.profile.calc.numGoodsAndServices! > 0
|
||||
},
|
||||
checkOkReal: function () { return this.checkOk() },
|
||||
icon: 'fas fa-tshirt',
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
step: STEP_FOTO,
|
||||
@@ -172,7 +187,9 @@ export default defineComponent({
|
||||
checkOk: function () {
|
||||
return !!userStore.my.profile.img
|
||||
},
|
||||
checkOkReal: function () { return this.checkOk() },
|
||||
icon: 'fas fa-tshirt',
|
||||
required: false,
|
||||
},
|
||||
{
|
||||
step: 6,
|
||||
@@ -182,7 +199,9 @@ export default defineComponent({
|
||||
checkOk: function () {
|
||||
return true
|
||||
},
|
||||
checkOkReal: function () { return this.checkOk() },
|
||||
icon: 'fas fa-tshirt',
|
||||
required: false,
|
||||
},
|
||||
]
|
||||
|
||||
@@ -302,6 +321,14 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
function isNextDisable() {
|
||||
try {
|
||||
return arrStep[step.value - 1].required && !arrStep[step.value - 1].checkOk()
|
||||
} catch (e) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
function numStepCompleted() {
|
||||
return prStep.value
|
||||
}
|
||||
@@ -327,6 +354,37 @@ export default defineComponent({
|
||||
|
||||
}
|
||||
|
||||
function isAskedToCircuit(): boolean {
|
||||
return !!(mycircuit.value && ((!userStore.IsMyCircuitByName(mycircuit.value.name) && !userStore.IsAskedCircuitByName(mycircuit.value.name))))
|
||||
}
|
||||
|
||||
function isSalta() {
|
||||
return step.value === STEP_CIRCUIT && (mycircuit.value && isAskedToCircuit())
|
||||
}
|
||||
|
||||
function askToConfirmSkip() {
|
||||
return $q.dialog({
|
||||
message: t('circuit.skipentercircuit'),
|
||||
html: true,
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
push: false,
|
||||
},
|
||||
title: '',
|
||||
cancel: true,
|
||||
persistent: false,
|
||||
}).onOk(() => {
|
||||
step.value++
|
||||
return true
|
||||
}).onCancel(() => {
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
function getColorDone(step: number) {
|
||||
return arrStep[step - 1].checkOkReal() ? 'positive' : 'negative'
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -349,6 +407,7 @@ export default defineComponent({
|
||||
mycircuit,
|
||||
userStore,
|
||||
clickFinish,
|
||||
isNextDisable,
|
||||
mycards,
|
||||
filtroutente,
|
||||
getColor,
|
||||
@@ -357,6 +416,9 @@ export default defineComponent({
|
||||
getColorTutorial,
|
||||
getFirstStepToFill,
|
||||
STEP_CIRCUIT,
|
||||
isSalta,
|
||||
askToConfirmSkip,
|
||||
getColorDone,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -48,7 +48,7 @@
|
||||
color="primary"
|
||||
animated
|
||||
vertical
|
||||
header-nav
|
||||
:header-nav="!!contact.profile.resid_province"
|
||||
>
|
||||
<q-step
|
||||
v-for="(recstep, index) in arrStep"
|
||||
@@ -57,7 +57,7 @@
|
||||
:title="recstep.title + recstep.extratitle()"
|
||||
:icon="recstep.icon"
|
||||
:done="recstep.checkOk()"
|
||||
done-color="positive"
|
||||
:done-color="getColorDone(recstep.step)"
|
||||
>
|
||||
<div
|
||||
v-if="recstep.checkOk() && recstep.label_ok"
|
||||
@@ -164,16 +164,18 @@
|
||||
class="q-ml-sm"
|
||||
/>
|
||||
<q-btn
|
||||
@click="
|
||||
step === numstep
|
||||
:flat="isSalta()"
|
||||
:disabled="isNextDisable()"
|
||||
@click="(step === STEP_CIRCUIT && isSalta()) ? askToConfirmSkip() :
|
||||
(step === numstep
|
||||
? clickFinish()
|
||||
: $refs.stepper.next()
|
||||
: $refs.stepper.next())
|
||||
"
|
||||
:color="(step === STEP_CIRCUIT && mycircuit && ((!userStore.IsMyCircuitByName(mycircuit.name) && !userStore.IsAskedCircuitByName(mycircuit.name)))) ? 'negative' : 'primary'"
|
||||
:color="isSalta() ? 'negative' : 'primary'"
|
||||
:label="
|
||||
step === numstep
|
||||
? $t('dialog.finish')
|
||||
: (step === STEP_CIRCUIT && mycircuit && ((!userStore.IsMyCircuitByName(mycircuit.name) && !userStore.IsAskedCircuitByName(mycircuit.name))) ? $t('dialog.salta'): $t('dialog.avanti'))
|
||||
: (isSalta() ? $t('dialog.salta'): $t('dialog.avanti'))
|
||||
"
|
||||
/>
|
||||
</q-stepper-navigation>
|
||||
|
||||
@@ -115,6 +115,7 @@ export interface IUserProfile {
|
||||
notif_sector_goods: number[]
|
||||
stepTutorial: number
|
||||
noNameSurname: boolean
|
||||
noCircuit: boolean
|
||||
noFoto: boolean
|
||||
|
||||
// in memory
|
||||
|
||||
@@ -1187,6 +1187,7 @@ const msg_it = {
|
||||
preferences: 'Preferenze',
|
||||
},
|
||||
circuit: {
|
||||
skipentercircuit: 'Confermare di non voler entrare ora nel Circuito RIS?\nLo si potrà comunque fare in un secondo momento, dal menu "Circuiti".',
|
||||
vaialcircuito: 'Vai al Circuito',
|
||||
iscritti: 'iscritti trovati',
|
||||
wait_acceptation: 'ℹ️ La tua richiesta è stata inoltrata. Entro breve verrai abilitato.',
|
||||
|
||||
@@ -83,6 +83,7 @@ export const DefaultUser: IUserFields = {
|
||||
notif_sector_goods: [],
|
||||
stepTutorial: 0,
|
||||
noNameSurname: false,
|
||||
noCircuit: false,
|
||||
noFoto: false,
|
||||
asked_circuits: [],
|
||||
refused_circuits: [],
|
||||
@@ -147,6 +148,7 @@ export const DefaultProfile: IUserProfile = {
|
||||
notif_sector_goods: [],
|
||||
stepTutorial: 0,
|
||||
noNameSurname: false,
|
||||
noCircuit: false,
|
||||
noFoto: false,
|
||||
asked_circuits: [],
|
||||
refused_circuits: [],
|
||||
@@ -878,6 +880,17 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return await this.execDbOpUser({mydata})
|
||||
}
|
||||
},
|
||||
async savenoCircuit(val: boolean) {
|
||||
const mydata = {
|
||||
_id: this.my._id,
|
||||
dbop: 'noCircuit',
|
||||
value: val,
|
||||
}
|
||||
if (this.my.profile.noCircuit !== val) {
|
||||
this.my.profile.noCircuit = val
|
||||
return await this.execDbOpUser({mydata})
|
||||
}
|
||||
},
|
||||
async savenoFoto(val: boolean) {
|
||||
const mydata = {
|
||||
_id: this.my._id,
|
||||
|
||||
@@ -389,6 +389,14 @@
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
<div class="row">
|
||||
<q-btn
|
||||
label="Crea Tutti i Circuiti"
|
||||
color="primary"
|
||||
@click="EseguiFunz('createAllCircuits', '', '')"
|
||||
></q-btn>
|
||||
<br />
|
||||
</div>
|
||||
|
||||
<q-field stack-label dense>
|
||||
<template v-slot:control>
|
||||
|
||||
Reference in New Issue
Block a user