Stringi la mano (fase prima)

This commit is contained in:
Surya Paolo
2023-01-08 19:20:25 +01:00
parent 4d40efc73a
commit 815ca0d565
9 changed files with 222 additions and 132 deletions

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="myrow justify-evenly items-center q-pa-sm q-ma-sm"> <div class="row justify-evenly items-center q-pa-sm q-ma-sm">
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div class="q-ma-sx">
<q-btn <q-btn
v-if="getLinkUserTelegram()" v-if="getLinkUserTelegram()"
icon="fab fa-telegram" icon="fab fa-telegram"
@@ -10,15 +10,15 @@
rounded rounded
:label="$t('msgs.telegrammsg')" :label="$t('msgs.telegrammsg')"
:href="tools.isUserOk() ? getLinkUserTelegram() : null" :href="tools.isUserOk() ? getLinkUserTelegram() : null"
@click="!tools.isUserOk() ? showingtooltip = !showingtooltip : false" @click="!tools.isUserOk() ? (showingtooltip = !showingtooltip) : false"
target="__blank" target="__blank"
> >
</q-btn> </q-btn>
<div v-else-if="myuser.email" class="row"> <div v-else-if="myuser.email" class="row q-ma-sx">
<CLabel <CLabel
v-bind="$attrs" v-bind="$attrs"
:copy="true" :copy="true"
:value="tools.isUserOk() ? myuser.email :''" :value="tools.isUserOk() ? myuser.email : ''"
:label="$t('reg.email')" :label="$t('reg.email')"
/> />
@@ -30,13 +30,15 @@
size="md" size="md"
:label="$t('msgs.send_email')" :label="$t('msgs.send_email')"
:href="tools.isUserOk() ? tools.getemailto(myuser.email) : null" :href="tools.isUserOk() ? tools.getemailto(myuser.email) : null"
@click="!tools.isUserOk() ? showingtooltip = !showingtooltip : false" @click="
!tools.isUserOk() ? (showingtooltip = !showingtooltip) : false
"
target="__blank" target="__blank"
> >
</q-btn> </q-btn>
</div> </div>
</div> </div>
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div class="q-ma-sx">
<q-btn <q-btn
v-if=" v-if="
userStore.getMyCircuitsInCommonByUser(myuser).length > 0 && userStore.getMyCircuitsInCommonByUser(myuser).length > 0 &&
@@ -52,7 +54,7 @@
> >
</q-btn> </q-btn>
</div> </div>
<div v-if="myuser._id" class="col-md-6 col-sm-6 q-ma-xs col-xs-12"> <div v-if="myuser._id" class="q-ma-sx">
<q-btn <q-btn
v-if="getLinkWebSite()" v-if="getLinkWebSite()"
icon="fas fa-globe" icon="fas fa-globe"
@@ -62,7 +64,7 @@
rounded rounded
:label="$t('reg.website')" :label="$t('reg.website')"
:href="tools.isUserOk() ? getLinkWebSite() : null" :href="tools.isUserOk() ? getLinkWebSite() : null"
@click="!tools.isUserOk() ? showingtooltip = !showingtooltip : false" @click="!tools.isUserOk() ? (showingtooltip = !showingtooltip) : false"
target="__blank" target="__blank"
> >
</q-btn> </q-btn>
@@ -88,8 +90,10 @@
> >
</q-btn> </q-btn>
</div> </div>
<div v-if="showBtnActivities" class="col-md-6 col-sm-6 q-ma-xs col-xs-12 text-center"> <div
v-if="showBtnActivities"
class="col-md-6 col-sm-6 q-ma-xs col-xs-12 text-center"
>
<q-btn <q-btn
icon="fas fa-house-user" icon="fas fa-house-user"
size="md" size="md"
@@ -99,8 +103,10 @@
> >
</q-btn> </q-btn>
</div> </div>
<q-tooltip v-if="showingtooltip" class="bg-red text-body2 text-bold" :offset="[10, 10]" v-model="showingtooltip"
>Per contattare la persona:<br />Entra ed Accedi a RISO</q-tooltip
>
</div> </div>
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">Per contattare la persona:<br>Accedi a RISO o Registrati</q-tooltip>
<div v-if="showsendCoinTo"> <div v-if="showsendCoinTo">
<CSendCoins <CSendCoins
:showprop="showsendCoinTo" :showprop="showsendCoinTo"

