- Visu Saldo su Home

- SendRisTo
- Movimenti conto Comunitario
- Profilo
This commit is contained in:
Surya Paolo
2023-03-17 19:07:43 +01:00
parent 37c2f08510
commit af04e022eb
35 changed files with 393 additions and 98 deletions

View File

@@ -18,7 +18,7 @@ import { useCircuitStore } from '@store/CircuitStore'
export default defineComponent({
name: 'CUserInfoAccount',
emits: ['setCmd'],
components: {CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue, CCurrencyV2 },
components: { CUserNonVerif, CSaldo, CSendCoins, CCurrencyValue, CCurrencyV2 },
props: {
user: {
type: Object as PropType<IUserFields>,
@@ -29,11 +29,21 @@ export default defineComponent({
required: false,
default: '',
},
circuitpath: {
type: String,
required: false,
default: '',
},
admin: {
type: Boolean,
required: false,
default: false,
},
onlysaldo: {
type: Boolean,
required: false,
default: false,
},
account: {
type: Object as PropType<IAccount>,
required: false,
@@ -48,7 +58,7 @@ export default defineComponent({
const { t } = useI18n()
const $router = useRouter()
const myaccount = ref(<IAccount|undefined>undefined)
const myaccount = ref(<IAccount | undefined>undefined)
const circuitStore = useCircuitStore()
@@ -60,13 +70,28 @@ export default defineComponent({
mounted()
})
watch(() => tools.isUserOk(), (newval, oldval) => {
if (userStore.isUserOk()) {
mounted()
}
})
function mounted() {
circuit.value = circuitStore.getCircuitByName(props.circuitname)
if (props.circuitname)
circuit.value = circuitStore.getCircuitByName(props.circuitname)
else if (props.circuitpath) {
circuit.value = circuitStore.getCircuitByPath(props.circuitpath)
}
if (props.account) {
myaccount.value = props.account
} else {
myaccount.value = props.user.account
if (props.user.account) {
myaccount.value = props.user.account
} else {
if (circuit.value)
myaccount.value = userStore.getAccountByCircuitId(circuit.value._id)
}
}
}