- Add saldo to member's list
This commit is contained in:
@@ -7,6 +7,10 @@ import { useI18n } from '@/boot/i18n'
|
||||
export default defineComponent({
|
||||
name: 'CCurrencyValue',
|
||||
props: {
|
||||
small: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
label: {
|
||||
type: String,
|
||||
required: false,
|
||||
|
||||
@@ -1,22 +1,35 @@
|
||||
<template>
|
||||
<div v-if="value !== null" :class="`text-h5 bordo_stondato_stretto full-width`"
|
||||
:style="(!$q.screen.lt.sm ? `min-width: 250px; ` : ``) + (color_border ? `border-color: ` + color_border + `!important;`: '')">
|
||||
<div class="text-center text-h7-dense text-italic text-grey-14">
|
||||
{{ label }}
|
||||
</div>
|
||||
<div>
|
||||
<q-field
|
||||
dense
|
||||
borderless
|
||||
:readonly="readonly"
|
||||
type="number"
|
||||
rounded
|
||||
class="q-px-sm text-h5"
|
||||
color="green"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<div v-if="small">
|
||||
<q-chip
|
||||
dense class="cltexth4 chipbooked shadow-5 q-pa-sm2"
|
||||
size="md"
|
||||
:color="value > 0 ? `green` : value === 0 ? `gray` : `red`" text-color="white"
|
||||
icon="fas fa-coins">
|
||||
{{ tools.roundDec2(value) }} <span class="text-currency"> <em class="q-pa-xxs text-white rounded-borders shadow-2" :style="`background-color: ` + (color ? color : '#ff5500')">{{ symbol }}</em></span>
|
||||
</q-chip>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="value !== null" :class="`text-h5 ` + small ? `bordo_stondato_small`: `bordo_stondato_stretto` + ` full-width`"
|
||||
:style="(!$q.screen.lt.sm && !small ? `min-width: 250px; ` : small ? ` max-width: 120px;` : ``) + (color_border ? `border-color: ` + color_border + `!important;`: '')">
|
||||
<div class="text-center text-h7-dense text-italic text-grey-14">
|
||||
<span v-if="small">
|
||||
<em class="q-px-xs text-white rounded-borders" :style="`background-color: ` + (color ? color : '#ff5500')">{{ symbol }}</em>
|
||||
</span>
|
||||
<span v-else>{{ label }}</span>
|
||||
</div>
|
||||
<div>
|
||||
<q-field
|
||||
dense
|
||||
borderless
|
||||
:readonly="readonly"
|
||||
type="number"
|
||||
rounded
|
||||
:class="!small ? `q-px-sm text-h5`: `q-px-xs text-h7`"
|
||||
:color="value > 0 ? `green` : `red`"
|
||||
>
|
||||
<template v-slot:prepend>
|
||||
<!--<img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg">-->
|
||||
<q-btn v-if="tips"
|
||||
<q-btn v-if="tips && !small"
|
||||
icon="fas fa-info"
|
||||
color="primary" text-color="white"
|
||||
round
|
||||
@@ -25,22 +38,23 @@
|
||||
>
|
||||
|
||||
</q-btn>
|
||||
<q-icon v-else name="fas fa-coins" size="sm"/>
|
||||
</template>
|
||||
<template v-slot:control>
|
||||
<div class="align_elem_right">{{valueextra}}{{ tools.roundDec2(value) }}
|
||||
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{tips}}</q-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:append>
|
||||
<div class="text-h5">
|
||||
<em class="q-px-sm text-white rounded-borders" :style="`background-color: ` + (color ? color : '#ff5500')">{{ symbol }}</em>
|
||||
</div>
|
||||
</template>
|
||||
<q-icon v-else name="fas fa-coins" :size="small ? `xs`: `sm`"/>
|
||||
</template>
|
||||
<template v-slot:control>
|
||||
<div :class="`align_elem_right `+ small ? `text-h7` : ``">{{ valueextra }}{{ tools.roundDec2(value) }}
|
||||
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{ tips }}</q-tooltip>
|
||||
</div>
|
||||
</template>
|
||||
<template v-slot:append>
|
||||
<div v-if="!small" :class="small ? `text-h7-dense` : `text-h5`">
|
||||
<em class="q-px-sm text-white rounded-borders" :style="`background-color: ` + (color ? color : '#ff5500')">{{ symbol }}</em>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
</q-field>
|
||||
</div>
|
||||
|
||||
</q-field>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
||||
@@ -168,6 +168,13 @@ export default defineComponent({
|
||||
return []
|
||||
}
|
||||
},
|
||||
filterextra: {
|
||||
type: Array,
|
||||
required: false,
|
||||
default: () => {
|
||||
return []
|
||||
}
|
||||
},
|
||||
extraparams: {
|
||||
required: false,
|
||||
default: {},
|
||||
@@ -763,6 +770,8 @@ export default defineComponent({
|
||||
// @ts-ignore
|
||||
filtercustom,
|
||||
// @ts-ignore
|
||||
filterextra: props.filterextra,
|
||||
// @ts-ignore
|
||||
filter_gte,
|
||||
sortBy: myobj,
|
||||
descending,
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<q-chip
|
||||
v-if="circuit.status !== undefined && circuit.status !== 0" :color="circuitStore.getColorCircuitClass(circuit)"
|
||||
text-color="white"
|
||||
size="md"
|
||||
size="sm"
|
||||
:icon="globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'icon')">{{
|
||||
globalStore.getValueByTableSingle('statuscircuit', circuit.status)
|
||||
}}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
<q-chip
|
||||
v-if="circuit.status !== undefined && circuit.status !== 0" :color="circuitStore.getColorCircuitClass(circuit)"
|
||||
text-color="white"
|
||||
size="md"
|
||||
size="sm"
|
||||
:icon="globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'icon')">{{ globalStore.getValueByTableSingle('statuscircuit', circuit.status) }}
|
||||
<q-btn
|
||||
class="q-ml-sm"
|
||||
|
||||
@@ -1,17 +1,19 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { IImgGallery, IUserFields, IUserProfile } from 'model'
|
||||
import { ICircuit, IImgGallery, IUserFields, IUserProfile } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { CSendCoins } from '@/components/CSendCoins'
|
||||
import { CSaldo } from '@/components/CSaldo'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyUser',
|
||||
components: { CSendCoins },
|
||||
components: { CSendCoins, CSaldo },
|
||||
emits: ['setCmd'],
|
||||
props: {
|
||||
mycontact: {
|
||||
@@ -63,6 +65,7 @@ export default defineComponent({
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
@@ -72,6 +75,7 @@ export default defineComponent({
|
||||
const showsendCoinTo = ref(false)
|
||||
|
||||
const contact = ref(<IUserFields | null>null)
|
||||
const circuit = ref(<ICircuit | null | undefined>null)
|
||||
|
||||
watch(() => props.mycontact, (newval, oldval) => {
|
||||
console.log('watch: mycontact')
|
||||
@@ -91,6 +95,8 @@ export default defineComponent({
|
||||
username.value = props.mycontact.username
|
||||
}
|
||||
}
|
||||
|
||||
circuit.value = circuitStore.getCircuitByName(props.circuitname)
|
||||
}
|
||||
|
||||
function getImgUser(profile: IUserFields) {
|
||||
@@ -121,6 +127,7 @@ export default defineComponent({
|
||||
userStore,
|
||||
tools,
|
||||
showsendCoinTo,
|
||||
circuit,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -15,9 +15,21 @@
|
||||
<q-item-label v-if="contact.profile" caption lines="1"><em>{{ contact.profile.qualifica }}</em></q-item-label>
|
||||
<q-item-label caption lines="1"></q-item-label>
|
||||
<q-item-label v-if="labelFooter" lines="1"><em>{{ labelFooter }}</em></q-item-label>
|
||||
<q-item-label v-if="contact.account" caption lines="2">
|
||||
<CSaldo
|
||||
:small="true"
|
||||
:account="contact.account"
|
||||
:symbol="tools.getSymbolByCircuit(circuit)"
|
||||
:color="tools.getColorByCircuit(circuit)"
|
||||
:saldo="contact.account.saldo"
|
||||
>
|
||||
</CSaldo>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side>
|
||||
|
||||
|
||||
<q-btn
|
||||
v-if="userStore.IsMyCircuitByUser(contact).length > 0 && contact.username !== userStore.my.username"
|
||||
icon="fas fa-coins"
|
||||
|
||||
@@ -13,6 +13,10 @@ import { colTableNotifCoins } from '@store/Modules/fieldsTable'
|
||||
export default defineComponent({
|
||||
name: 'CSaldo',
|
||||
props: {
|
||||
small: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
symbol: {
|
||||
type: String,
|
||||
required: true,
|
||||
|
||||
@@ -1,17 +1,27 @@
|
||||
<template>
|
||||
|
||||
<CCurrencyValue
|
||||
v-if="small"
|
||||
:small="true"
|
||||
:symbol="symbol"
|
||||
:color_border="saldo > 0 ? `green` : `red`"
|
||||
:color="color"
|
||||
:value="saldo"
|
||||
:label="t('account.saldo')">
|
||||
</CCurrencyValue>
|
||||
<CCurrencyValue
|
||||
v-else
|
||||
:symbol="symbol"
|
||||
:tips="t('account.saldo_tips', {fido: qtarem, symbol})"
|
||||
:color="color"
|
||||
:value="saldo"
|
||||
:valueextra="account && account.notifspending.length > 0 ? `* `: ''"
|
||||
:valueextra="account && account.notifspending && account.notifspending.length > 0 ? `* `: ''"
|
||||
:label="t('account.saldo') + ` (` + t('account.dispon') + `: ` + qtarem + `)`">
|
||||
|
||||
</CCurrencyValue>
|
||||
|
||||
|
||||
<div v-if="account && account.notifspending.length > 0" :class="`text-h5 bordo_stondato_stretto full-width`"
|
||||
<div v-if="!small && account && account.notifspending && account.notifspending.length > 0" :class="`text-h5 bordo_stondato_stretto full-width`"
|
||||
:style="(!$q.screen.lt.sm ? `min-width: 250px; ` : ``) + (color_border ? `border-color: ` + color_border + `!important;`: '')">
|
||||
<div class="text-center text-h7-dense text-italic text-grey-14">
|
||||
{{ t('movement.pendingtransaction') }}
|
||||
|
||||
@@ -281,7 +281,6 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function myRuleEmail(val: string) {
|
||||
|
||||
return new Promise((resolve, reject) => {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
</q-banner>
|
||||
|
||||
<div class="row q-ma-sm q-pa-sm justify-center">
|
||||
<q-btn class="q-ma-sm" color="primary" icon="fas fa-home" label="Vai alla Home" to="/"></q-btn>
|
||||
<q-btn class="q-ma-sm" color="primary" icon="fas fa-home" label="Vai alla Home" to="/"></q-btn>
|
||||
|
||||
<q-btn class="q-ma-sm" color="accent" icon="fas fa-sign" label="Voglio vedere la pagina di Registrazione" @click="visureg = true"></q-btn>
|
||||
<br>
|
||||
|
||||
Reference in New Issue
Block a user