Conto Comunitario all'interno di un Circuito

This commit is contained in:
Surya Paolo
2023-01-21 19:02:26 +01:00
parent 42d68eb4b8
commit 98c0218ef7
18 changed files with 117 additions and 42 deletions

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.58"
APP_VERSION="0.5.59"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.58"
APP_VERSION="0.5.59"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -212,27 +212,16 @@ const msg_website_it = {
+ '<li>👥 Aiutando a creare Gruppi Territoriali nella vostra città, impegnandosi a realizzare progetti per il Bene Comune, in onore ai principi Amorevoli e di condivisione.</li>'
+ '<li>🌱 Sostenendo le persone attorno a voi, e rispettando la nostra vera Casa: Madre Natura e Tutti gli Esseri Viventi. ❤️</li>'
+ '<li>👨🏻‍💻 Con una <strong>piccola donazione</strong> per le spese dei Server, manutenzione e per i continui sviluppi e miglioramenti</li></ul>' +
'1) Tramite <strong>Paypal</strong>:<br>' +
'<div style="font-size: 1.5rem; background-color: white; color: blue; border: solid 2px #f00; margin: 10px; padding: 10px; border-radius: 10px; " ' +
'class="row justify-around">' +
'<span><a href="https://paypal.me/paoloarena/1" target="_blank">1€</a></span>' +
'<span><a href="https://paypal.me/paoloarena/2" target="_blank">2€</a></span>' +
'<span><a href="https://paypal.me/paoloarena/5" target="_blank">5€</a></span>' +
'<span><a href="https://paypal.me/paoloarena/10" target="_blank">10€</a></span>' +
'<span><a href="https://paypal.me/paoloarena" target="_blank">scegli</a></span>' +
'</div><em>clicca sull\'importo per fare una <strong>donazione</strong> </em><br>' +
'1) Tramite <strong><a href="https://paypal.me/paoloarena" target="_blank">Paypal</a></strong>:<br>' +
'<br>2) Tramite <strong>Satispay</strong>: <a href="https://www.satispay.com/app/match/link/money-box/S6Y-SVN--62712D42-35B0-4BB9-8511-410C2AB8CD45" target="_blank">Clicca qui</a><br>' +
'<div style="font-size: 1rem; background-color: white; color: blue; border: solid 2px #f00; margin: 5px; padding: 5px; border-radius: 10px; " ' +
'class="row justify-around">' +
'Se ancora non hai Satispay <a href="https://www.satispay.com/promo/PAOLOARENA4">Richiedila cliccando qui</a></br>' +
'E\' consigliata se hai un conto bancario come alternativa alla costosa carta di credito/debito</br>' +
'👉🏻 <strong>Registrandoti entrambi riceviamo un Bonus di 5 €</strong></br>' +
'</div>' +
'<br>3) Tramite <strong>Bonifico Bancario</strong>:<br>' +
'(Scrivi a Surya (<a href="mailto:surya@riso.app">surya@riso.app</a>) per ricevere le coordinate</br>' +
'(Scrivi a Surya (<a href="https://t.me/surya1977">@surya1977</a>) per le coordinate</br>' +
'' +
'4) In alternativa scegli tu una forma di scambio da donare a Paolo (per scrivergli su Telegram: <a href="https://t.me/surya1977" target="_blank">Surya Paolo</a>)<br />' +
'<span style="color: red; font-size: 2rem;">❤</span> Sono graditi messaggi sia di suggerimenti che di apprezzamenti.<br>' +
'4) In alternativa scegli tu una forma di Dono <br />' +
'Grazie Mille per l\'Aiuto ed il Supporto' +
'<br>',
},

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.58"
APP_VERSION="0.5.59"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.58"
APP_VERSION="0.5.59"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="13"
DIRECTORY_LOCAL=newfreeplanet

View File

@@ -1,4 +1,4 @@
APP_VERSION="0.5.58"
APP_VERSION="0.5.59"
SERVICE_WORKER_FILE="service-worker.js"
APP_ID="14"
DIRECTORY_LOCAL="newfreeplanet"

View File

