- aggiornata la grafica della Home di RISO

- Profilo Completition
- Email Verificata
- Invita un Amico (invio di email)
This commit is contained in:
Surya Paolo
2025-11-15 19:38:39 +01:00
parent d812c6c799
commit b8df3ea721
110 changed files with 10856 additions and 2765 deletions

View File

@@ -2717,6 +2717,17 @@ export const tools = {
return result;
},
getUserEmail() {
const userStore = useUserStore();
return userStore.my?.email;
},
getEmailSupport() {
const globalStore = useGlobalStore();
const site = globalStore.site;
return this.getemailto(site?.contacts.email)
},
visumenu(elem: IListRoutes) {
// : IListRoutes
@@ -5631,11 +5642,19 @@ export const tools = {
getLinkBotTelegram(aportador_solidario: string, regexpire: string): string {
let mylink = '';
const sep = '-';
if (tools.isTest() && !import.meta.env.DEV) {
/*if (tools.isTest() && !import.meta.env.DEV) {
mylink = tools.getValDb('TELEG_BOT_LINK_TEST', false);
} else {
mylink = tools.getValDb('TELEG_BOT_LINK', false);
}*/
const globalStore = useGlobalStore();
const site = globalStore.site;
if (tools.isTest() && !import.meta.env.DEV) {
mylink = 'https://t.me/' + site.telegram_bot_name_test
} else {
mylink = 'https://t.me/' + site.telegram_bot_name
}
let add = '';
if (aportador_solidario) {
add = '?start=inv' + sep + aportador_solidario + sep + 'ex' + sep + regexpire;
@@ -6356,6 +6375,33 @@ export const tools = {
});
},
verifyUser($q: any, username: string, usernameDest: string) {
// Segnala Profilo
const userStore = useUserStore();
//T_TOLTO
$q.dialog({
message: t('db.domanda_verifyuser', { username: usernameDest }),
ok: { label: t('dialog.yes'), push: true },
cancel: { label: t('dialog.cancel') },
title: t('db.domanda'),
}).onOk(() => {
userStore
.setFriendsCmd(
$q,
t,
username,
usernameDest,
shared_consts.FRIENDSCMD.SETTRUST,
true
)
.then((res: any) => {
if (res) {
tools.showPositiveNotif($q, t('db.trusted', {username: usernameDest}));
}
});
});
},
refuseReqFriends($q: any, username: string, usernameDest: string) {
//T_TOLTO
const userStore = useUserStore();
@@ -7705,7 +7751,10 @@ export const tools = {
let risultato = false;
if (userStore.isAdmin || shared_consts.USER_ADMIN_CIRCUITS.includes(userStore.my.username)) {
if (
userStore.isAdmin ||
shared_consts.USER_ADMIN_CIRCUITS.includes(userStore.my.username)
) {
return true;
}
@@ -8250,7 +8299,9 @@ export const tools = {
return {
idSector: tools.getSelectionByTable('sectors', 0, true),
idSkill: tools.getSelectionByTable('skills', 0, true),
idStatusSkill: tools.getSelectionByTable('statusSkills', [shared_consts.STATUSSKILL_DI_PERSONA]),
idStatusSkill: tools.getSelectionByTable('statusSkills', [
shared_consts.STATUSSKILL_DI_PERSONA,
]),
idContribType: tools.getSelectionByTable('contribtypes', []),
dateTimeStart: tools.getDateTomorrowByTime(21),
dateTimeEnd: null,
@@ -8644,7 +8695,7 @@ export const tools = {
? ris.last_my_transactions
: [];
userStore.my.profile.total_transactions = ris.total_transactions
userStore.my.profile.total_transactions = ris.total_transactions;
return [{ userId: userStore.my._id }];
}
});
@@ -11061,7 +11112,7 @@ export const tools = {
}
},
addstrCookie(table): string {
addstrCookie(table: string): string {
let addstr = '_' + table;
return addstr;
},
@@ -11193,19 +11244,26 @@ export const tools = {
return Math.ceil((pastDaysOfYear + startOfYear.getDay() + 1) / 7);
},
getmenuByPath(path: string) {
const myroutes = static_data.routes;
getmenuByPath(path: string): IListRoutes | undefined {
if (!path) return undefined;
const normalizedPath = tools.norm(path);
const norm = path
? (path.startsWith('/') ? path : `/${path}`).trim().toLowerCase()
: undefined;
function searchMenu(routes: IListRoutes[]): IListRoutes | undefined {
for (const route of routes) {
if (!route) continue;
const mymenus = myroutes.find((menu: any) => menu.path === norm);
if (tools.norm(route.path) === normalizedPath) return route;
if (Array.isArray(route.routes2)) {
const found = searchMenu(route.routes2);
if (found) return found;
}
}
return undefined;
}
// console.log('mymenus', mymenus, 'path', path, 'norm', norm);
return mymenus;
return searchMenu(static_data.routes);
},
norm(path?: string): string | undefined {
return typeof path === 'string'
? path
@@ -11219,7 +11277,7 @@ export const tools = {
try {
return /Telegram/.test(navigator.userAgent);
} catch (e) {
return false
return false;
}
},
// FINE !