- Migliorata la Notifica degli Eventi su Telegram
- Gli annunci (beni/servizi/ospitalità) ora possono essere visti anche tramite un link, anche per chi non è dentro alla App. - Aggiunto bottone "Aggiorna" per aggiornare il Saldo attuale. - I "Conti Collettivi" ora vengono chiamati Gruppi (o Conto di Gruppo).
This commit is contained in:
@@ -69,11 +69,11 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
return 'red'
|
||||
},
|
||||
|
||||
getCircuitByName(circuitname: string): ICircuit | undefined | null {
|
||||
getCircuitByName(circuitname: string): ICircuit | undefined | null {
|
||||
return this.listcircuits.find((rec: ICircuit) => rec.name === circuitname)
|
||||
},
|
||||
|
||||
getCircuitByProvince(prov: string): ICircuit | undefined | null {
|
||||
getCircuitByProvince(prov: string): ICircuit | undefined | null {
|
||||
return this.listcircuits.find((rec: ICircuit) => rec.strProv === prov)
|
||||
},
|
||||
|
||||
@@ -81,20 +81,20 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
return this.listcircuits.find((rec: ICircuit) => rec._id === circuitId)
|
||||
},
|
||||
|
||||
getNameByCircuitId(circuitId: string): string {
|
||||
getNameByCircuitId(circuitId: string): string {
|
||||
const circuit = this.getCircuitByCircuitId(circuitId);
|
||||
return circuit && circuit.name ? circuit.name : ''
|
||||
},
|
||||
|
||||
getCircuitsLabelValue(): any {
|
||||
getCircuitsLabelValue(): any {
|
||||
let arr = []
|
||||
for (const circ of this.listcircuits) {
|
||||
arr.push({label: circ.name, value: circ._id})
|
||||
arr.push({ label: circ.name, value: circ._id })
|
||||
}
|
||||
return arr
|
||||
},
|
||||
|
||||
getCircuitByPath(circuitpath: string): ICircuit | null {
|
||||
getCircuitByPath(circuitpath: string): ICircuit | null {
|
||||
const ris = this.listcircuits.find((rec: ICircuit) => rec.path === circuitpath)
|
||||
return ris ? ris : null
|
||||
},
|
||||
@@ -109,7 +109,18 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
|
||||
},
|
||||
|
||||
getCircuitsListByGroup(mygrp: IMyGroup): ICircuit[] {
|
||||
async aggiornaSaldo(circuitId: string) {
|
||||
return Api.SendReq('/users/updatesaldo', 'POST', { circuitId })
|
||||
.then((res) => {
|
||||
if (res.data.ris)
|
||||
tools.updateMyData(res.data.ris)
|
||||
}).catch((error) => {
|
||||
return {}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
getCircuitsListByGroup(mygrp: IMyGroup): ICircuit[] {
|
||||
return this.listcircuits.filter((rec: ICircuit) => mygrp.mycircuits!.findIndex((circ: IMyCircuit) => circ.circuitname === rec.name) >= 0)
|
||||
},
|
||||
|
||||
@@ -122,21 +133,21 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
},
|
||||
|
||||
getAccountByCircuitId(circuitId: string): any {
|
||||
if (this.listaccounts) {
|
||||
/*if (this.listaccounts) {
|
||||
return this.listaccounts.find((rec: IAccount) => rec.circuitId === circuitId)
|
||||
}
|
||||
return null
|
||||
return null*/
|
||||
},
|
||||
getAccountsListNameValue(): any[] {
|
||||
let arr = []
|
||||
|
||||
if (this.listaccounts) {
|
||||
for (const acc of this.listaccounts) {
|
||||
let chi = acc.username ? acc.username : (acc.groupname ? 'Collettivo: ' + acc.groupname : 'Comunitario: ' + acc.contocom)
|
||||
let chi = acc.username ? acc.username : (acc.groupname ? 'Gruppo: ' + acc.groupname : 'Comunitario: ' + acc.contocom)
|
||||
if (acc.circuitId) {
|
||||
chi = '[' + this.getNameByCircuitId(acc.circuitId) + '] ' + chi
|
||||
}
|
||||
arr.push({label: chi, value: acc._id})
|
||||
arr.push({ label: chi, value: acc._id })
|
||||
}
|
||||
}
|
||||
return arr
|
||||
|
||||
Reference in New Issue
Block a user