- 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 )) {
|
if ((step.value === STEP_CIRCUIT - 1) || (step.value === STEP_CIRCUIT )) {
|
||||||
mycircuit.value = circuitStore.getCircuitByProvince(strProv.value)
|
mycircuit.value = circuitStore.getCircuitByProvince(strProv.value)
|
||||||
|
userStore.savenoCircuit(isAskedToCircuit())
|
||||||
}
|
}
|
||||||
|
|
||||||
if (step.value === STEP_NAME_SURNAME + 1) {
|
if (step.value === STEP_NAME_SURNAME + 1) {
|
||||||
@@ -129,7 +130,9 @@ export default defineComponent({
|
|||||||
extratitle: function () { return ': ' + contact.value!.profile.resid_province },
|
extratitle: function () { return ': ' + contact.value!.profile.resid_province },
|
||||||
label: t('tutorial.step_residence'),
|
label: t('tutorial.step_residence'),
|
||||||
checkOk: function () { return contact.value ? !!contact.value.profile.resid_province : false },
|
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
|
step: STEP_NAME_SURNAME, // 2
|
||||||
@@ -137,7 +140,9 @@ export default defineComponent({
|
|||||||
extratitle: function () { return ': ' + (contact.value ? tools.getNomeUtenteEUsernameByRecUser(contact.value) : '') },
|
extratitle: function () { return ': ' + (contact.value ? tools.getNomeUtenteEUsernameByRecUser(contact.value) : '') },
|
||||||
label: t('tutorial.step_nomecognome'),
|
label: t('tutorial.step_nomecognome'),
|
||||||
checkOk: function () { return ((contact.value ? !!contact.value.name : false) || userStore.my.profile.noNameSurname) },
|
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,
|
step: STEP_CIRCUIT,
|
||||||
@@ -147,12 +152,20 @@ export default defineComponent({
|
|||||||
label_ok: t('tutorial.step_circuito_ok'),
|
label_ok: t('tutorial.step_circuito_ok'),
|
||||||
checkOk: function () {
|
checkOk: function () {
|
||||||
if (mycircuit.value) {
|
if (mycircuit.value) {
|
||||||
return (userStore.IsMyCircuitByName(mycircuit.value.name) ||
|
return ((userStore.IsMyCircuitByName(mycircuit.value.name) ||
|
||||||
userStore.IsAskedCircuitByName(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
|
return false
|
||||||
},
|
},
|
||||||
icon: 'img: images/1ris_rosso_100.png',
|
icon: 'img: images/1ris_rosso_100.png',
|
||||||
|
required: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
step: 4,
|
step: 4,
|
||||||
@@ -162,7 +175,9 @@ export default defineComponent({
|
|||||||
checkOk: function () {
|
checkOk: function () {
|
||||||
return userStore.my.profile.calc.numGoodsAndServices! > 0
|
return userStore.my.profile.calc.numGoodsAndServices! > 0
|
||||||
},
|
},
|
||||||
|
checkOkReal: function () { return this.checkOk() },
|
||||||
icon: 'fas fa-tshirt',
|
icon: 'fas fa-tshirt',
|
||||||
|
required: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
step: STEP_FOTO,
|
step: STEP_FOTO,
|
||||||
@@ -172,7 +187,9 @@ export default defineComponent({
|
|||||||
checkOk: function () {
|
checkOk: function () {
|
||||||
return !!userStore.my.profile.img
|
return !!userStore.my.profile.img
|
||||||
},
|
},
|
||||||
|
checkOkReal: function () { return this.checkOk() },
|
||||||
icon: 'fas fa-tshirt',
|
icon: 'fas fa-tshirt',
|
||||||
|
required: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
step: 6,
|
step: 6,
|
||||||
@@ -182,7 +199,9 @@ export default defineComponent({
|
|||||||
checkOk: function () {
|
checkOk: function () {
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
checkOkReal: function () { return this.checkOk() },
|
||||||
icon: 'fas fa-tshirt',
|
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() {
|
function numStepCompleted() {
|
||||||
return prStep.value
|
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)
|
onMounted(mounted)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
@@ -349,6 +407,7 @@ export default defineComponent({
|
|||||||
mycircuit,
|
mycircuit,
|
||||||
userStore,
|
userStore,
|
||||||
clickFinish,
|
clickFinish,
|
||||||
|
isNextDisable,
|
||||||
mycards,
|
mycards,
|
||||||
filtroutente,
|
filtroutente,
|
||||||
getColor,
|
getColor,
|
||||||
@@ -357,6 +416,9 @@ export default defineComponent({
|
|||||||
getColorTutorial,
|
getColorTutorial,
|
||||||
getFirstStepToFill,
|
getFirstStepToFill,
|
||||||
STEP_CIRCUIT,
|
STEP_CIRCUIT,
|
||||||
|
isSalta,
|
||||||
|
askToConfirmSkip,
|
||||||
|
getColorDone,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -48,7 +48,7 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
animated
|
animated
|
||||||
vertical
|
vertical
|
||||||
header-nav
|
:header-nav="!!contact.profile.resid_province"
|
||||||
>
|
>
|
||||||
<q-step
|
<q-step
|
||||||
v-for="(recstep, index) in arrStep"
|
v-for="(recstep, index) in arrStep"
|
||||||
@@ -57,7 +57,7 @@
|
|||||||
:title="recstep.title + recstep.extratitle()"
|
:title="recstep.title + recstep.extratitle()"
|
||||||
:icon="recstep.icon"
|
:icon="recstep.icon"
|
||||||
:done="recstep.checkOk()"
|
:done="recstep.checkOk()"
|
||||||
done-color="positive"
|
:done-color="getColorDone(recstep.step)"
|
||||||
>
|
>
|
||||||
<div
|
<div
|
||||||
v-if="recstep.checkOk() && recstep.label_ok"
|
v-if="recstep.checkOk() && recstep.label_ok"
|
||||||
@@ -164,16 +164,18 @@
|
|||||||
class="q-ml-sm"
|
class="q-ml-sm"
|
||||||
/>
|
/>
|
||||||
<q-btn
|
<q-btn
|
||||||
@click="
|
:flat="isSalta()"
|
||||||
step === numstep
|
:disabled="isNextDisable()"
|
||||||
|
@click="(step === STEP_CIRCUIT && isSalta()) ? askToConfirmSkip() :
|
||||||
|
(step === numstep
|
||||||
? clickFinish()
|
? 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="
|
:label="
|
||||||
step === numstep
|
step === numstep
|
||||||
? $t('dialog.finish')
|
? $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>
|
</q-stepper-navigation>
|
||||||
|
|||||||
@@ -115,6 +115,7 @@ export interface IUserProfile {
|
|||||||
notif_sector_goods: number[]
|
notif_sector_goods: number[]
|
||||||
stepTutorial: number
|
stepTutorial: number
|
||||||
noNameSurname: boolean
|
noNameSurname: boolean
|
||||||
|
noCircuit: boolean
|
||||||
noFoto: boolean
|
noFoto: boolean
|
||||||
|
|
||||||
// in memory
|
// in memory
|
||||||
|
|||||||
@@ -1187,6 +1187,7 @@ const msg_it = {
|
|||||||
preferences: 'Preferenze',
|
preferences: 'Preferenze',
|
||||||
},
|
},
|
||||||
circuit: {
|
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',
|
vaialcircuito: 'Vai al Circuito',
|
||||||
iscritti: 'iscritti trovati',
|
iscritti: 'iscritti trovati',
|
||||||
wait_acceptation: 'ℹ️ La tua richiesta è stata inoltrata. Entro breve verrai abilitato.',
|
wait_acceptation: 'ℹ️ La tua richiesta è stata inoltrata. Entro breve verrai abilitato.',
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ export const DefaultUser: IUserFields = {
|
|||||||
notif_sector_goods: [],
|
notif_sector_goods: [],
|
||||||
stepTutorial: 0,
|
stepTutorial: 0,
|
||||||
noNameSurname: false,
|
noNameSurname: false,
|
||||||
|
noCircuit: false,
|
||||||
noFoto: false,
|
noFoto: false,
|
||||||
asked_circuits: [],
|
asked_circuits: [],
|
||||||
refused_circuits: [],
|
refused_circuits: [],
|
||||||
@@ -147,6 +148,7 @@ export const DefaultProfile: IUserProfile = {
|
|||||||
notif_sector_goods: [],
|
notif_sector_goods: [],
|
||||||
stepTutorial: 0,
|
stepTutorial: 0,
|
||||||
noNameSurname: false,
|
noNameSurname: false,
|
||||||
|
noCircuit: false,
|
||||||
noFoto: false,
|
noFoto: false,
|
||||||
asked_circuits: [],
|
asked_circuits: [],
|
||||||
refused_circuits: [],
|
refused_circuits: [],
|
||||||
@@ -878,6 +880,17 @@ export const useUserStore = defineStore('UserStore', {
|
|||||||
return await this.execDbOpUser({mydata})
|
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) {
|
async savenoFoto(val: boolean) {
|
||||||
const mydata = {
|
const mydata = {
|
||||||
_id: this.my._id,
|
_id: this.my._id,
|
||||||
|
|||||||
@@ -389,6 +389,14 @@
|
|||||||
></q-btn>
|
></q-btn>
|
||||||
<br />
|
<br />
|
||||||
</div>
|
</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>
|
<q-field stack-label dense>
|
||||||
<template v-slot:control>
|
<template v-slot:control>
|
||||||
|
|||||||
Reference in New Issue
Block a user