View File

@@ -63,6 +63,7 @@ export default defineComponent({
lastsonline: [], lastsonline: [],
lastssharedlink: [], lastssharedlink: [],
diffusorilist: [], diffusorilist: [],
strettelist: [],
checkuser: { verified_email: false } checkuser: { verified_email: false }
}) })
@@ -90,6 +91,9 @@ export default defineComponent({
const diffusorilist = computed(() => { const diffusorilist = computed(() => {
return datastat.value.diffusorilist return datastat.value.diffusorilist
}) })
const strettelist = computed(() => {
return datastat.value.strettelist
})
watch(() => $q.appVisible, (value: any, oldval: any) => { watch(() => $q.appVisible, (value: any, oldval: any) => {
// console.log('visible', value) // console.log('visible', value)
@@ -208,6 +212,7 @@ export default defineComponent({
lastsonline, lastsonline,
lastssharedlink, lastssharedlink,
diffusorilist, diffusorilist,
strettelist,
datastat, datastat,
tools, tools,
costanti, costanti,

View File

@@ -69,6 +69,11 @@
:label="$t('statusreg.diffusori')" :label="$t('statusreg.diffusori')"
icon="fas fa-medal" icon="fas fa-medal"
/> />
<q-tab
name="strettelist"
:label="$t('statusreg.strettelist')"
icon="fas fa-handshake"
/>
</q-tabs> </q-tabs>
<q-tab-panels v-model="mytab" animated> <q-tab-panels v-model="mytab" animated>
@@ -224,6 +229,66 @@
</q-list> </q-list>
</div> </div>
</q-tab-panel> </q-tab-panel>
<q-tab-panel name="strettelist">
<div class="q-pa-md" style="max-width: 300px">
<div class="text-center text-bold text-h6">
Strette di Mano
</div>
<div class="text-center">
Più persone conoscerai di persona e maggiore aumenterà la Rete di fiducia.
</div>
<q-list bordered>
<transition-group
name="fade"
mode="out-in"
appear
enter-active-class="animazione fadeIn"
leave-active-class="animazione fadeOut"
>
<q-item
v-for="(user, index) in strettelist"
:key="index"
class="animated chip_shadow q-ma-sm"
clickable
v-ripple
@click="gotoPage(`/my/${user.username}`)"
>
<q-item-section avatar>
<q-avatar round size="48px">
<img :src="userStore.getImgByProfile(user)" />
<q-badge
v-if="tools.isUserOnline(user)"
align="top"
floating
color="green"
>online</q-badge
>
</q-avatar>
</q-item-section>
<q-item-section class="">
<q-item-label overline>
<div class="index_diffusore">{{ index + 1 }}°</div>
</q-item-label>
<q-item-label>
{{ tools.getNameToShow(user) }}</q-item-label
>
<q-item-label caption>{{
tools.getUserNameOnlyIfToShow(user)
}}</q-item-label>
</q-item-section>
<q-item-section side
><div
:class="
`text-h6 q-mx-sm q-px-sm text-bold ` + ($q.dark.isActive ? `text-white`: `text-black`)
"
>{{ user.count }}
</div></q-item-section
>
</q-item>
</transition-group>
</q-list>
</div>
</q-tab-panel>
<q-tab-panel name="sharedlink"> <q-tab-panel name="sharedlink">
<div class="q-pa-md" style="max-width: 300px"> <div class="q-pa-md" style="max-width: 300px">
<div class="text-center text-bold text-h6"> <div class="text-center text-bold text-h6">

View File

@@ -90,6 +90,8 @@
<q-item-section v-ripple> <q-item-section v-ripple>
status: {{notif.status}}
typedir: {{notif.typedir}}
<q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)"> <q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)">
<div v-html="getNotifText($t, notif, false)"></div> <div v-html="getNotifText($t, notif, false)"></div>
</q-item-label> </q-item-label>

View File

@@ -35,6 +35,7 @@ export interface INotData {
lastsonline?: IUserFields[] lastsonline?: IUserFields[]
lastssharedlink?: IUserFields[] lastssharedlink?: IUserFields[]
diffusorilist?: IUserFields[] diffusorilist?: IUserFields[]
strettelist?: IUserFields[]
checkuser?: ICheckUser | any checkuser?: ICheckUser | any
numreg_untilday?: number numreg_untilday?: number
reg_daily?: string reg_daily?: string

View File

@@ -226,7 +226,7 @@ const msg_it = {
insertgoodorservices_to_enter_circuit: 'Per poter entrare nel Circuito è necessario aggiungere almeno un Bene, Servizio o offrire Ospitalità', insertgoodorservices_to_enter_circuit: 'Per poter entrare nel Circuito è necessario aggiungere almeno un Bene, Servizio o offrire Ospitalità',
deletedgroup: 'Gruppo Eliminato', deletedgroup: 'Gruppo Eliminato',
domanda_addtofriend: 'Aggiungere agli amici {username}?', domanda_addtofriend: 'Aggiungere agli amici {username}?',
domanda_addtohandshake: 'Hai stretto la mano a {username}?', domanda_addtohandshake: 'Confermi che hai conosciuto personalmente e dai la tua fiducia a {username}?<br>({username} riceverà una richiesta di conferma)" ?',
addtohandshake: 'Hai stretto la mano a {username}', addtohandshake: 'Hai stretto la mano a {username}',
domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?', domanda_addtogroup: 'Aggiungi {username} al gruppo {groupname}?',
domanda_addtocircuit: 'Aggiungi {username} al Circuito {circuitname}?', domanda_addtocircuit: 'Aggiungi {username} al Circuito {circuitname}?',
@@ -237,7 +237,7 @@ const msg_it = {
domanda_trusted: 'Accettare la Fiducia a {username}?', domanda_trusted: 'Accettare la Fiducia a {username}?',
trusted: 'Accettato la Fiducia', trusted: 'Accettato la Fiducia',
domanda_ask_friend: 'Chiedere l\'Amicizia a {username}?', domanda_ask_friend: 'Chiedere l\'Amicizia a {username}?',
domanda_ask_handshake: 'Chiedere di confermare la vostra Stretta di mano a {username}?', domanda_ask_handshake: 'Confermi che hai conosciuto personalmente e dai la tua fiducia a {username} ?',
domanda_ask_group: 'Chiedere l\'invito al Gruppo {groupname}?', domanda_ask_group: 'Chiedere l\'invito al Gruppo {groupname}?',
askedtofriend: 'Chiesto l\'Amicizia a {username}', askedtofriend: 'Chiesto l\'Amicizia a {username}',
askedtohandshake: 'Chiesto la Stretta di mano a {username}', askedtohandshake: 'Chiesto la Stretta di mano a {username}',
@@ -1078,10 +1078,10 @@ const msg_it = {
reject_trust: 'Revoca Fiducia', reject_trust: 'Revoca Fiducia',
remove_from_myfriends: 'Rimuovi dagli Amici', remove_from_myfriends: 'Rimuovi dagli Amici',
block_user: 'Blocca Utente', block_user: 'Blocca Utente',
ask_friend: 'Chiedi l\'Amicizia', ask_friend: 'Chiedi Amicizia',
cancel_ask_friend: 'Annulla la richiesta di Amicizia', cancel_ask_friend: 'Annulla la richiesta di Amicizia',
cancel_ask_friend_short: 'Annulla rich. Amicizia', cancel_ask_friend_short: 'Annulla rich. Amicizia',
reject_ask_friend: 'Rifiuta l\'Amicizia', reject_ask_friend: 'Rifiuta Amicizia',
report_user: 'Segnala Utente', report_user: 'Segnala Utente',
}, },
handshake: { handshake: {
@@ -1089,13 +1089,13 @@ const msg_it = {
received: 'Ricevute', received: 'Ricevute',
incommon: 'Strette in Comune', incommon: 'Strette in Comune',
accept_trust: 'Accetta la Stretta di mano', accept_trust: 'Accetta la Stretta di mano',
accepted: 'Stretta di mano Accettata', accepted: 'Stretta di mano confermata',
refused: 'Stretta di mano Rifiutata', refused: 'Stretta di mano rifiutata',
accept: 'Accetta', accept: 'Conferma',
refuse: 'Rifiuta', refuse: 'Rifiuta',
accept_handshake: 'Accetta la Stretta di mano', accept_handshake: 'Conferma la Stretta di mano',
remove_from_myhandshake: 'Rimuovi dalle Strette di mano', remove_from_myhandshake: 'Rimuovi dalle Strette di mano',
ask_handshake: 'Chiedi Stretta di mano', ask_handshake: 'Stringi la mano',
cancel_ask_handshake: 'Annulla la richiesta di Stretta di mano', cancel_ask_handshake: 'Annulla la richiesta di Stretta di mano',
cancel_ask_handshake_short: 'Annulla', cancel_ask_handshake_short: 'Annulla',
reject_ask_handshake: 'Rifiuta la Stretta di mano', reject_ask_handshake: 'Rifiuta la Stretta di mano',
@@ -1399,6 +1399,7 @@ const msg_it = {
newreg: 'Registrati', newreg: 'Registrati',
onlineusers: 'OnLine', onlineusers: 'OnLine',
diffusori: 'Diffusori', diffusori: 'Diffusori',
strettelist: 'Strette',
sharedlink: 'Diffusori', sharedlink: 'Diffusori',
nationality: 'Nazionalità', nationality: 'Nazionalità',
nationality_born: 'Nazione di Nascita', nationality_born: 'Nazione di Nascita',

View File

@@ -85,7 +85,7 @@ export const useNotifStore = defineStore('NotifStore', {
} }
}, },
async setBadgeIconApp(){ async setBadgeIconApp() {
// Get our dummy count and update it, // Get our dummy count and update it,
// just to give more context for this demo. // just to give more context for this demo.
const countNow = this.getnumNotifUnread() const countNow = this.getnumNotifUnread()
@@ -95,7 +95,7 @@ export const useNotifStore = defineStore('NotifStore', {
await navigator.setAppBadge(countNow) await navigator.setAppBadge(countNow)
.catch((error: any) => { /* ... */ .catch((error: any) => { /* ... */
}); });
}catch (e) { } catch (e) {
} }
}, },
@@ -104,12 +104,14 @@ export const useNotifStore = defineStore('NotifStore', {
return Api.SendReq(`/sendnotif/setall/${username}/${qualinotif}/${process.env.APP_ID}`, 'GET', null) return Api.SendReq(`/sendnotif/setall/${username}/${qualinotif}/${process.env.APP_ID}`, 'GET', null)
.then((res) => { .then((res) => {
// console.log('res', res) // console.log('res', res)
if (res) { setTimeout(() => {
for (const rec of this.last_notifs) { if (res) {
rec.read = true for (const rec of this.last_notifs) {
rec.read = true
}
} }
} this.updateArrNotif()
this.updateArrNotif() }, 3000)
}) })
.catch((error) => { .catch((error) => {
@@ -178,7 +180,7 @@ export const useNotifStore = defineStore('NotifStore', {
return '' return ''
}, },
async updateNotifDataFromServer({ username, lastdataread }: {username: string, lastdataread: Date}) { async updateNotifDataFromServer({ username, lastdataread }: { username: string, lastdataread: Date }) {
// console.log('updateNotifDataFromServer', username, lastdataread) // console.log('updateNotifDataFromServer', username, lastdataread)
return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}`, 'GET', null) return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}`, 'GET', null)

View File

@@ -102,7 +102,7 @@ export default defineComponent({
filtroutente.value = [{ userId: myuser.value._id }] filtroutente.value = [{ userId: myuser.value._id }]
notifStore.setAsRead(idnotif.value) notifStore.setAsRead(idnotif.value)
quantiHandShake.value = (myuser.value.profile.handshake ? myuser.value.profile.handshake.length : 0) + ' ' + t('handshake.received') quantiHandShake.value = (myuser.value.profile.handshake ? myuser.value.profile.handshake.length : 0) + ' ' + t('handshake.strettedimano')
handshake_inCommon.value = userStore.getMyHandshakeInCommon(myuser.value) handshake_inCommon.value = userStore.getMyHandshakeInCommon(myuser.value)
quanteHandShakeInCommon.value = (handshake_inCommon.value ? handshake_inCommon.value.length : 0) + ' ' + t('handshake.incommon') quanteHandShakeInCommon.value = (handshake_inCommon.value ? handshake_inCommon.value.length : 0) + ' ' + t('handshake.incommon')

View File

@@ -218,119 +218,127 @@
<div v-if="myuser._id" class="col-12 text-h8 q-mt-sm"> <div v-if="myuser._id" class="col-12 text-h8 q-mt-sm">
{{ myuser.profile.biografia }} {{ myuser.profile.biografia }}
</div> </div>
<q-banner <div v-if="userStore.IsHandShakeByUsername(myuser.username)">
rounded <q-chip
dense color="green"
size="lg" dense
class="bg-grey-1 shadow-5 q-my-sm" class="cltexth4 chipbooked shadow-5 q-pa-sm2"
color="primary q-title" size="md"
style="text-align: center"
>
<div class="mybanner bg-blue text-white">{{ $t('handshake.strettedimano')}}:</div>
<div v-if="userStore.IsHandShakeByUsername(myuser.username)">
{{ $t('db.addtohandshake', { username: myuser.username }) }}
</div>
<q-btn
v-if="handshake_inCommon && handshake_inCommon.length > 0"
:label="quanteHandShakeInCommon"
class="q-my-sm"
:text-color="$q.dark.isActive ? 'black' : 'black'"
rounded
icon="fas fa-handshake" icon="fas fa-handshake"
@click="
usersList.show = true;
usersList.title = 'Strette di mano in Comune';
usersList.list = handshake_inCommon;
"
> >
</q-btn> <span
<q-btn >&nbsp;<em class="q-pa-xxs text-white rounded-borders shadow-2">
v-if="myuser.profile && myuser.profile.handshake && myuser.profile.handshake.length > 0" {{ $t('db.addtohandshake', { username: myuser.username }) }}
:label="quantiHandShake" </em></span
class="q-my-sm"
:text-color="$q.dark.isActive ? 'black' : 'black'"
rounded
icon="fas fa-handshake"
@click="
usersList.show = true;
usersList.title = 'Lista Strette di mano';
usersList.list = myuser.profile.handshake;
"
>
</q-btn>
<!--HANDSHAKE-->
<div v-if="!isMyRecord(myuser.username)">
<div
class="row centeritems q-ma-sm q-pa-sm"
v-if="userStore.IsReqHandShakeByUsername(myuser.username)"
> >
<q-btn </q-chip>
icon="fas fa-handshake" </div>
color="positive" <q-btn
:label="$t('handshake.accept_handshake')" v-if="
@click=" myuser.profile &&
tools.addToMyHandShake( myuser.profile.handshake &&
$q, myuser.profile.handshake.length > 0
myuser.username, "
userStore.my.username, :label="quantiHandShake"
) class="q-my-sm"
" :text-color="$q.dark.isActive ? 'black' : 'black'"
/> rounded
<q-btn icon="fas fa-handshake"
icon="fas fa-handshake-alt-slash" @click="
color="negative" usersList.show = true;
:label="$t('handshake.reject_ask_handshake')" usersList.title = 'Lista Strette di mano';
@click=" usersList.list = myuser.profile.handshake;
tools.refuseReqHandShake( "
$q, >
myuser.username, </q-btn>
userStore.my.username, <q-btn
) v-if="
" myuser.username !== myusername() &&
/> handshake_inCommon &&
</div> handshake_inCommon.length > 0
<div v-else> "
<q-btn :label="quanteHandShakeInCommon"
v-if=" class="q-my-sm"
!userStore.IsHandShakeByUsername(myuser.username) && :text-color="$q.dark.isActive ? 'black' : 'black'"
!userStore.IsAskedHandShakeByUsername(myuser.username) rounded
" icon="fas fa-handshake"
icon="fas fa-handshake" @click="
color="primary" usersList.show = true;
:label="$t('handshake.ask_handshake')" usersList.title = 'Strette di mano in Comune';
@click=" usersList.list = handshake_inCommon;
tools.setRequestHandShake( "
$q, >
userStore.my.username, </q-btn>
myuser.username,
true
)
"
/>
</div>
<!--HANDSHAKE-->
<div v-if="!isMyRecord(myuser.username)">
<div
class="row centeritems q-ma-sm q-pa-sm"
v-if="userStore.IsReqHandShakeByUsername(myuser.username)"
>
<q-btn <q-btn
v-if=" icon="fas fa-handshake"
userStore.IsAskedHandShakeByUsername(myuser.username) && color="positive"
!userStore.IsHandShakeByUsername(myuser.username) :label="$t('handshake.accept_handshake')"
"
icon="fas fa-handshake-alt-slash"
:label="$t('handshake.cancel_ask_handshake_short')"
@click=" @click="
tools.cancelReqHandShake( tools.addToMyHandShake(
$q, $q,
userStore.my.username, myuser.username,
myuser.username userStore.my.username
)
"
/>
<q-btn
icon="fas fa-handshake-alt-slash"
color="negative"
:label="$t('handshake.reject_ask_handshake')"
@click="
tools.refuseReqHandShake(
$q,
myuser.username,
userStore.my.username
)
"
/>
</div>
<div v-else>
<q-btn
v-if="
!userStore.IsHandShakeByUsername(myuser.username) &&
!userStore.IsAskedHandShakeByUsername(myuser.username)
"
icon="fas fa-handshake"
color="primary"
:label="$t('handshake.ask_handshake')"
@click="
tools.setRequestHandShake(
$q,
userStore.my.username,
myuser.username,
true
) )
" "
/> />
</div> </div>
</q-banner>
<div v-if="!isMyRecord(myuser.username)"> <q-btn
v-if="
userStore.IsAskedHandShakeByUsername(myuser.username) &&
!userStore.IsHandShakeByUsername(myuser.username)
"
icon="fas fa-handshake-alt-slash"
:text-color="$q.dark.isActive ? 'black' : 'black'"
:label="$t('handshake.cancel_ask_handshake_short')"
@click="
tools.cancelReqHandShake(
$q,
userStore.my.username,
myuser.username
)
"
/>
</div>
<div v-if="!isMyRecord(myuser.username)" class="q-ma-sm">
<div <div
class="row centeritems q-ma-sm q-pa-sm" class="row centeritems q-ma-sm q-pa-sm"
v-if="userStore.IsReqFriendByUsername(myuser.username)" v-if="userStore.IsReqFriendByUsername(myuser.username)"
@@ -458,7 +466,7 @@
/> />
</div> </div>
<CContactUser :myuser="myuser" :showBtnActivities="true"/> <CContactUser :myuser="myuser" :showBtnActivities="true" />
</div> </div>
<div <div