- comune residenza anche sulla email
- comune non obbligatorio... Skippa
This commit is contained in:
@@ -373,6 +373,10 @@ export const shared_consts = {
|
||||
label: 'Con Provincia inserita',
|
||||
value: 16777216, //FILTER_USER_PROVINCE:
|
||||
},
|
||||
{
|
||||
label: 'Con Comune inserito',
|
||||
value: 8589934592, //FILTER_USER_COMUNE: 8589934592,
|
||||
},
|
||||
],
|
||||
|
||||
RECFILTRI_UTENTE_FACIL: [
|
||||
|
||||
@@ -145,7 +145,7 @@ export default defineComponent({
|
||||
});
|
||||
|
||||
const userstoverify = computed(() => {
|
||||
return userStore.my.profile.userstoverify;
|
||||
return contact.value.profile.userstoverify;
|
||||
});
|
||||
|
||||
// Step definitions
|
||||
@@ -159,15 +159,20 @@ export default defineComponent({
|
||||
},
|
||||
label: t('tutorial.step_residence'),
|
||||
checkOk: function (): boolean {
|
||||
return contact.value
|
||||
? (!!contact.value.profile.resid_str_comune &&
|
||||
contact.value.profile.resid_str_comune !== '' &&
|
||||
contact.value.profile.resid_str_comune !== '0') ||
|
||||
contact.value.profile.noComune
|
||||
: false;
|
||||
},
|
||||
checkOkReal: function (): boolean {
|
||||
return contact.value
|
||||
? !!contact.value.profile.resid_str_comune &&
|
||||
contact.value.profile.resid_str_comune !== '' &&
|
||||
contact.value.profile.resid_str_comune !== '0'
|
||||
: false;
|
||||
},
|
||||
checkOkReal: function (): boolean {
|
||||
return this.checkOk();
|
||||
},
|
||||
icon: 'fas fa-map-marker-alt',
|
||||
required: true,
|
||||
}));
|
||||
@@ -185,7 +190,8 @@ export default defineComponent({
|
||||
return (
|
||||
userStore.IsMyCircuitByName(mycircuit.value.name) ||
|
||||
userStore.IsAskedCircuitByName(mycircuit.value.name) ||
|
||||
userStore.my.profile.noCircuit
|
||||
contact.value.profile.noCircuit ||
|
||||
contact.value.profile.noComune
|
||||
);
|
||||
}
|
||||
return false;
|
||||
@@ -215,9 +221,10 @@ export default defineComponent({
|
||||
return (
|
||||
userStore.IsMyCircuitByName(circuititalia.value.name) ||
|
||||
userStore.IsAskedCircuitByName(circuititalia.value.name) ||
|
||||
userStore.my.profile.noCircIta ||
|
||||
userStore.my.profile.noCircuit ||
|
||||
userStore.my.profile.insert_circuito_ita
|
||||
contact.value.profile.noCircIta ||
|
||||
contact.value.profile.noCircuit ||
|
||||
contact.value.profile.noComune ||
|
||||
contact.value.profile.insert_circuito_ita
|
||||
);
|
||||
}
|
||||
return false;
|
||||
@@ -422,6 +429,12 @@ export default defineComponent({
|
||||
return isSalta(currentStep.value.step);
|
||||
});
|
||||
|
||||
const isCurrentStepComune = computed(() => {
|
||||
if (!currentStep.value) return false;
|
||||
// Mostra bottone Salta se lo step corrente è un circuito (locale o italia)
|
||||
return currentStep.value.step === STEP_CITY;
|
||||
});
|
||||
|
||||
const isCurrentStepCircuit = computed(() => {
|
||||
if (!currentStep.value) return false;
|
||||
// Mostra bottone Salta se lo step corrente è un circuito (locale o italia)
|
||||
@@ -500,7 +513,7 @@ export default defineComponent({
|
||||
|
||||
try {
|
||||
const response = await Api.SendReq('/api/telegram/generate-token', 'POST', {
|
||||
username: userStore.my.username,
|
||||
username: contact.value.username,
|
||||
});
|
||||
|
||||
verificationToken.value = response.data.token;
|
||||
@@ -699,10 +712,9 @@ export default defineComponent({
|
||||
|
||||
function isSalta(step: number) {
|
||||
return (
|
||||
(step === STEP_CIRCUIT && mycircuit.value && userStore.my.profile.noCircuit) ||
|
||||
(step === STEP_CIRCUIT_ITALIA &&
|
||||
circuititalia.value &&
|
||||
userStore.my.profile.noCircIta)
|
||||
(step === STEP_CITY && contact.value.profile.noComune) ||
|
||||
(step === STEP_CIRCUIT && contact.value.profile.noCircuit) ||
|
||||
(step === STEP_CIRCUIT_ITALIA && contact.value.profile.noCircIta)
|
||||
);
|
||||
}
|
||||
|
||||
@@ -721,7 +733,7 @@ export default defineComponent({
|
||||
persistent: false,
|
||||
})
|
||||
.onOk(() => {
|
||||
userStore.savenoCircuit(isAskedToCircuit());
|
||||
userStore.savenoCircuit(true); // isAskedToCircuit()
|
||||
// Avanza allo step successivo
|
||||
if (canGoNext.value) {
|
||||
goToNextStep();
|
||||
@@ -733,6 +745,8 @@ export default defineComponent({
|
||||
});
|
||||
} else if (mystep === STEP_CIRCUIT_ITALIA) {
|
||||
askToConfirmSkipItalia(mystep);
|
||||
} else if (mystep === STEP_CITY) {
|
||||
askToConfirmSkipComune(mystep);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -763,6 +777,39 @@ export default defineComponent({
|
||||
return false;
|
||||
});
|
||||
}
|
||||
function askToConfirmSkipComune(mystep: number) {
|
||||
let msg = t('circuit.skipcomune');
|
||||
|
||||
if (!stepCircuit.value.checkOk()) {
|
||||
msg = t('circuit.skipcomune_circuiti_non_entrato');
|
||||
}
|
||||
|
||||
return $q
|
||||
.dialog({
|
||||
message: msg,
|
||||
html: true,
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
push: false,
|
||||
},
|
||||
title: '',
|
||||
cancel: true,
|
||||
persistent: false,
|
||||
})
|
||||
.onOk(() => {
|
||||
if (mystep === STEP_CITY) {
|
||||
userStore.savenoComune(true);
|
||||
}
|
||||
// Avanza allo step successivo
|
||||
if (canGoNext.value) {
|
||||
goToNextStep();
|
||||
}
|
||||
return true;
|
||||
})
|
||||
.onCancel(() => {
|
||||
return false;
|
||||
});
|
||||
}
|
||||
|
||||
// ========================================
|
||||
// TUTORIAL METHODS
|
||||
@@ -782,6 +829,7 @@ export default defineComponent({
|
||||
const firstIncompleteIndex = orderedSteps.value.findIndex(
|
||||
(step) => !step.completed
|
||||
);
|
||||
console.log('firstIncompleteIndex', firstIncompleteIndex);
|
||||
if (firstIncompleteIndex !== -1) {
|
||||
currentStepIndex.value = firstIncompleteIndex;
|
||||
updateExpandedSteps();
|
||||
@@ -798,6 +846,12 @@ export default defineComponent({
|
||||
strProv.value,
|
||||
card.value
|
||||
);
|
||||
// Se la provincia selezionata non esiste, mostra comunque il primo Circuito in cui si è entrati !
|
||||
if (!strProv.value && contact.value.profile.mycircuits.length >= 0) {
|
||||
mycircuit.value = circuitStore.getCircuitByName(
|
||||
contact.value.profile.mycircuits[0].circuitname
|
||||
);
|
||||
}
|
||||
if (!globalStore.isPresenteCardsByProv(strProv.value)) {
|
||||
if (contact.value && contact.value.profile.resid_card) {
|
||||
contact.value.profile.resid_card = '';
|
||||
@@ -882,6 +936,11 @@ export default defineComponent({
|
||||
card.value
|
||||
);
|
||||
}
|
||||
if (!mycircuit.value && !strProv.value && contact.value.profile.mycircuits.length >= 0) {
|
||||
mycircuit.value = circuitStore.getCircuitByName(
|
||||
contact.value.profile.mycircuits[0].circuitname
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -955,6 +1014,7 @@ export default defineComponent({
|
||||
t,
|
||||
updateContact,
|
||||
strProv,
|
||||
isCurrentStepComune,
|
||||
};
|
||||
},
|
||||
});
|
||||
|
||||
@@ -216,11 +216,16 @@
|
||||
class="q-mt-md"
|
||||
/>
|
||||
|
||||
<p class="step-description">
|
||||
<p v-if="contact.profile.resid_province" class="step-description">
|
||||
Entra nel circuito locale per scambiare beni e servizi con le persone
|
||||
vicino a te.
|
||||
</p>
|
||||
|
||||
<div v-if="!contact.profile.resid_province" class="q-ma-sm q-pa-sm bordered" style="border: 2px solid red;">
|
||||
⚠️ Attenzione: Se non si sceglie il Comune di Residenza (il passaggio precedente) non è possibile poter scegliere la Provincia in cui accedere al Circuito RIS del tuo territorio.
|
||||
</div>
|
||||
|
||||
|
||||
<q-select
|
||||
v-if="mylistcircuits && mylistcircuits.length > 1"
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
@@ -293,9 +298,9 @@
|
||||
|
||||
<q-space />
|
||||
|
||||
<!-- Bottone Salta (Solo per circuiti) -->
|
||||
<!-- Bottone Salta (Solo per circuiti e Comune) -->
|
||||
<q-btn
|
||||
v-if="isCurrentStepCircuit"
|
||||
v-if="isCurrentStepCircuit || isCurrentStepComune"
|
||||
rounded
|
||||
color="negative"
|
||||
icon="skip_next"
|
||||
|
||||
@@ -166,6 +166,7 @@ export interface IUserProfile {
|
||||
stepTutorial: number
|
||||
noNameSurname: boolean
|
||||
noCircuit: boolean
|
||||
noComune?: boolean
|
||||
noCircIta: boolean
|
||||
insert_circuito_ita?: boolean
|
||||
noFoto: boolean
|
||||
|
||||
@@ -272,6 +272,15 @@
|
||||
mykey="Biografia"
|
||||
:myvalue="myuser.profile.biografia"
|
||||
/>
|
||||
<CKeyAndValue
|
||||
mykey="Saltato Comune"
|
||||
:myvalue="myuser.profile.noComune"
|
||||
:show-set-button="true"
|
||||
:on-set-value="userStore.savenoComune"
|
||||
:valuetoSet="false"
|
||||
:param2="myuser._id"
|
||||
button-tooltip="Reset No Comune"
|
||||
/>
|
||||
<CKeyAndValue
|
||||
mykey="Saltato Circuito Prov"
|
||||
:myvalue="myuser.profile.noCircuit"
|
||||
|
||||
@@ -1512,8 +1512,10 @@ const msg_it = {
|
||||
link_chat: 'Gruppo Telegram {name}',
|
||||
link_group: 'Gruppo Telegram',
|
||||
chat_gruppo_telegram_circuito: 'Entra nella chat di Gruppo Telegram dove conoscerai persone della tua provincia',
|
||||
skipentercircuit: 'Confermare di non voler entrare ora nel Circuito RIS?\nLo si potrà comunque fare in un secondo momento, dal menu "Circuiti".',
|
||||
skipentercircuit_italia: 'Confermare di non voler entrare ora nel Circuito RIS ITALIA?\nLo si potrà comunque fare in un secondo momento, dal menu "Circuiti".',
|
||||
skipentercircuit: 'Confermare di non voler entrare ora nel Circuito RIS?\nLo si potrà comunque fare in un secondo momento, dal menu "Profilo" -> "Modifica Profilo".',
|
||||
skipentercircuit_italia: 'Confermare di non voler entrare ora nel Circuito RIS ITALIA?\nLo si potrà comunque fare in un secondo momento, dal menu "Profilo" -> "Modifica Profilo".',
|
||||
skipcomune: 'Confermare di non voler inserire il Comune di Residenza?\nLo si potrà comunque fare in un secondo momento, dal menu "Profilo" -> "Modifica Profilo".',
|
||||
skipcomune_circuiti_non_entrato: 'Confermare di non voler inserire il Comune di Residenza?\n\nIn questo modo non sarà possibile poter far richiesta di entrare nel Circuito RIS del tuo territorio.\n\nLo si potrà comunque fare in un secondo momento, dal menu "Profilo" -> "Modifica Profilo".',
|
||||
vaialcircuito: 'Vai al Circuito',
|
||||
iscritti: 'iscritti trovati',
|
||||
addtothereceiverlist: 'Aggiungiti alla Lista dei Riceventi',
|
||||
|
||||
@@ -112,6 +112,7 @@ export const DefaultUser: IUserFields = {
|
||||
stepTutorial: 0,
|
||||
noNameSurname: false,
|
||||
noCircuit: false,
|
||||
noComune: false,
|
||||
noCircIta: false,
|
||||
insert_circuito_ita: false,
|
||||
noFoto: false,
|
||||
@@ -189,6 +190,7 @@ export const DefaultProfile: IUserProfile = {
|
||||
stepTutorial: 0,
|
||||
noNameSurname: false,
|
||||
noCircuit: false,
|
||||
noComune: false,
|
||||
noCircIta: false,
|
||||
insert_circuito_ita: false,
|
||||
noFoto: false,
|
||||
@@ -1281,6 +1283,21 @@ export const useUserStore = defineStore('UserStore', {
|
||||
}
|
||||
return await this.execDbOpUser({ mydata });
|
||||
},
|
||||
async savenoComune(val: boolean, userId?: string) {
|
||||
const mydata = {
|
||||
_id: userId ? userId : this.my._id,
|
||||
dbop: 'noComune',
|
||||
value: val,
|
||||
};
|
||||
|
||||
if (userId) {
|
||||
} else {
|
||||
if (this.my.profile.noComune !== val) {
|
||||
this.my.profile.noComune = val;
|
||||
}
|
||||
}
|
||||
return await this.execDbOpUser({ mydata });
|
||||
},
|
||||
async setPwdComeQuellaDellAdmin(val: boolean, userId?: string) {
|
||||
const mydata = {
|
||||
_id: userId,
|
||||
|
||||
Reference in New Issue
Block a user