- Invia e Ricevi RIS (grafica aggiornata)
- Visualizzazione Movimenti (ultimi e successivi), per singolo e di tutti
This commit is contained in:
@@ -29,6 +29,10 @@ export const costanti = {
|
||||
ENABLE_FRIENDS: false,
|
||||
ENABLE_CONTI_COLLETTIVI: true,
|
||||
|
||||
ACTIONTYPE: {
|
||||
NONE: 0,
|
||||
SEND_RIS: 1,
|
||||
},
|
||||
|
||||
Lang: {
|
||||
IT: 1,
|
||||
|
||||
@@ -3598,11 +3598,11 @@ export const tools = {
|
||||
if (!this.isMobile())
|
||||
// if (globalStore.leftDrawerOpen)
|
||||
// myw -= 300
|
||||
if (!this.isMobile())
|
||||
// if (globalStore.rightDrawerOpen)
|
||||
// myw -= 300
|
||||
if (!this.isMobile())
|
||||
// if (globalStore.rightDrawerOpen)
|
||||
// myw -= 300
|
||||
|
||||
maxh2 = (myw / coeff) + 20
|
||||
maxh2 = (myw / coeff) + 20
|
||||
if (maxh2 > 500)
|
||||
maxh2 = 500
|
||||
|
||||
@@ -4208,7 +4208,7 @@ export const tools = {
|
||||
if (withright)
|
||||
//if (globalStore.rightDrawerOpen)
|
||||
// myw -= 300
|
||||
return myw
|
||||
return myw
|
||||
|
||||
},
|
||||
|
||||
@@ -7356,7 +7356,7 @@ export const tools = {
|
||||
// console.log('arrimage', arrimage)
|
||||
|
||||
if (shared_consts.TABLES_IMAGEFILE_SINGOLO.includes(table)) {
|
||||
return costanti.DIR_UPLOAD + `products/` + imagefile
|
||||
return costanti.DIR_UPLOAD + `products/` + imagefile
|
||||
}
|
||||
return imagefile
|
||||
},
|
||||
@@ -8148,19 +8148,20 @@ export const tools = {
|
||||
return link
|
||||
},
|
||||
|
||||
async receiveRis($q: any, t: any) {
|
||||
async addToTemporaryReceiverRIS(t: any) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
let username = userStore.my.username
|
||||
|
||||
await userStore.setUserReceiveRIS(username, '').then((data) => {
|
||||
if (data.code === serv_constants.RIS_CODE_OK) {
|
||||
this.showPositiveNotif($q, t('circuit.coins_requestedris', { username }), 6000)
|
||||
} else {
|
||||
this.showNegativeNotif($q, t('db.recfailed'))
|
||||
}
|
||||
return await userStore.setUserReceiveRIS(username, '')
|
||||
.then((data) => {
|
||||
if (data.code === serv_constants.RIS_CODE_OK) {
|
||||
return { msg: t('circuit.coins_requestedris', { username }), ris: true }
|
||||
} else {
|
||||
return { msg: t('db.recfailed'), ris: false }
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
@@ -8519,10 +8520,6 @@ export const tools = {
|
||||
return Object.keys(obj).length === 0;
|
||||
},
|
||||
|
||||
strToVal(mystr: string) {
|
||||
return parseInt(mystr)
|
||||
},
|
||||
|
||||
pad(value: any) {
|
||||
// Helper function to pad single-digit values with leading zeros
|
||||
return value < 10 ? `0${value}` : value;
|
||||
@@ -9018,7 +9015,7 @@ export const tools = {
|
||||
if (mov.userfrom) {
|
||||
mystrfrom = mov.userfrom.username
|
||||
}
|
||||
|
||||
|
||||
return mystrfrom
|
||||
} else {
|
||||
|
||||
@@ -9034,7 +9031,7 @@ export const tools = {
|
||||
|
||||
return mystrto
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
|
||||
getTitleAnnuncio(table: string) {
|
||||
@@ -9060,6 +9057,33 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
isNumeric(value: any) {
|
||||
// Controlla se il valore è un numero e non è NaN (Not-a-Number)
|
||||
return typeof value === 'number' && !isNaN(value) ||
|
||||
typeof value === 'string' && value.trim() !== '' && !isNaN(Number(value));
|
||||
},
|
||||
|
||||
strToVal(mystr: string, abs: boolean = false): number | null {
|
||||
try {
|
||||
if (this.isNumeric(mystr)) {
|
||||
let num = parseFloat(mystr);
|
||||
if (num) {
|
||||
num = Math.abs(num)
|
||||
}
|
||||
return num
|
||||
} else {
|
||||
return null
|
||||
}
|
||||
} catch (e) {
|
||||
return null
|
||||
}
|
||||
},
|
||||
|
||||
convertStringToUrl(str: string) {
|
||||
return encodeURIComponent(str); // Codifica la stringa per URL
|
||||
}
|
||||
|
||||
|
||||
// FINE !
|
||||
|
||||
// getLocale() {
|
||||
|
||||
@@ -676,6 +676,33 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return tools.getUrlSite() + '/registrati/' + username
|
||||
},
|
||||
|
||||
getLinkProfile(username: string): string {
|
||||
if (username === '')
|
||||
username = this.my.username
|
||||
return tools.getUrlSite() + '/my/' + username
|
||||
},
|
||||
|
||||
getLinkProfileAndRIS(username: string, qtyris: string, causale: string = ''): string {
|
||||
|
||||
let myparams = ''
|
||||
if (username === '')
|
||||
username = this.my.username
|
||||
let mylink = tools.getUrlSite() + '/my/' + username
|
||||
|
||||
let myval = tools.strToVal(qtyris, true)
|
||||
if (myval !== null) {
|
||||
if (myparams)
|
||||
myparams += `&`
|
||||
myparams += `sr=${myval}`
|
||||
}
|
||||
if (causale) {
|
||||
if (myparams)
|
||||
myparams += `&`
|
||||
myparams += `cd=${tools.convertStringToUrl(causale)}`
|
||||
}
|
||||
return mylink + (myparams ? '?' + myparams : '')
|
||||
},
|
||||
|
||||
isTelegIdOk(): boolean {
|
||||
return (this.my.profile.teleg_id! > 0 || this.my.profile.teleg_id_old! > 0)
|
||||
},
|
||||
|
||||
@@ -2258,6 +2258,19 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
})
|
||||
},
|
||||
|
||||
async loadLastMovements(nummov: number) {
|
||||
return Api.SendReq('/users/lastmovs', 'POST', {nummov})
|
||||
.then((res) => {
|
||||
if (res.data && res.data.last_transactions && this.datastat) {
|
||||
this.datastat.last_transactions = res.data.last_transactions
|
||||
}
|
||||
}).catch((error) => {
|
||||
return {}
|
||||
})
|
||||
|
||||
},
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user