Version 1.0.1 with RIS Circuit Money Exchange !
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.3.24"
|
||||
APP_VERSION="1.0.1"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.3.24"
|
||||
APP_VERSION="1.0.1"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.3.24"
|
||||
APP_VERSION="1.0.1"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.3.24"
|
||||
APP_VERSION="1.0.1"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="12"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.3.24"
|
||||
APP_VERSION="1.0.1"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.3.24"
|
||||
APP_VERSION="1.0.1"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.3.24"
|
||||
APP_VERSION="1.0.1"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="14"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.3.24"
|
||||
APP_VERSION="1.0.1"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="14"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "riso",
|
||||
"version": "0.3.23",
|
||||
"version": "1.0.1",
|
||||
"description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.",
|
||||
"productName": "Riso",
|
||||
"author": "Paolo Arena",
|
||||
|
||||
@@ -1015,6 +1015,12 @@ export const shared_consts = {
|
||||
labeltrans: 'typenotifs.circuits',
|
||||
descr: 'typenotifs.circuits_descr',
|
||||
icon:'fas fa-coins',
|
||||
list: [
|
||||
{
|
||||
value: 1, // ID_CIRCUIT_NEW_REC
|
||||
labeltrans: 'notifsid.circuits_new',
|
||||
}
|
||||
],
|
||||
},
|
||||
{
|
||||
value: 6, //
|
||||
@@ -1072,6 +1078,11 @@ export const shared_consts = {
|
||||
labeltrans: 'notifsid.groups_new',
|
||||
directory: 4,
|
||||
},
|
||||
{
|
||||
value: 1, // GroupsNotifs.STATUS_GROUPS_NEW
|
||||
labeltrans: 'notifsid.circuits_new',
|
||||
directory: 5,
|
||||
},
|
||||
],
|
||||
|
||||
|
||||
|
||||
@@ -31,6 +31,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
color_border: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
icon: {
|
||||
type: String,
|
||||
required: false,
|
||||
@@ -58,6 +63,7 @@ export default defineComponent({
|
||||
return {
|
||||
showingtooltip,
|
||||
t,
|
||||
tools,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<template>
|
||||
<div v-if="value !== null" class="text-h5 bordo_stondato_stretto full-width">
|
||||
<div v-if="value !== null" :class="`text-h5 bordo_stondato_stretto full-width`"
|
||||
:style="(!$q.screen.lt.sm ? `min-width: 250px; ` : ``) + (color_border ? `border-color: ` + color_border + `!important;`: '')">
|
||||
<div class="text-center text-h7-dense text-italic text-grey-14">
|
||||
{{ label }}
|
||||
</div>
|
||||
@@ -27,7 +28,7 @@
|
||||
<q-icon v-else name="fas fa-coins" size="sm"/>
|
||||
</template>
|
||||
<template v-slot:control>
|
||||
<div class="align_elem_right">{{ value.toFixed(2) }}
|
||||
<div class="align_elem_right">{{ tools.roundDec2(value) }}
|
||||
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{tips}}</q-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -48,14 +48,14 @@
|
||||
</div>
|
||||
<div v-else-if="mycol.name === 'symbol'">
|
||||
|
||||
<div class="text-bacheca">
|
||||
<div class="text-bacheca text-white">
|
||||
Simbolo:
|
||||
{{ tools.getValue(myrec, mycol.field, mycol.subfield) }}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div v-else-if="mycol.name === 'longdescr'">
|
||||
<div class="text-bacheca">
|
||||
<div class="text-bacheca text-black">
|
||||
{{ tools.getValue(myrec, mycol.field, mycol.subfield) }}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
</div>
|
||||
<div class="col-6" style="text-align: right">
|
||||
<span v-if="myTotalPrice" class="text-grey q-mr-xs">Totale:</span> <span
|
||||
class="text-subtitle1 q-mr-sm ">€ {{ myTotalPrice.toFixed(2) }}</span>
|
||||
class="text-subtitle1 q-mr-sm ">€ {{ myTotalPrice ? myTotalPrice.toFixed(2) : 0 }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<q-separator></q-separator>
|
||||
|
||||
@@ -52,22 +52,8 @@ export default defineComponent({
|
||||
const filtroutente = ref(<any[]>[])
|
||||
|
||||
const listcircuitsfiltered = computed(() => {
|
||||
let arr: any[] = []
|
||||
try {
|
||||
if (props.modelValue === costanti.CIRCUITS) {
|
||||
arr = circuitStore.listcircuits
|
||||
} else if (props.modelValue === costanti.MY_CIRCUITS ) {
|
||||
arr = circuitStore.listcircuits.filter((circ: any) => userStore.my.profile.mycircuits.findIndex((rec: any) => circ.name === rec.circuitname) >= 0)
|
||||
} else if (props.modelValue === costanti.MANAGE_CIRCUITS) {
|
||||
// arr = userStore.my.profile.manage_mycircuits
|
||||
} else if (props.modelValue === costanti.ASK_SENT_CIRCUIT) {
|
||||
arr = userStore.my.profile.asked_circuits
|
||||
}
|
||||
} catch (e) {
|
||||
arr = []
|
||||
}
|
||||
|
||||
return arr
|
||||
console.log('list modif')
|
||||
return updateListCircuit()
|
||||
})
|
||||
|
||||
const myoptions = computed(() => {
|
||||
@@ -105,10 +91,29 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
function updateListCircuit() {
|
||||
let arr: any[] = []
|
||||
try {
|
||||
if (props.modelValue === costanti.CIRCUITS) {
|
||||
arr = circuitStore.listcircuits
|
||||
} else if (props.modelValue === costanti.MY_CIRCUITS ) {
|
||||
arr = circuitStore.listcircuits.filter((circ: any) => userStore.my.profile.mycircuits.findIndex((rec: any) => circ.name === rec.circuitname) >= 0)
|
||||
} else if (props.modelValue === costanti.MANAGE_CIRCUITS) {
|
||||
// arr = userStore.my.profile.manage_mycircuits
|
||||
} else if (props.modelValue === costanti.ASK_SENT_CIRCUIT) {
|
||||
arr = userStore.my.profile.asked_circuits
|
||||
}
|
||||
} catch (e) {
|
||||
arr = []
|
||||
}
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
|
||||
function mounted() {
|
||||
username.value = userStore.my.username
|
||||
loadCircuits()
|
||||
|
||||
}
|
||||
|
||||
function updateValue(val: number) {
|
||||
@@ -126,6 +131,7 @@ export default defineComponent({
|
||||
updateValue,
|
||||
myoptions,
|
||||
userStore,
|
||||
circuitStore,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -20,6 +20,12 @@
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div v-else>
|
||||
<!--
|
||||
mycircuits: {{userStore.my.profile.mycircuits}}<br><br>
|
||||
listcircuitsfiltered: {{listcircuitsfiltered}}
|
||||
|
||||
<q-btn label="test" @click="userStore.my.profile.mycircuits = [...userStore.my.profile.mycircuits, {circuitname: 'prova'}]; circuitStore.listcircuits = [...circuitStore.listcircuits, {name: 'prova', path: 'prova'}]"></q-btn>
|
||||
-->
|
||||
<q-list>
|
||||
<span v-for="(circuit, index) in listcircuitsfiltered" :key="index" class="q-my-sm" clickable>
|
||||
<CMyCircuit
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<div v-if="col.fieldtype === costanti.FieldType.boolean">
|
||||
<div v-if="isInModif">
|
||||
<q-toggle
|
||||
:disable="!isInModif"
|
||||
:disable="!isInModif || col.disable"
|
||||
dark color="green" v-model="myvalue" :label="col.title ? col.title : col.label"
|
||||
@update:model-value="changevalRec"></q-toggle>
|
||||
</div>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
|
||||
<div class="row q-mb-sm no-wrap items-center centeritems">
|
||||
<div class="text-price no-wrap">
|
||||
<span v-if="!!myproduct.price">€ {{ myproduct.price.toFixed(2) }}</span>
|
||||
<span v-if="!!myproduct.price">€ {{ myproduct.price ? myproduct.price.toFixed(2) : 0 }}</span>
|
||||
<span v-if="!!myproduct.after_price">{{ myproduct.after_price }}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
|
||||
<CCurrencyValue
|
||||
:symbol="symbol"
|
||||
:tips="t('account.saldo_tips')"
|
||||
:tips="t('account.saldo_tips', {fido: qtarem, symbol})"
|
||||
:color="color"
|
||||
:value="saldo"
|
||||
:label="t('account.saldo') + ` (max ` + qtarem + `)`">
|
||||
:label="t('account.saldo') + ` (` + t('account.dispon') + `: ` + qtarem + `)`">
|
||||
|
||||
</CCurrencyValue>
|
||||
</template>
|
||||
|
||||
@@ -107,6 +107,9 @@ export default defineComponent({
|
||||
bothcircuits.value = userStore.IsMyCircuitByUser(props.to_user)
|
||||
|
||||
circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0])
|
||||
if (!userStore.IsMyCircuitByName(circuitsel.value)) {
|
||||
circuitsel.value = bothcircuits.value[0]
|
||||
}
|
||||
|
||||
aggiorna()
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
</q-select>
|
||||
|
||||
<CSaldo
|
||||
v-if="circuitloaded"
|
||||
:symbol="circuitloaded.symbol"
|
||||
:color="circuitloaded.color"
|
||||
:saldo="accountloaded ? accountloaded.saldo : 0"
|
||||
@@ -32,7 +33,7 @@
|
||||
>
|
||||
</CMyUser>
|
||||
|
||||
<div>
|
||||
<div v-if="circuitloaded">
|
||||
<q-input
|
||||
mask="#.##"
|
||||
reverse-fill-mask
|
||||
@@ -40,7 +41,7 @@
|
||||
class="q-py-sm text-h5"
|
||||
outlined v-model="qty" type="text"
|
||||
:rules="[ val => val <= circuitStore.getRemainingCoinsToSend(accountloaded) || t('circuit.qta_remaining_to_send', { maxqta: circuitStore.getRemainingCoinsToSend(accountloaded), symbol: circuitloaded.symbol })]"
|
||||
:label="t('movement.amount_to_send', {qtamax: circuitStore.getRemainingCoinsToSend(accountloaded).toFixed(2) + ` ` + circuitloaded.symbol})"
|
||||
:label="t('movement.amount_to_send', {qtamax: circuitStore.getRemainingCoinsToSend(accountloaded) ? circuitStore.getRemainingCoinsToSend(accountloaded).toFixed(2) : 0 + ` ` + circuitloaded.symbol})"
|
||||
>
|
||||
<!--val => val > circuitStore.getMaxCoinsToSend(accountloaded) || t('circuit.qta_max_to_send', { maxqta: tools.getRemainingCoinsToSend(accountloaded), symbol: circuitloaded.symbol })]" -->
|
||||
<template v-slot:append>
|
||||
@@ -66,7 +67,7 @@
|
||||
switch-marker-labels-side
|
||||
:inner-max="remainingCoins"
|
||||
:min="0"
|
||||
:max="Number(maxsendable.toFixed(2))"
|
||||
:max="Number(maxsendable ? maxsendable.toFixed(2) : 0)"
|
||||
/>
|
||||
</div>
|
||||
|
||||
@@ -76,6 +77,7 @@
|
||||
</q-card-section>
|
||||
<q-card-actions align="center">
|
||||
<q-btn
|
||||
v-if="circuitloaded"
|
||||
:disable="qtyRef ? qtyRef.hasError : false"
|
||||
:label="$t('circuit.sendcoinsto', {qty, coin: circuitsel, dest: to_user.username })" color="positive"
|
||||
@click="sendCoin()"></q-btn>
|
||||
|
||||
@@ -29,7 +29,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-2 no-wrap text-subtitle3 q-mr-sm">
|
||||
€ {{ (order.price * order.quantity).toFixed(2) }}
|
||||
€ {{ (order.price * order.quantity) ? (order.price * order.quantity).toFixed(2) : 0 }}
|
||||
</div>
|
||||
<div class="col-1">
|
||||
<q-btn v-if="!nomodif" icon="fas fa-times" color="negative" round size="xs" @click="removeFromCard">
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
import { func } from '@store/Modules/fieldsTable'
|
||||
|
||||
const functionality: IFunctionality = {
|
||||
PWA: false,
|
||||
PWA: !(process.env.DEV),
|
||||
SHOW_USER_MENU: true, // Cambiare con true
|
||||
SHOW_PROFILE: true,
|
||||
SHOW_REG_BUTTON: false,
|
||||
|
||||
@@ -919,9 +919,9 @@ export interface ICircuit {
|
||||
longdescr: string
|
||||
systemUserDescr: string
|
||||
systemUserId: string
|
||||
totCircolante?: number
|
||||
totTransato?: number
|
||||
nome_valuta: string
|
||||
totCircolante: number
|
||||
totTransato: number
|
||||
// nome_valuta: string
|
||||
symbol: string
|
||||
color: string
|
||||
abbrev: string
|
||||
|
||||
@@ -812,6 +812,7 @@ const msg_it = {
|
||||
events_new: 'Nuovo Evento',
|
||||
friends_new: 'Nuova Richiesta di Amicizia',
|
||||
groups_new: 'Si creano Nuovi Gruppi',
|
||||
circuits_new: 'Si creano Nuovi Circuiti',
|
||||
},
|
||||
event: {
|
||||
_id: 'id',
|
||||
@@ -1103,7 +1104,10 @@ const msg_it = {
|
||||
systemUserId: 'ID Utente di Sistema',
|
||||
founder: 'Fondatore',
|
||||
totCircolante: 'Totale Circolante',
|
||||
totCircolante_tips: 'Rappresenta la somma di tutti i conti che hanno un saldo a Credito (cioè positivo)',
|
||||
totTransato: 'Totale Transato',
|
||||
totTransato_tips: 'Ammontare di tutti gli importi movimentati nelle transazioni',
|
||||
stats: 'Statistiche',
|
||||
nome_valuta: 'Nome Valuta',
|
||||
symbol: 'Simbolo',
|
||||
color: 'Colore',
|
||||
@@ -1174,7 +1178,8 @@ const msg_it = {
|
||||
qta_maxConcessa: 'Capacità massima accumulabile',
|
||||
importo_iniziale: 'Importo Iniziale',
|
||||
saldo: 'Saldo',
|
||||
saldo_tips: 'Rappresenta quanta moneta ho accumulato. Ma posso andare anche sotto ',
|
||||
dispon: 'Disponibile',
|
||||
saldo_tips: 'Rappresenta quanta moneta ho accumulato. Ma posso andare anche sotto fino a {fido} {symbol}',
|
||||
user: 'Utente',
|
||||
},
|
||||
|
||||
|
||||
@@ -2429,7 +2429,9 @@ export const colTableCircuitComplete = [
|
||||
AddCol({ name: 'regulation', label_trans: 'circuit.regulation', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'systemUserDescr', label_trans: 'circuit.systemUserDescr' }),
|
||||
AddCol({ name: 'systemUserId', label_trans: 'circuit.systemUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'createdBy', label_trans: 'circuit.founder', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'createdBy', label_trans: 'circuit.founder', fieldtype: costanti.FieldType.select, jointable: 'users',
|
||||
showWhen: costanti.showWhen.InPage + costanti.showWhen.InView,
|
||||
}),
|
||||
AddCol({ name: 'totCircolante', label_trans: 'circuit.totCircolante', fieldtype: costanti.FieldType.number }),
|
||||
AddCol({ name: 'totTransato', label_trans: 'circuit.totTransato', fieldtype: costanti.FieldType.number }),
|
||||
// AddCol({ name: 'nome_valuta', label_trans: 'circuit.nome_valuta' }),
|
||||
@@ -2497,8 +2499,12 @@ export const colTableCircuit = [
|
||||
}),
|
||||
AddCol({ name: 'subname', label_trans: 'circuit.subname' }),
|
||||
AddCol({ name: 'longdescr', label_trans: 'circuit.descr', fieldtype: costanti.FieldType.html }),
|
||||
AddCol({ name: 'systemUserId', label_trans: 'circuit.systemUserId', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'createdBy', label_trans: 'circuit.founder', fieldtype: costanti.FieldType.select, jointable: 'users', }),
|
||||
AddCol({ name: 'systemUserId', label_trans: 'circuit.systemUserId', fieldtype: costanti.FieldType.select, jointable: 'users',
|
||||
showWhen: costanti.showWhen.InEdit + costanti.showWhen.InView,
|
||||
}),
|
||||
AddCol({ name: 'createdBy', label_trans: 'circuit.founder', fieldtype: costanti.FieldType.select, jointable: 'users',
|
||||
showWhen: costanti.showWhen.InPage + costanti.showWhen.InView,
|
||||
}),
|
||||
AddCol({
|
||||
name: 'date_created', label_trans: 'reg.pub_created', fieldtype: costanti.FieldType.onlydate,
|
||||
required: false,
|
||||
@@ -2520,8 +2526,16 @@ export const colTableCircuit = [
|
||||
fieldtype: costanti.FieldType.currency, required: true, visulabel: true }),
|
||||
AddCol({ name: 'qta_max_default', label_trans: 'circuit.qta_max_default',
|
||||
fieldtype: costanti.FieldType.currency, required: true, visulabel: true }),
|
||||
AddCol({ name: 'totCircolante', label_trans: 'circuit.totCircolante',
|
||||
fieldtype: costanti.FieldType.currency, visulabel: true,
|
||||
showWhen: costanti.showWhen.InPage + costanti.showWhen.InView,
|
||||
}),
|
||||
AddCol({ name: 'totTransato', label_trans: 'circuit.totTransato',
|
||||
fieldtype: costanti.FieldType.currency, visulabel: true,
|
||||
showWhen: costanti.showWhen.InPage + costanti.showWhen.InView,
|
||||
}),
|
||||
AddCol({ name: 'regulation', label_trans: 'circuit.regulation', fieldtype: costanti.FieldType.html, required: true }),
|
||||
// AddCol({ name: 'deperimento', label_trans: 'circuit.deperimento', fieldtype: costanti.FieldType.boolean }),
|
||||
AddCol({ name: 'deperimento', label_trans: 'circuit.deperimento', fieldtype: costanti.FieldType.boolean, disable: true }),
|
||||
AddCol({ name: 'data_costituz', label_trans: 'circuit.data_costituz', fieldtype: costanti.FieldType.date }),
|
||||
AddCol({
|
||||
name: 'photos',
|
||||
|
||||
@@ -4738,6 +4738,20 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
updateMyData(res: any) {
|
||||
const userStore = useUserStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
|
||||
// console.log('OUT', res)
|
||||
|
||||
if (res && res.user) {
|
||||
userStore.my = res.user
|
||||
|
||||
if (res.listcircuits) {
|
||||
circuitStore.listcircuits = res.listcircuits
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
addToMyCircuits($q: any, username: string, circuitname: string) {
|
||||
|
||||
@@ -4752,12 +4766,15 @@ export const tools = {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.SET, true)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
if (res && res.result) {
|
||||
this.updateMyData(res)
|
||||
notifStore.updateNotification = true
|
||||
if (res.circuit) {
|
||||
if (userStore.my.profile.mycircuits)
|
||||
userStore.my.profile.mycircuits = [...userStore.my.profile.mycircuits, res]
|
||||
userStore.my.profile.mycircuits = [...userStore.my.profile.mycircuits, res.circuit]
|
||||
else
|
||||
userStore.my.profile.mycircuits = [res]
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.addedcircuit', { circuitname }))
|
||||
}
|
||||
})
|
||||
@@ -4797,10 +4814,8 @@ export const tools = {
|
||||
userStore.setCircuitCmd($q, t, username, notif.extrarec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_ACCEPT, 0, notif.extrarec)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
this.updateMyData(res)
|
||||
if (res.cansend) {
|
||||
if (res.user) {
|
||||
userStore.my = res.user
|
||||
}
|
||||
console.log('useraccounts', userStore.my.profile.useraccounts)
|
||||
tools.showPositiveNotif($q, t('circuit.coins_accepted'))
|
||||
} else {
|
||||
@@ -4816,7 +4831,8 @@ export const tools = {
|
||||
notif.extrarec.notifId = notif._id
|
||||
userStore.setCircuitCmd($q, t, username, notif.extrarec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_REFUSE, 0, notif.extrarec)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
if (res && res.result) {
|
||||
this.updateMyData(res)
|
||||
tools.showPositiveNotif($q, t('circuit.coins_refused'))
|
||||
}
|
||||
})
|
||||
@@ -5259,7 +5275,7 @@ export const tools = {
|
||||
if (res) {
|
||||
if (value) {
|
||||
// ADD to req
|
||||
userStore.my.profile.asked_circuits.push(res)
|
||||
userStore.my.profile.asked_circuits.push(res.circuit)
|
||||
tools.showPositiveNotif($q, t('circuit.askedto', { circuitname }))
|
||||
} else {
|
||||
// REMOVE to req
|
||||
@@ -5267,6 +5283,7 @@ export const tools = {
|
||||
tools.showPositiveNotif($q, t('circuit.revoketo', { circuitname }))
|
||||
}
|
||||
|
||||
this.updateMyData(res)
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.recfailed'))
|
||||
}
|
||||
@@ -5302,13 +5319,11 @@ export const tools = {
|
||||
if (res.useraccounts && res.useraccounts.length > 0) {
|
||||
userStore.my.profile.useraccounts = res.useraccounts
|
||||
}
|
||||
if (res.user) {
|
||||
userStore.my = res.user
|
||||
}
|
||||
tools.showPositiveNotif($q, t('circuit.coins_sendrequest_sent'))
|
||||
} else {
|
||||
tools.showNegativeNotif($q, res.errormsg)
|
||||
}
|
||||
this.updateMyData(res)
|
||||
})
|
||||
})
|
||||
|
||||
@@ -5327,11 +5342,12 @@ export const tools = {
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.CANCEL_REQ, null).then((res) => {
|
||||
if (res) {
|
||||
if (res && res.result) {
|
||||
if (username === userStore.my.username) {
|
||||
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('db.cancel_req_group'))
|
||||
this.updateMyData(res)
|
||||
tools.showPositiveNotif($q, t('circuit.cancel_req'))
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -5349,12 +5365,13 @@ export const tools = {
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REFUSE_REQ, null).then((res) => {
|
||||
if (res) {
|
||||
if (res && res.result) {
|
||||
notifStore.updateNotification = true
|
||||
if (username === userStore.my.username) {
|
||||
userStore.my.profile.asked_circuits = userStore.my.profile.asked_circuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('circuit.refusedcircuit', { username }))
|
||||
this.updateMyData(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -5371,11 +5388,12 @@ export const tools = {
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REMOVE_FROM_MYLIST, null).then((res) => {
|
||||
if (res) {
|
||||
if (res && res.result) {
|
||||
if (userStore.my.profile.mycircuits && username === userStore.my.username) {
|
||||
userStore.my.profile.mycircuits = userStore.my.profile.mycircuits.filter((rec: IMyCircuit) => rec.circuitname !== circuitname)
|
||||
}
|
||||
tools.showPositiveNotif($q, t('circuit.removed'))
|
||||
this.updateMyData(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -5392,7 +5410,7 @@ export const tools = {
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.ADDADMIN, null).then((res) => {
|
||||
if (res) {
|
||||
if (res && res.result) {
|
||||
const mycircuit = userStore.my.profile.manage_mycircuits.find((rec: ICircuit) => rec.name === circuitname)
|
||||
console.log('mycircuit', mycircuit)
|
||||
if (mycircuit && mycircuit.admins) {
|
||||
@@ -5400,6 +5418,7 @@ export const tools = {
|
||||
console.log('mycircuit.admins', mycircuit.admins)
|
||||
tools.showPositiveNotif($q, t('db.addedtoadmin', { username }))
|
||||
}
|
||||
this.updateMyData(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -5416,7 +5435,7 @@ export const tools = {
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.REMOVEADMIN, null).then((res) => {
|
||||
if (res) {
|
||||
if (res && res.result) {
|
||||
const mygrp = userStore.my.profile.manage_mycircuits.find((rec: ICircuit) => rec.name === circuitname)
|
||||
console.log('mygrp', mygrp)
|
||||
if (mygrp && mygrp.admins) {
|
||||
@@ -5424,6 +5443,7 @@ export const tools = {
|
||||
console.log('mygrp.admins', mygrp.admins)
|
||||
tools.showPositiveNotif($q, t('db.removedtoadmin', { username }))
|
||||
}
|
||||
this.updateMyData(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -5440,11 +5460,12 @@ export const tools = {
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, circuitname, shared_consts.CIRCUITCMD.DELETE, null).then((res) => {
|
||||
if (res) {
|
||||
if (res && res.result) {
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
userStore.my.profile.manage_mycircuits = userStore.my.profile.manage_mycircuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
tools.showPositiveNotif($q, t('circuit.deleted', { circuitname }))
|
||||
}
|
||||
this.updateMyData(res)
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -5862,11 +5883,17 @@ export const tools = {
|
||||
},
|
||||
getdefaultnewrec_Circuit(): any {
|
||||
return {
|
||||
_id: 0,
|
||||
name: '',
|
||||
subname: '',
|
||||
img_logo: '',
|
||||
photos: [],
|
||||
admins: [],
|
||||
color: '#ff5500',
|
||||
deperimento: false,
|
||||
symbol: 'RIS',
|
||||
fido_scoperto_default: 100,
|
||||
qta_max_default: 500,
|
||||
totTransato: 0,
|
||||
totCircolante: 0,
|
||||
}
|
||||
},
|
||||
|
||||
@@ -6333,7 +6360,7 @@ export const tools = {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
@@ -6345,10 +6372,7 @@ export const tools = {
|
||||
}
|
||||
},
|
||||
roundDec2(mynum: number): number {
|
||||
return (Math.round(mynum * 100)/100);
|
||||
},
|
||||
roundDec2Str(mynum: number): string {
|
||||
return (Math.round(mynum * 100)/100).toFixed(2);
|
||||
return (Math.round(mynum * 100) / 100)
|
||||
},
|
||||
// getLocale() {
|
||||
// if (navigator.languages && navigator.languages.length > 0) {
|
||||
|
||||
@@ -949,7 +949,14 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return Api.SendReq('/settable', 'POST', mydata)
|
||||
.then((res) => {
|
||||
this.serverError = false
|
||||
return res.data
|
||||
if (res && res.data) {
|
||||
tools.updateMyData(res.data.ris)
|
||||
if (res.data.rec) {
|
||||
return res.data.rec
|
||||
} else {
|
||||
res.data
|
||||
}
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
this.serverError = true
|
||||
|
||||
@@ -17,13 +17,23 @@
|
||||
padding: 5px;
|
||||
}
|
||||
|
||||
.members, .admins, .creator, .element{
|
||||
.container{
|
||||
vertical-align: center;
|
||||
padding: 5px;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
.element{
|
||||
font-weight: bold;
|
||||
vertical-align: center;
|
||||
padding: 5px;
|
||||
font-size: 1.15rem;
|
||||
}
|
||||
|
||||
|
||||
.title_param{
|
||||
font-size: 1.25rem;
|
||||
}
|
||||
.iconcirc {
|
||||
margin-right: 4px;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<CNotifAtTop />
|
||||
<CNotifAtTop/>
|
||||
<div class="q-gutter-sm q-pa-sm q-pb-md">
|
||||
<div v-if="!circuit && !loading">
|
||||
<div v-if="mystatus === 403">
|
||||
@@ -143,8 +143,8 @@
|
||||
<q-separator/>
|
||||
|
||||
<q-card-section>
|
||||
<div v-if="circuit.createdBy" class="element">
|
||||
<q-icon name="fas fa-lightbulb"></q-icon>
|
||||
<div v-if="circuit.createdBy" class="container">
|
||||
<q-icon name="fas fa-lightbulb" class="iconcirc"></q-icon>
|
||||
{{
|
||||
$t('shared.createdby', {
|
||||
username: circuit.createdBy,
|
||||
@@ -152,22 +152,22 @@
|
||||
})
|
||||
}}
|
||||
</div>
|
||||
<div v-if="!!circuit.date_updated && tools.getstrDate(circuit.date_updated) !== tools.getstrDate(circuit.date_created)" class="element">
|
||||
<q-icon name="fas fa-pencil-alt"></q-icon>
|
||||
{{
|
||||
<div v-if="!!circuit.date_updated && tools.getstrDate(circuit.date_updated) !== tools.getstrDate(circuit.date_created)" class="container">
|
||||
<q-icon name="fas fa-pencil-alt" class="iconcirc"></q-icon>
|
||||
<span class="element">{{
|
||||
$t('shared.lastmodify', {
|
||||
date: tools.getstrDateYY(circuit.date_updated),
|
||||
})
|
||||
}}
|
||||
}}</span>
|
||||
</div>
|
||||
|
||||
<div class="members">
|
||||
<q-icon name="fas fa-users"></q-icon>
|
||||
{{ numUsers() }} {{ numUsers() === 1 ? t('shared.member') : t('shared.members') }}
|
||||
<div class="container">
|
||||
<q-icon name="fas fa-users" class="iconcirc"></q-icon>
|
||||
<span class="element">{{ numUsers() }}</span> {{ numUsers() === 1 ? t('shared.member') : t('shared.members') }}
|
||||
</div>
|
||||
<div class="admins">
|
||||
<q-icon name="fas fa-user-cog"></q-icon>
|
||||
{{ numAdmins() }} {{ numAdmins() === 1 ? t('shared.admin') : t('shared.admins') }}
|
||||
<div class="container">
|
||||
<q-icon name="fas fa-user-cog" class="iconcirc"></q-icon>
|
||||
<span class="element">{{ numAdmins() }}</span> {{ numAdmins() === 1 ? t('shared.admin') : t('shared.admins') }}
|
||||
</div>
|
||||
<div v-for="(user, index) of circuit.admins" :key="index">
|
||||
<CMyUser
|
||||
@@ -178,17 +178,19 @@
|
||||
</CMyUser>
|
||||
</div>
|
||||
<div class="sezioni">
|
||||
<q-icon name="fas fa-coins"></q-icon>
|
||||
<q-icon name="fas fa-coins" class="iconcirc"></q-icon>
|
||||
{{ t('circuit.symbol') }}:
|
||||
<span class="text-h5">
|
||||
<em class="q-px-sm text-white rounded-borders"
|
||||
<em class="q-px-sm text-black rounded-borders"
|
||||
:style="`background-color: ` + tools.getColorByCircuit(circuit)">{{ tools.getSymbolByCircuit(circuit) }}</em>
|
||||
</span>
|
||||
</div>
|
||||
<div :class="$q.screen.lt.sm ? '' : 'row'">
|
||||
<div v-if="circuit.fido_scoperto_default" class="sezioni">
|
||||
<CCurrencyValue
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="red"
|
||||
:value="circuit.fido_scoperto_default"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.fido_scoperto_default')"
|
||||
@@ -200,6 +202,7 @@
|
||||
<CCurrencyValue
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="green"
|
||||
:value="circuit.qta_max_default"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.qta_max_default')"
|
||||
@@ -207,13 +210,41 @@
|
||||
>
|
||||
</CCurrencyValue>
|
||||
</div>
|
||||
</div>
|
||||
<div :class="$q.screen.lt.sm ? '' : 'row'">
|
||||
{{ t('circuit.stats') }}:<br>
|
||||
<div v-if="circuit.totTransato" class="sezioni">
|
||||
<CCurrencyValue
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="blue"
|
||||
:value="circuit.totTransato"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.totTransato')"
|
||||
:tips="t('circuit.totTransato_tips')"
|
||||
>
|
||||
</CCurrencyValue>
|
||||
</div>
|
||||
<div v-if="circuit.totCircolante" class="sezioni">
|
||||
<CCurrencyValue
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
color_border="blue"
|
||||
:value="circuit.totCircolante"
|
||||
icon="fas fa-battery-quarter"
|
||||
:label="t('circuit.totCircolante')"
|
||||
:tips="t('circuit.totCircolante_tips')"
|
||||
>
|
||||
</CCurrencyValue>
|
||||
</div>
|
||||
</div>
|
||||
<div class="sezioni" v-if="circuit.deperimento !== undefined">
|
||||
<q-icon name="fas fa-battery-full"></q-icon>
|
||||
<q-icon name="fas fa-battery-full" class="iconcirc"></q-icon>
|
||||
{{ t('circuit.deperimento') }}: <span class="text-section">{{ circuit.deperimento ? t('dialog.yes') : t('dialog.no') }} {{ }}</span>
|
||||
</div>
|
||||
|
||||
<div class="sezioni">
|
||||
<q-icon name="fas fa-file-signature"></q-icon>
|
||||
<q-icon name="fas fa-file-signature" class="iconcirc"></q-icon>
|
||||
{{ t('circuit.regulation') }}: <br>
|
||||
<div class="bordo_quadrato" v-html="circuit.regulation"></div>
|
||||
</div>
|
||||
|
||||
@@ -11565,7 +11565,7 @@ snapdragon@^0.8.1:
|
||||
use "^3.1.0"
|
||||
|
||||
sockjs@^0.3.21:
|
||||
version "0.3.24"
|
||||
version "1.0.1"
|
||||
resolved "https://registry.yarnpkg.com/sockjs/-/sockjs-0.3.24.tgz#c9bc8995f33a111bea0395ec30aa3206bdb5ccce"
|
||||
integrity sha512-GJgLTZ7vYb/JtPSSZ10hsOYIvEYsjbNU+zPdIHcUaWVNUEPivzxku31865sSSud0Da0W4lEeOPlmw93zLQchuQ==
|
||||
dependencies:
|
||||
|
||||
Reference in New Issue
Block a user