@@ -1013,6 +1013,21 @@ export const shared_consts = {
STATUS_GROUPS_REMOVED: 7,
},
CircuitsNotif: {
STATUS_NONE: 0,
STATUS_NEW: 51,
STATUS_ACCEPTED: 53,
STATUS_REFUSED: 54,
STATUS_BLOCKED: 55,
STATUS_DELETED: 56,
STATUS_REMOVED: 57,
STATUS_SENDCOINSREQ: 58,
STATUS_COINS_ACCEPTED: 60,
STATUS_COINS_REFUSED: 61,
STATUS_COINS_ACCEPTED_SENT: 62,
STATUS_COINS_REFUSED_SENT: 63,
},
QualiNotifs: {
CIRCUITS: 1,
OTHERS: 2,

View File

@@ -1,4 +1,5 @@
<template>
<div class="row justify-evenly items-center q-pa-sm q-ma-sm">
<div class="q-ma-sx">
<q-btn
@@ -42,7 +43,7 @@
<q-btn
v-if="
userStore.getMyCircuitsInCommonByUser(myuser).length > 0 &&
((contact.username !== userStore.my.username) || userStore.hoContiComunitariDaAmministrare())
((myuser.username !== userStore.my.username) || userStore.hoContiComunitariDaAmministrare())
"
icon="fas fa-coins"
color="green"

View File

@@ -29,7 +29,7 @@
<div v-html="getNotifText($t, notif, false)"></div>
</q-item-label>
<q-item-label caption lines="18"
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ"
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === shared_consts.CircuitsNotif.STATUS_NONE && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ"
>
<div class="row no-wrap justify-evenly q-pa-sm">
<q-btn

View File

@@ -426,7 +426,7 @@
tools.errorMsg('username', v$.username) ||
(isalreadyReg ? 'L\'Username è gia stato registrato!' : '')
"
:label="$t('reg.username_reg_collettivo')"
:label="collettivo ? $t('reg.username_reg_collettivo') : $t('reg.username_reg')"
>
<template v-slot:prepend>
<q-icon name="person" />

View File

@@ -188,27 +188,16 @@ const msg_website_it = {
+ '<li>👥 Aiutando a creare Gruppi Territoriali nella vostra città, impegnandosi a realizzare progetti per il Bene Comune, in onore ai principi Amorevoli e di condivisione.</li>'
+ '<li>🌱 Sostenendo le persone attorno a voi, e rispettando la nostra vera Casa: Madre Natura e Tutti gli Esseri Viventi. ❤️</li>'
+ '<li>👨🏻‍💻 Con una <strong>piccola donazione</strong> per le spese dei Server, manutenzione e per i continui sviluppi e miglioramenti</li></ul>' +
'1) Tramite <strong>Paypal</strong>:<br>' +
'<div style="font-size: 1.5rem; background-color: white; color: blue; border: solid 2px #f00; margin: 10px; padding: 10px; border-radius: 10px; " ' +
'class="row justify-around">' +
'<span><a href="https://paypal.me/paoloarena/1" target="_blank">1€</a></span>' +
'<span><a href="https://paypal.me/paoloarena/2" target="_blank">2€</a></span>' +
'<span><a href="https://paypal.me/paoloarena/5" target="_blank">5€</a></span>' +
'<span><a href="https://paypal.me/paoloarena/10" target="_blank">10€</a></span>' +
'<span><a href="https://paypal.me/paoloarena" target="_blank">scegli</a></span>' +
'</div><em>clicca sull\'importo per fare una <strong>donazione</strong> </em><br>' +
'1) Tramite <strong><a href="https://paypal.me/paoloarena" target="_blank">Paypal</a></strong>:<br>' +
'<br>2) Tramite <strong>Satispay</strong>: <a href="https://www.satispay.com/app/match/link/money-box/S6Y-SVN--62712D42-35B0-4BB9-8511-410C2AB8CD45" target="_blank">Clicca qui</a><br>' +
'<div style="font-size: 1rem; background-color: white; color: blue; border: solid 2px #f00; margin: 5px; padding: 5px; border-radius: 10px; " ' +
'class="row justify-around">' +
'Se ancora non hai Satispay <a href="https://www.satispay.com/promo/PAOLOARENA4">Richiedila cliccando qui</a></br>' +
'E\' consigliata se hai un conto bancario come alternativa alla costosa carta di credito/debito</br>' +
'👉🏻 <strong>Registrandoti entrambi riceviamo un Bonus di 5 €</strong></br>' +
'</div>' +
'<br>3) Tramite <strong>Bonifico Bancario</strong>:<br>' +
'(Scrivi a Surya (<a href="mailto:surya@riso.app">surya@riso.app</a>) per ricevere le coordinate</br>' +
'(Scrivi a Surya (<a href="https://t.me/surya1977">@surya1977</a>) per le coordinate</br>' +
'' +
'4) In alternativa scegli tu una forma di scambio da donare a Paolo (per scrivergli su Telegram: <a href="https://t.me/surya1977" target="_blank">Surya Paolo</a>)<br />' +
'<span style="color: red; font-size: 2rem;">❤</span> Sono graditi messaggi sia di suggerimenti che di apprezzamenti.<br>' +
'4) In alternativa scegli tu una forma di Dono <br />' +
'Grazie Mille per l\'Aiuto ed il Supporto' +
'<br>',
},

View File

@@ -104,7 +104,7 @@
<div v-html="getNotifText($t, notif, false)"></div>
</q-item-label>
<q-item-label caption lines="2"
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_REQUEST_TO_ENTER"
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === shared_consts.CircuitsNotif.STATUS_NONE && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_REQUEST_TO_ENTER"
v-ripple>
<div class="row no-wrap justify-evenly" v-if="tools.iAmAdminCircuit(notif.extrafield)">
@@ -127,7 +127,7 @@
</div>
</q-item-label>
<q-item-label caption lines="2"
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ"
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === shared_consts.CircuitsNotif.STATUS_NONE && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ"
v-ripple>
<div class="row no-wrap justify-evenly">
@@ -182,6 +182,7 @@
</q-item>
<q-separator/>
</q-list>
<br><br><br>
</div>
</div>
</q-drawer>

View File

@@ -1115,6 +1115,8 @@ export interface IMovement {
export interface IMovVisu {
transactionDate: Date
groupfrom: IMyGroup
groupto: IMyGroup
userfrom: IUserFields
userto: IUserFields
circuitfrom: ICircuit

View File

@@ -1051,7 +1051,7 @@ const msg_it = {
friends: 'Amici',
bacheca: 'Bacheca',
services: 'Servizi',
handshake: 'Raporti di fiducia',
handshake: 'Rapporti di Fiducia',
hosp: 'Ospitalità',
events: 'Eventi',
goods: 'Beni',
@@ -1139,6 +1139,7 @@ const msg_it = {
hidden_descr: 'il Gruppo non sarà visibile nella ricerca',
page: 'Pagina',
circuits: 'Circuiti',
groupname: '',
},
finder: {
search_skill: 'Cerca una specializzazione'
@@ -1289,7 +1290,9 @@ const msg_it = {
movement: {
transactionDate: 'Data Transazione',
accountFromId: 'Dal Conto',
accountFromComId: 'Dal Conto Com.',
accountToId: 'Al Conto',
accountToComId: 'Al Conto Com.',
amount_sent: 'Quantità inviate',
amount_to_send: 'Quantità da inviare',
amount: 'Quantità',

View File

@@ -620,6 +620,31 @@ export const colmyMovement = [
noshowlabel: true,
}),
AddCol({
name: 'groupfrom.groupname',
label_trans: 'groups.groupname',
field: 'groupfrom',
subfield: 'groupname',
foredit: false,
tipovisu: costanti.TipoVisu.LINK,
fieldtype: costanti.FieldType.username_chip,
link: '/my/groupfrom.groupname',
noshowlabel: true,
extrafield: 'movement.from',
}),
AddCol({
name: 'groupto.groupname',
label_trans: 'groups.groupname',
field: 'groupto',
subfield: 'groupname',
foredit: false,
tipovisu: costanti.TipoVisu.LINK,
fieldtype: costanti.FieldType.username_chip,
link: '/my/groupto.groupname',
extrafield: 'movement.to',
noshowlabel: true,
}),
AddCol({
name: 'amount', label_trans: 'movement.amount',
fieldtype: costanti.FieldType.currency, required: true, tipovisu: costanti.TipoVisu.TESTO_BORDATO
@@ -632,7 +657,9 @@ export const colmyMovementTable = [
// AddCol({ name: '_id', label_trans: 'reg.id' }),
AddCol({ name: 'transactionDate', label_trans: 'movement.transactionDate', fieldtype: costanti.FieldType.date }),
AddCol({ name: 'userfrom.username', field: 'userfrom', subfield: 'username', label_trans: 'movement.accountFromId', fieldtype: costanti.FieldType.string, required: true }),
AddCol({ name: 'groupfrom.groupname', field: 'groupfrom', subfield: 'groupname', label_trans: 'movement.accountFromComId', fieldtype: costanti.FieldType.string, required: true }),
AddCol({ name: 'userto.username', field: 'userto', subfield: 'username', label_trans: 'movement.accountToId', fieldtype: costanti.FieldType.string, required: true }),
AddCol({ name: 'groupto.groupname', field: 'groupto', subfield: 'groupname', label_trans: 'movement.accountToComId', fieldtype: costanti.FieldType.string, required: true }),
AddCol({
name: 'amount', label_trans: 'movement.amount',

View File

@@ -5653,7 +5653,11 @@ export const tools = {
acceptCoins($q: any, username: string, notif: any) {
const userStore = useUserStore()
const notifStore = useNotifStore()
notif.extrarec.notifId = notif._id
notif.extrarec.lastdr = notifStore.getLastDataRead(username)
userStore.setCircuitCmd($q, t, username, notif.extrarec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_ACCEPT, 0, notif.extrarec)
.then((res: any) => {
if (res) {
@@ -5671,7 +5675,10 @@ export const tools = {
refuseCoins($q: any, username: string, notif: any) {
const userStore = useUserStore()
const notifStore = useNotifStore()
notif.extrarec.notifId = notif._id
notif.extrarec.lastdr = notifStore.getLastDataRead(username)
userStore.setCircuitCmd($q, t, username, notif.extrarec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_REFUSE, 0, notif.extrarec)
.then((res: any) => {
if (res && res.result) {
@@ -7306,9 +7313,13 @@ export const tools = {
let type = costanti.TypeMov.Nessuno
if (rec && rec.userfrom) {
const userStore = useUserStore()
if (userStore.my.username === rec.userfrom.username) {
if (rec.userfrom && userStore.my.username === rec.userfrom.username) {
type = costanti.TypeMov.Uscita
} else if (userStore.my.username === rec.userto.username) {
} else if (rec.userto && userStore.my.username === rec.userto.username) {
type = costanti.TypeMov.Entrata
} else if (rec.groupfrom && tools.isUserAdminGroup(rec.groupfrom.groupname, userStore.my.username)) {
type = costanti.TypeMov.Uscita
} else if (rec.groupto && tools.isUserAdminGroup(rec.groupto.groupname, userStore.my.username)) {
type = costanti.TypeMov.Entrata
}
}

View File

@@ -32,7 +32,7 @@ export const useNotifStore = defineStore('NotifStore', {
},
getnotifs_coinsreq: (mystate: INotifState) => (): INotif[] => {
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && rec.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ && rec.status === 0) : []
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && rec.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ && rec.status === shared_consts.CircuitsNotif.STATUS_NONE) : []
return (ctrec)
},
@@ -84,6 +84,13 @@ export const useNotifStore = defineStore('NotifStore', {
}
}
},
updateArrRecNotifFromServer(arrrecnotif: INotif[]) {
if (arrrecnotif && arrrecnotif.length > 0) {
this.last_notifs = arrrecnotif
this.updateArrNotif()
}
},
async setBadgeIconApp() {
// Get our dummy count and update it,
@@ -244,6 +251,30 @@ export const useNotifStore = defineStore('NotifStore', {
setCountNotifs(num: number) {
this.countNotif = num
},
getLastNotif(username: string): any {
// Get msg for this chat
if (this.last_notifs)
return this.last_notifs.find((rec: INotif) => rec.dest === username)
// return users_msg_saved[username]
},
getLastDataRead(username: string): any {
// Get msg for this
let myrec = this.getLastNotif(username)
const lastdata: any = (myrec && myrec.lastdataread) ? myrec.lastdataread : tools.getLastDateReadReset()
let mydate = ''
if (!tools.isIsoDate(lastdata))
mydate = lastdata.toISOString()
else
return lastdata
return mydate
}
},
})

View File

@@ -491,8 +491,12 @@ export const useUserStore = defineStore('UserStore', {
let myrec = user
if (col && col.field === 'userto')
myrec = user.userto
if (col && col.field === 'groupto')
myrec = user.groupto
if (col && col.field === 'userfrom')
myrec = user.userfrom
if (col && col.field === 'groupfrom')
myrec = user.groupfrom
return myrec
},
@@ -1338,6 +1342,8 @@ export const useUserStore = defineStore('UserStore', {
const notifStore = useNotifStore()
notifStore.updateRecNotif(res.data.recnotif)
notifStore.updateArrRecNotifFromServer(res.data.arrrecnotif)
}
return res.data
}).catch((error) => {