++Strette di Mano
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.53"
|
||||
APP_VERSION="0.5.54"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.53"
|
||||
APP_VERSION="0.5.54"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.53"
|
||||
APP_VERSION="0.5.54"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.53"
|
||||
APP_VERSION="0.5.54"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.53"
|
||||
APP_VERSION="0.5.54"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="14"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
0
src/components/CContactUser/CContactUser.scss
Executable file
0
src/components/CContactUser/CContactUser.scss
Executable file
73
src/components/CContactUser/CContactUser.ts
Executable file
73
src/components/CContactUser/CContactUser.ts
Executable file
@@ -0,0 +1,73 @@
|
||||
import { tools } from '../../store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@src/boot/i18n'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { defineComponent, PropType, ref } from 'vue'
|
||||
import { IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { CLabel } from '@/components/CLabel'
|
||||
import { CSendCoins } from '@/components/CSendCoins'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CContactUser',
|
||||
props: {
|
||||
myuser: {
|
||||
type: Object as PropType<IUserFields>,
|
||||
required: true,
|
||||
},
|
||||
showBtnActivities: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
}
|
||||
},
|
||||
components: { CLabel, CSendCoins },
|
||||
setup(props) {
|
||||
const $q = useQuasar()
|
||||
const userStore = useUserStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const showsendCoinTo = ref(false)
|
||||
const showingtooltip = ref(false)
|
||||
|
||||
function myusername() {
|
||||
return userStore.my.username
|
||||
}
|
||||
|
||||
function getLinkUserTelegram() {
|
||||
|
||||
if (props.myuser) {
|
||||
if (!!props.myuser.profile.username_telegram) {
|
||||
return 'https://t.me/' + props.myuser.profile.username_telegram
|
||||
}
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
function getLinkWebSite() {
|
||||
if (props.myuser) {
|
||||
let mysite = props.myuser.profile.website!
|
||||
if (mysite) {
|
||||
if (!mysite.startsWith('http')) {
|
||||
mysite = 'https://' + mysite
|
||||
}
|
||||
}
|
||||
return mysite
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
tools,
|
||||
userStore,
|
||||
shared_consts,
|
||||
showsendCoinTo,
|
||||
getLinkUserTelegram,
|
||||
getLinkWebSite,
|
||||
myusername,
|
||||
showingtooltip,
|
||||
}
|
||||
},
|
||||
})
|
||||
119
src/components/CContactUser/CContactUser.vue
Executable file
119
src/components/CContactUser/CContactUser.vue
Executable file
@@ -0,0 +1,119 @@
|
||||
<template>
|
||||
<div class="myrow justify-evenly items-center q-pa-sm q-ma-sm">
|
||||
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
v-if="getLinkUserTelegram()"
|
||||
icon="fab fa-telegram"
|
||||
color="blue"
|
||||
:type="tools.isUserOk() ? 'a' : 'btn'"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('msgs.telegrammsg')"
|
||||
:href="tools.isUserOk() ? getLinkUserTelegram() : null"
|
||||
@click="!tools.isUserOk() ? showingtooltip = !showingtooltip : false"
|
||||
target="__blank"
|
||||
>
|
||||
</q-btn>
|
||||
<div v-else-if="myuser.email" class="row">
|
||||
<CLabel
|
||||
v-bind="$attrs"
|
||||
:copy="true"
|
||||
:value="tools.isUserOk() ? myuser.email :''"
|
||||
:label="$t('reg.email')"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
outline
|
||||
icon="fas fa-envelope"
|
||||
:color="$q.dark.isActive ? `shite` : `black`"
|
||||
:type="tools.isUserOk() ? 'a' : 'btn'"
|
||||
size="md"
|
||||
:label="$t('msgs.send_email')"
|
||||
:href="tools.isUserOk() ? tools.getemailto(myuser.email) : null"
|
||||
@click="!tools.isUserOk() ? showingtooltip = !showingtooltip : false"
|
||||
target="__blank"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
v-if="
|
||||
userStore.getMyCircuitsInCommonByUser(myuser).length > 0 &&
|
||||
myuser.username !== myusername() &&
|
||||
userStore.my.profile.calc.numGoodsAndServices > 0
|
||||
"
|
||||
icon="fas fa-coins"
|
||||
color="green"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('circuit.sendcoins')"
|
||||
@click="showsendCoinTo = true"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div v-if="myuser._id" class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
v-if="getLinkWebSite()"
|
||||
icon="fas fa-globe"
|
||||
color="blue"
|
||||
type="a"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('reg.website')"
|
||||
:href="tools.isUserOk() ? getLinkWebSite() : null"
|
||||
@click="!tools.isUserOk() ? showingtooltip = !showingtooltip : false"
|
||||
target="__blank"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="myrow justify-evenly items-center q-pa-sm q-ma-sm">
|
||||
<div v-if="myuser._id" class="col-12">
|
||||
<q-btn
|
||||
v-if="myuser.username === myusername()"
|
||||
icon="fas fa-share-alt"
|
||||
color="blue"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('reg.link_reg_and_msg')"
|
||||
@click="
|
||||
tools.sendMsgTelegramCmd(
|
||||
$q,
|
||||
$t,
|
||||
shared_consts.MsgTeleg.SHARE_MSGREG,
|
||||
true
|
||||
)
|
||||
"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div v-if="showBtnActivities" class="col-md-6 col-sm-6 q-ma-xs col-xs-12 text-center">
|
||||
|
||||
<q-btn
|
||||
icon="fas fa-house-user"
|
||||
size="md"
|
||||
color="orange"
|
||||
:label="$t('profile.myactivities')"
|
||||
:to="`/attivita/` + myuser.username"
|
||||
>
|
||||
</q-btn>
|
||||
</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">
|
||||
<CSendCoins
|
||||
:showprop="showsendCoinTo"
|
||||
:to_user="myuser"
|
||||
@close="showsendCoinTo = false"
|
||||
>
|
||||
</CSendCoins>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CContactUser.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CContactUser.scss';
|
||||
</style>
|
||||
1
src/components/CContactUser/index.ts
Executable file
1
src/components/CContactUser/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CContactUser} from './CContactUser.vue'
|
||||
@@ -8,6 +8,7 @@ import { CSkill } from '@/components/CSkill'
|
||||
import { CDateTime } from '@/components/CDateTime'
|
||||
import { CMyGroup } from '@/components/CMyGroup'
|
||||
import { CMyCircuit } from '@/components/CMyCircuit'
|
||||
import { CContactUser } from '@src/components/CContactUser'
|
||||
import { CNotifAtTop } from '@src/components/CNotifAtTop'
|
||||
import { CTimeAgo } from '@src/components/CTimeAgo'
|
||||
import { CSendCoins } from '@/components/CSendCoins'
|
||||
@@ -36,7 +37,7 @@ export default defineComponent({
|
||||
components: {
|
||||
CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime, CCopyBtn, CUserNonVerif, CMyFieldRec, CMyUser,
|
||||
CMyGroup, CLabel, CMyCircuit, CSendCoins, CNotifAtTop, CCheckIfIsLogged,
|
||||
CTimeAgo
|
||||
CTimeAgo, CContactUser
|
||||
},
|
||||
props: {
|
||||
},
|
||||
@@ -59,7 +60,6 @@ export default defineComponent({
|
||||
const filtroutente = ref(<any[]>[])
|
||||
const showPic = ref(false)
|
||||
const caricato = ref(false)
|
||||
const showsendCoinTo = ref(false)
|
||||
|
||||
const myuser = ref(<IUserFields | null>null)
|
||||
|
||||
@@ -90,7 +90,7 @@ export default defineComponent({
|
||||
// Carica il profilo di quest'utente
|
||||
if (username.value) {
|
||||
await userStore.loadUserProfile({ username: username.value, idnotif: idnotif.value }).then((ris) => {
|
||||
console.log('loadUserProfile = ', ris)
|
||||
// console.log('loadUserProfile = ', ris)
|
||||
myuser.value = ris
|
||||
if (myuser.value) {
|
||||
filtroutente.value = [{ userId: myuser.value._id }]
|
||||
@@ -201,7 +201,6 @@ export default defineComponent({
|
||||
caricato,
|
||||
listgroupsfiltered,
|
||||
idnotif,
|
||||
showsendCoinTo,
|
||||
site,
|
||||
listcircuitsfiltered,
|
||||
optionsMainCards,
|
||||
|
||||
@@ -80,6 +80,8 @@
|
||||
</div>
|
||||
<br />
|
||||
|
||||
<CContactUser :myuser="myuser" :showBtnActivities="false"/>
|
||||
|
||||
<CTitleBanner
|
||||
v-if="site.confpages.showCompetenze"
|
||||
class=""
|
||||
@@ -148,14 +150,6 @@
|
||||
<img :src="getImgUser()" :alt="username" class="full-width" />
|
||||
</q-dialog>
|
||||
|
||||
<div v-if="showsendCoinTo">
|
||||
<CSendCoins
|
||||
:showprop="showsendCoinTo"
|
||||
:to_user="myuser"
|
||||
@close="showsendCoinTo = false"
|
||||
>
|
||||
</CSendCoins>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -234,9 +234,9 @@
|
||||
@click="clickOnElem"
|
||||
>
|
||||
<q-video
|
||||
v-if="rec && !!rec.container"
|
||||
:src="rec.container"
|
||||
:ratio="rec.ratio"
|
||||
v-if="myel && !!myel.container"
|
||||
:src="myel.container"
|
||||
:ratio="myel.ratio"
|
||||
>
|
||||
</q-video>
|
||||
</div>
|
||||
|
||||
@@ -186,7 +186,7 @@ export default defineComponent({
|
||||
// Carica il profilo di quest'utente
|
||||
if (username.value) {
|
||||
spinner_visible.value = true
|
||||
userStore.loadFriends(username.value).then((ris) => {
|
||||
userStore.loadFriends().then((ris) => {
|
||||
// console.log('ris', ris)
|
||||
if (ris) {
|
||||
listTrusted.value = ris.listTrusted ? ris.listTrusted : []
|
||||
|
||||
@@ -1051,6 +1051,7 @@ const msg_it = {
|
||||
friends: 'Amici',
|
||||
bacheca: 'Bacheca',
|
||||
services: 'Servizi',
|
||||
handshake: 'Strette',
|
||||
hosp: 'Ospitalità',
|
||||
events: 'Eventi',
|
||||
goods: 'Beni',
|
||||
@@ -1086,6 +1087,7 @@ const msg_it = {
|
||||
handshake: {
|
||||
strettedimano: 'Strette di mano',
|
||||
received: 'Ricevute',
|
||||
incommon: 'Strette in Comune',
|
||||
accept_trust: 'Accetta la Stretta di mano',
|
||||
accepted: 'Stretta di mano Accettata',
|
||||
refused: 'Stretta di mano Rifiutata',
|
||||
@@ -1093,7 +1095,7 @@ const msg_it = {
|
||||
refuse: 'Rifiuta',
|
||||
accept_handshake: 'Accetta la Stretta di mano',
|
||||
remove_from_myhandshake: 'Rimuovi dalle Strette di mano',
|
||||
ask_handshake: 'Chiedi',
|
||||
ask_handshake: 'Chiedi Stretta di mano',
|
||||
cancel_ask_handshake: 'Annulla la richiesta di Stretta di mano',
|
||||
cancel_ask_handshake_short: 'Annulla',
|
||||
reject_ask_handshake: 'Rifiuta la Stretta di mano',
|
||||
|
||||
@@ -5601,7 +5601,7 @@ export const tools = {
|
||||
// console.log('OUT', res)
|
||||
|
||||
if (res && res.userprofile) {
|
||||
// console.log('updateMyData')
|
||||
console.log('updateMyData', res.userprofile)
|
||||
userStore.my.profile = res.userprofile
|
||||
|
||||
if (res.listcircuits) {
|
||||
@@ -6599,24 +6599,26 @@ export const tools = {
|
||||
tools.refuseReqGroup($q, username, dest)
|
||||
} else if (cmd === shared_consts.GROUPSCMD.CANCEL_REQ_GROUP) {
|
||||
tools.cancelReqGroups($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS) {
|
||||
tools.removeFromMyFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.BLOCK_USER) {
|
||||
tools.blockUser($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.SETFRIEND) {
|
||||
tools.addToMyFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REQFRIEND) {
|
||||
tools.setRequestFriendship($q, username, dest, value)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS) {
|
||||
tools.removeFromMyFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_FRIEND) {
|
||||
tools.refuseReqFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND) {
|
||||
tools.cancelReqFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.SETHANDSHAKE) {
|
||||
tools.addToMyHandShake($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REQHANDSHAKE) {
|
||||
tools.setRequestHandShake($q, username, dest, value)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_FRIEND) {
|
||||
tools.refuseReqFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REMOVE_FROM_MYHANDSHAKE) {
|
||||
tools.removeFromMyHandShake($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.REFUSE_REQ_HANDSHAKE) {
|
||||
tools.refuseReqHandShake($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND) {
|
||||
tools.cancelReqFriends($q, username, dest)
|
||||
} else if (cmd === shared_consts.FRIENDSCMD.CANCEL_REQ_HANDSHAKE) {
|
||||
tools.cancelReqHandShake($q, username, dest)
|
||||
} else if (cmd === shared_consts.CIRCUITCMD.SET) {
|
||||
@@ -7282,6 +7284,35 @@ export const tools = {
|
||||
|
||||
return common
|
||||
},
|
||||
// Function to return commonElements
|
||||
getCommonAllRecord(arr1: any, arr2: any, field: string): any[] {
|
||||
// @ts-ignore
|
||||
arr1.sort((a: any, b: any) => (a[field] > b[field]) - (a[field] < b[field])) // Sort both the arrays
|
||||
// @ts-ignore
|
||||
arr2.sort((a: any, b: any) => (a[field] > b[field]) - (a[field] < b[field]))
|
||||
|
||||
// console.log('arr1', arr1)
|
||||
// console.log('arr2', arr2)
|
||||
let common = [] // Array to contain common elements
|
||||
let i = 0, j = 0 // i points to arr1 and j to arr2
|
||||
// Break if one of them runs out
|
||||
while (i < arr1.length && j < arr2.length) {
|
||||
|
||||
if (arr1[i][field] == arr2[j][field]) { // If both are same, add it to result
|
||||
common.push(arr1[i])
|
||||
i++
|
||||
j++
|
||||
} else if (arr1[i][field] < arr2[j][field]) { // Increment the smaller value so that
|
||||
i++ // it could be matched with the larger
|
||||
} // element
|
||||
else {
|
||||
j++
|
||||
}
|
||||
}
|
||||
|
||||
return common
|
||||
},
|
||||
|
||||
isTypeByRecMov(rec: IMovVisu) {
|
||||
|
||||
let type = costanti.TypeMov.Nessuno
|
||||
|
||||
@@ -410,6 +410,13 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return tools.getCommon([...this.my.profile.mycircuits], [...group.mycircuits], 'circuitname')
|
||||
},
|
||||
|
||||
getMyHandshakeInCommon(myuser: IUserFields): any[] {
|
||||
|
||||
if (!this.my.profile.handshake || (!myuser || !myuser.profile.handshake))
|
||||
return []
|
||||
return tools.getCommonAllRecord([...this.my.profile.handshake], [...myuser.profile.handshake], 'username')
|
||||
},
|
||||
|
||||
|
||||
getAccountByCircuitId(circuitId: string): any {
|
||||
if (this.my.profile.useraccounts) {
|
||||
@@ -1174,14 +1181,11 @@ export const useUserStore = defineStore('UserStore', {
|
||||
idnotif
|
||||
}
|
||||
|
||||
return Api.SendReq('/users/profile', 'POST', data)
|
||||
return await Api.SendReq('/users/profile', 'POST', data)
|
||||
.then((ris) => {
|
||||
this.my.profile.friends = ris.data.friends.listFriends ? ris.data.friends.listFriends : []
|
||||
this.my.profile.req_friends = ris.data.friends.listRequestFriends ? ris.data.friends.listRequestFriends : []
|
||||
this.my.profile.handshake = ris.data.friends.listHandShake ? ris.data.friends.listHandShake : []
|
||||
this.my.profile.req_handshake = ris.data.friends.listRequestHandShake ? ris.data.friends.listRequestHandShake : []
|
||||
this.my.profile.asked_friends = ris.data.friends.listSentRequestFriends ? ris.data.friends.listSentRequestFriends : []
|
||||
this.my.profile.asked_handshake = ris.data.friends.listSentRequestHandShake ? ris.data.friends.listSentRequestHandShake : []
|
||||
if (this.my.username === ris.data.user.username) {
|
||||
// this.updateDataFr(ris.data.friends)
|
||||
}
|
||||
|
||||
return ris.data.user
|
||||
}).catch((error) => {
|
||||
@@ -1280,15 +1284,21 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async loadFriends(username: string) {
|
||||
updateDataFr(data: any) {
|
||||
console.log('updateDataFr', data)
|
||||
this.my.profile.friends = data.listFriends ? data.listFriends : []
|
||||
this.my.profile.req_friends = data.listRequestFriends ? data.listRequestFriends : []
|
||||
this.my.profile.asked_friends = data.listSentRequestFriends ? data.listSentRequestFriends : []
|
||||
|
||||
this.my.profile.handshake = data.listHandShake ? data.listHandShake : []
|
||||
this.my.profile.req_handshake = data.listRequestHandShake ? data.listRequestHandShake : []
|
||||
this.my.profile.asked_handshake = data.listSentRequestHandShake ? data.listSentRequestHandShake : []
|
||||
},
|
||||
|
||||
async loadFriends() {
|
||||
return Api.SendReq('/users/friends', 'POST', null)
|
||||
.then((ris) => {
|
||||
this.my.profile.friends = ris.data.listFriends ? ris.data.listFriends : []
|
||||
this.my.profile.req_friends = ris.data.listRequestFriends ? ris.data.listRequestFriends : []
|
||||
this.my.profile.handshake = ris.data.friends.listHandShake ? ris.data.friends.listHandShake : []
|
||||
this.my.profile.req_handshake = ris.data.friends.listRequestHandShake ? ris.data.friends.listRequestHandShake : []
|
||||
this.my.profile.asked_friends = ris.data.listSentRequestFriends ? ris.data.listSentRequestFriends : []
|
||||
this.my.profile.asked_handshake = ris.data.friends.listSentRequestHandShake ? ris.data.friends.listSentRequestHandShake : []
|
||||
this.updateDataFr(ris.data)
|
||||
return ris.data
|
||||
}).catch((error) => {
|
||||
return {}
|
||||
|
||||
@@ -78,11 +78,11 @@ export default defineComponent({
|
||||
})
|
||||
}
|
||||
|
||||
function loadProfile() {
|
||||
async function loadProfile() {
|
||||
// Carica il profilo di quest'utente
|
||||
userStore.loadUserProfile({username: userStore.my.username}).then((ris) => {
|
||||
await userStore.loadUserProfile({username: userStore.my.username}).then((ris) => {
|
||||
myuser.value = ris
|
||||
console.log('myuser._id', ris)
|
||||
// console.log('myuser._id', ris)
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@ import { CMyGroup } from '@/components/CMyGroup'
|
||||
import { CMyCircuit } from '@/components/CMyCircuit'
|
||||
import { CNotifAtTop } from '@src/components/CNotifAtTop'
|
||||
import { CSendCoins } from '@/components/CSendCoins'
|
||||
import { CContactUser } from '@/components/CContactUser'
|
||||
import { CTimeAgo } from '@/components/CTimeAgo'
|
||||
import { CMyUser } from '@/components/CMyUser'
|
||||
import { CUserNonVerif } from '@/components/CUserNonVerif'
|
||||
@@ -23,7 +24,7 @@ import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { ICircuit, IMyCircuit, IMyGroup, IUserFields } from 'model'
|
||||
import { ICircuit, IFriends, IMyCircuit, IMyGroup, IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { static_data } from '@/db/static_data'
|
||||
import { fieldsTable } from '@store/Modules/fieldsTable'
|
||||
@@ -36,7 +37,7 @@ export default defineComponent({
|
||||
components: {
|
||||
CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime, CCopyBtn, CUserNonVerif, CMyFieldRec, CMyUser,
|
||||
CMyGroup, CLabel, CMyCircuit, CSendCoins, CNotifAtTop,
|
||||
CCheckIfIsLogged, CTimeAgo
|
||||
CCheckIfIsLogged, CTimeAgo, CContactUser
|
||||
},
|
||||
props: {},
|
||||
setup() {
|
||||
@@ -52,6 +53,7 @@ export default defineComponent({
|
||||
|
||||
const animation = ref('fade')
|
||||
const quantiHandShake = ref('')
|
||||
const quanteHandShakeInCommon = ref('')
|
||||
const usersList = ref({show: false, title: '', list: []})
|
||||
|
||||
const username = computed(() => $route.params.username ? $route.params.username.toString() : userStore.my.username)
|
||||
@@ -65,6 +67,7 @@ export default defineComponent({
|
||||
const showinghand = ref(false)
|
||||
|
||||
const myuser = ref(<IUserFields | null>null)
|
||||
const handshake_inCommon = ref(<IFriends[]>[])
|
||||
|
||||
const actualcard = ref('mygoods')
|
||||
|
||||
@@ -89,6 +92,7 @@ export default defineComponent({
|
||||
async function loadProfile() {
|
||||
console.log('loadProfile...', username.value)
|
||||
try {
|
||||
caricato.value = false
|
||||
// Carica il profilo di quest'utente
|
||||
if (username.value) {
|
||||
await userStore.loadUserProfile({ username: username.value, idnotif: idnotif.value }).then((ris) => {
|
||||
@@ -99,6 +103,8 @@ export default defineComponent({
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
|
||||
quantiHandShake.value = (myuser.value.profile.handshake ? myuser.value.profile.handshake.length : 0) + ' ' + t('handshake.received')
|
||||
handshake_inCommon.value = userStore.getMyHandshakeInCommon(myuser.value)
|
||||
quanteHandShakeInCommon.value = (handshake_inCommon.value ? handshake_inCommon.value.length : 0) + ' ' + t('handshake.incommon')
|
||||
|
||||
try {
|
||||
listgroupsfiltered.value = globalStore.mygroups.filter((grp: IMyGroup) => myuser.value!.profile.mygroups.findIndex((rec: IMyGroup) => rec.groupname === grp.groupname) >= 0)
|
||||
@@ -146,31 +152,6 @@ export default defineComponent({
|
||||
return true
|
||||
}
|
||||
|
||||
function getLinkUserTelegram() {
|
||||
|
||||
if (myuser.value) {
|
||||
if (!!myuser.value.profile.username_telegram) {
|
||||
return 'https://t.me/' + myuser.value.profile.username_telegram
|
||||
}
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
function getLinkWebSite() {
|
||||
if (myuser.value) {
|
||||
let mysite = myuser.value.profile.website!
|
||||
if (mysite) {
|
||||
if (!mysite.startsWith('http')) {
|
||||
mysite = 'https://' + mysite
|
||||
}
|
||||
}
|
||||
return mysite
|
||||
} else {
|
||||
return ''
|
||||
}
|
||||
}
|
||||
|
||||
function isMyRecord(username: string) {
|
||||
return username === userStore.my.username
|
||||
}
|
||||
@@ -187,8 +168,6 @@ export default defineComponent({
|
||||
shared_consts,
|
||||
getImgUser,
|
||||
checkifShow,
|
||||
getLinkUserTelegram,
|
||||
getLinkWebSite,
|
||||
filtroutente,
|
||||
showPic,
|
||||
myusername,
|
||||
@@ -210,7 +189,9 @@ export default defineComponent({
|
||||
isDebugOn,
|
||||
showinghand,
|
||||
quantiHandShake,
|
||||
quanteHandShakeInCommon,
|
||||
usersList,
|
||||
handshake_inCommon,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
<template>
|
||||
<div v-if="isDebugOn" class="bg-red text-white">
|
||||
<div v-if="!!tools.isLogged()">Logged: {{ tools.isLogged() }}</div>
|
||||
<div v-if="!!tools.isUserOk()">UserOk: {{ tools.isUserOk() }}</div>
|
||||
<div v-if="caricato">caricato: {{ caricato }}</div>
|
||||
<div v-if="myuser">myuser: {{ myuser.username }}</div>
|
||||
<span v-if="!!tools.isLogged()">Logged: {{ tools.isLogged() }}</span> -
|
||||
<span v-if="!!tools.isUserOk()">UserOk: {{ tools.isUserOk() }}</span> -
|
||||
<span v-if="caricato">caricato: {{ caricato }}</span> -
|
||||
<span v-if="myuser">myuser: {{ myuser.username }}</span>
|
||||
</div>
|
||||
<div
|
||||
v-if="!caricato"
|
||||
@@ -232,8 +232,24 @@
|
||||
</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"
|
||||
@click="
|
||||
usersList.show = true;
|
||||
usersList.title = 'Strette di mano in Comune';
|
||||
usersList.list = handshake_inCommon;
|
||||
"
|
||||
>
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="myuser.profile && myuser.profile.handshake && myuser.profile.handshake.length > 0"
|
||||
:label="quantiHandShake"
|
||||
class="q-my-sm"
|
||||
:text-color="$q.dark.isActive ? 'black' : 'black'"
|
||||
rounded
|
||||
icon="fas fa-handshake"
|
||||
@click="
|
||||
@@ -244,6 +260,7 @@
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
|
||||
<!--HANDSHAKE-->
|
||||
<div v-if="!isMyRecord(myuser.username)">
|
||||
<div
|
||||
@@ -257,8 +274,8 @@
|
||||
@click="
|
||||
tools.addToMyHandShake(
|
||||
$q,
|
||||
myuser.username,
|
||||
userStore.my.username,
|
||||
myuser.username
|
||||
)
|
||||
"
|
||||
/>
|
||||
@@ -269,8 +286,8 @@
|
||||
@click="
|
||||
tools.refuseReqHandShake(
|
||||
$q,
|
||||
myuser.username,
|
||||
userStore.my.username,
|
||||
myuser.username
|
||||
)
|
||||
"
|
||||
/>
|
||||
@@ -441,103 +458,7 @@
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="myrow justify-evenly items-center q-pa-sm q-ma-sm">
|
||||
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
v-if="getLinkUserTelegram()"
|
||||
icon="fab fa-telegram"
|
||||
color="blue"
|
||||
type="a"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('msgs.telegrammsg')"
|
||||
:href="getLinkUserTelegram()"
|
||||
target="__blank"
|
||||
>
|
||||
</q-btn>
|
||||
<div v-else-if="myuser.email" class="row">
|
||||
<CLabel
|
||||
v-bind="$attrs"
|
||||
:copy="true"
|
||||
:value="myuser.email"
|
||||
:label="$t('reg.email')"
|
||||
/>
|
||||
|
||||
<q-btn
|
||||
outline
|
||||
icon="fas fa-envelope"
|
||||
:color="$q.dark.isActive ? `shite` : `black`"
|
||||
type="a"
|
||||
size="md"
|
||||
:label="$t('msgs.send_email')"
|
||||
:href="tools.getemailto(myuser.email)"
|
||||
target="__blank"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
icon="fas fa-house-user"
|
||||
size="md"
|
||||
color="orange"
|
||||
:label="$t('profile.myactivities')"
|
||||
:to="`/attivita/` + myuser.username"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
v-if="
|
||||
userStore.getMyCircuitsInCommonByUser(myuser).length > 0 &&
|
||||
myuser.username !== myusername() &&
|
||||
userStore.my.profile.calc.numGoodsAndServices > 0
|
||||
"
|
||||
icon="fas fa-coins"
|
||||
color="green"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('circuit.sendcoins')"
|
||||
@click="showsendCoinTo = true"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
<div v-if="myuser._id" class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
v-if="getLinkWebSite()"
|
||||
icon="fas fa-globe"
|
||||
color="blue"
|
||||
type="a"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('reg.website')"
|
||||
:href="getLinkWebSite()"
|
||||
target="__blank"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<div class="myrow justify-evenly items-center q-pa-sm q-ma-sm">
|
||||
<div v-if="myuser._id" class="col-12">
|
||||
<q-btn
|
||||
v-if="myuser.username === myusername()"
|
||||
icon="fas fa-share-alt"
|
||||
color="blue"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('reg.link_reg_and_msg')"
|
||||
@click="
|
||||
tools.sendMsgTelegramCmd(
|
||||
$q,
|
||||
$t,
|
||||
shared_consts.MsgTeleg.SHARE_MSGREG,
|
||||
true
|
||||
)
|
||||
"
|
||||
>
|
||||
</q-btn>
|
||||
</div>
|
||||
</div>
|
||||
<CContactUser :myuser="myuser" :showBtnActivities="true"/>
|
||||
</div>
|
||||
|
||||
<div
|
||||
@@ -610,14 +531,6 @@
|
||||
<img :src="getImgUser()" :alt="username" class="full-width" />
|
||||
</q-dialog>
|
||||
|
||||
<div v-if="showsendCoinTo">
|
||||
<CSendCoins
|
||||
:showprop="showsendCoinTo"
|
||||
:to_user="myuser"
|
||||
@close="showsendCoinTo = false"
|
||||
>
|
||||
</CSendCoins>
|
||||
</div>
|
||||
<q-page-sticky
|
||||
v-if="myuser.username === myusername()"
|
||||
position="top-right"
|
||||
|
||||
Reference in New Issue
Block a user