Visu Sent Monete
This commit is contained in:
@@ -12,7 +12,7 @@ import {
|
||||
ITodo,
|
||||
IUserFields,
|
||||
Privacy,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin, IMovement, IMovVisu,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin, IMovement, IMovVisu, INotif,
|
||||
} from '@model'
|
||||
|
||||
import { addToDate } from '@quasar/quasar-ui-qcalendar'
|
||||
@@ -3365,7 +3365,7 @@ export const tools = {
|
||||
return 'primary'
|
||||
},
|
||||
|
||||
convstrToNum(myval: any) {
|
||||
convstrToNum(myval: any): number {
|
||||
|
||||
if (typeof myval == 'number' && !isNaN(myval)) {
|
||||
if (Number.isInteger(myval)) {
|
||||
@@ -3375,6 +3375,7 @@ export const tools = {
|
||||
return parseFloat(myval)
|
||||
}
|
||||
}
|
||||
return parseFloat(myval)
|
||||
},
|
||||
|
||||
getCookie(mytok: any, def?: any, convertint: any = false) {
|
||||
@@ -4787,10 +4788,11 @@ export const tools = {
|
||||
},
|
||||
|
||||
|
||||
acceptCoins($q: any, username: string, recsendcoin: ISendCoin) {
|
||||
acceptCoins($q: any, username: string, notif: any) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
userStore.setCircuitCmd($q, t, username, recsendcoin.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_ACCEPT, 0, recsendcoin)
|
||||
notif.extrarec.notifId = notif._id
|
||||
userStore.setCircuitCmd($q, t, username, notif.extrarec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_ACCEPT, 0, notif.extrarec)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
if (res.cansend) {
|
||||
@@ -5265,7 +5267,7 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
sendCoinsByCircuit($q: any, circuit: ICircuit, sendcoinrec: ISendCoin): any {
|
||||
async sendCoinsByCircuit($q: any, circuit: ICircuit, sendcoinrec: ISendCoin) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -5274,7 +5276,7 @@ export const tools = {
|
||||
let msg = ''
|
||||
msg = t('circuit.question_sendcoinsto', { coin: circuit.symbol, dest: sendcoinrec.dest, qty: sendcoinrec.qty })
|
||||
|
||||
$q.dialog({
|
||||
return $q.dialog({
|
||||
message: msg,
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
@@ -5288,7 +5290,11 @@ export const tools = {
|
||||
|
||||
return userStore.setCircuitCmd($q, t, username, sendcoinrec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_REQ, true, sendcoinrec)
|
||||
.then((res: any) => {
|
||||
if (res.cansend) {
|
||||
console.log('setCircuitCmd ', res)
|
||||
if (res && res.cansend) {
|
||||
if (res.useraccounts && res.useraccounts.length > 0) {
|
||||
userStore.my.profile.useraccounts = res.useraccounts
|
||||
}
|
||||
tools.showPositiveNotif($q, t('circuit.coins_sendrequest_sent'))
|
||||
} else {
|
||||
tools.showNegativeNotif($q, res.errormsg)
|
||||
@@ -5296,7 +5302,9 @@ export const tools = {
|
||||
})
|
||||
})
|
||||
|
||||
return null
|
||||
return await new Promise((resolve, reject) => {
|
||||
resolve(false)
|
||||
})
|
||||
},
|
||||
|
||||
cancelReqCircuit($q: any, username: string, circuitname: string) {
|
||||
@@ -6311,11 +6319,11 @@ export const tools = {
|
||||
return ''
|
||||
}
|
||||
},
|
||||
getRemainingCoinsToSend(account: IAccount) {
|
||||
return account.saldo + account.fidoConcesso;
|
||||
roundDec2(mynum: number): number {
|
||||
return (Math.round(mynum * 100)/100);
|
||||
},
|
||||
getMaxCoinsToSend(account: IAccount) {
|
||||
return account.qta_maxConcessa - account.saldo;
|
||||
roundDec2Str(mynum: number): string {
|
||||
return (Math.round(mynum * 100)/100).toFixed(2);
|
||||
},
|
||||
// getLocale() {
|
||||
// if (navigator.languages && navigator.languages.length > 0) {
|
||||
|
||||
Reference in New Issue
Block a user