++Strette di Mano

This commit is contained in:
Surya Paolo
2023-01-08 02:17:15 +01:00
parent 865e1ad738
commit 4d40efc73a
19 changed files with 309 additions and 186 deletions

View File

@@ -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,
}
}
})