go on Conto Comunitario
This commit is contained in:
@@ -38,6 +38,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
to_contocom: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
from_group: {
|
||||
type: Object as PropType<IMyGroup>,
|
||||
required: false,
|
||||
@@ -123,6 +128,9 @@ export default defineComponent({
|
||||
arrGroupsList.value.push({ label: group.groupname, value: group.groupname });
|
||||
}
|
||||
|
||||
if (tools.iAmAdminCircuit(circuitloaded.value.name))
|
||||
arrGroupsList.value.push({ label: circuitloaded.value.name, value: circuitloaded.value.path });
|
||||
|
||||
// accountdest.value = userStore.getAccountByCircuitId(circuitloaded.value._id)
|
||||
if (accountloaded.value) {
|
||||
remainingCoins.value = circuitStore.getRemainingCoinsToSend(accountloaded.value)
|
||||
@@ -196,6 +204,19 @@ export default defineComponent({
|
||||
|
||||
aggiorna()
|
||||
|
||||
show.value = true
|
||||
}
|
||||
if (props.to_contocom) {
|
||||
bothcircuits.value = userStore.getMyCircuits()
|
||||
|
||||
console.log('to_contocom', props.to_contocom)
|
||||
circuitsel.value = props.circuitname
|
||||
if (!userStore.IsMyCircuitByName(circuitsel.value)) {
|
||||
circuitsel.value = bothcircuits.value[0]
|
||||
}
|
||||
|
||||
aggiorna()
|
||||
|
||||
show.value = true
|
||||
}
|
||||
}
|
||||
@@ -205,9 +226,12 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
function sendCoin() {
|
||||
console.log('sendcoin', qty.value, props.to_group ? props.to_group.groupname : props.to_user.username)
|
||||
console.log('sendcoin', qty.value, props.to_group ? props.to_group.groupname : (props.to_user ? props.to_user.username : props.to_contocom))
|
||||
|
||||
let ok = (props.to_user && props.to_user.username) ||
|
||||
(props.to_group && props.to_group.groupname) ||
|
||||
(props.to_contocom)
|
||||
|
||||
let ok = (props.to_user && props.to_user.username) || (props.to_group && props.to_group.groupname)
|
||||
|
||||
if (ok && qty.value && circuitloaded.value) {
|
||||
let myrecsendcoin: ISendCoin = {
|
||||
@@ -220,7 +244,7 @@ export default defineComponent({
|
||||
symbol: circuitloaded.value.symbol,
|
||||
}
|
||||
|
||||
myrecsendcoin.groupdest = props.to_group ? props.to_group.groupname : ''
|
||||
myrecsendcoin.groupdest = props.to_group ? props.to_group.groupname : props.to_contocom
|
||||
myrecsendcoin.dest = props.to_user ? props.to_user.username : ''
|
||||
|
||||
myrecsendcoin.grouporig = tipoConto.value === costanti.AccountType.COMMUNITY_ACCOUNT ? from_groupname.value : ''
|
||||
|
||||
@@ -113,6 +113,13 @@
|
||||
:circuitname="circuitloaded.name"
|
||||
>
|
||||
</CMyGroupOnlyView>
|
||||
<CMyGroupOnlyView
|
||||
v-if="circuitloaded && to_contocom"
|
||||
:mygrp="{groupname: to_contocom}"
|
||||
:visu="costanti.USER_GROUPS"
|
||||
:circuitname="circuitloaded.name"
|
||||
>
|
||||
</CMyGroupOnlyView>
|
||||
</q-banner>
|
||||
|
||||
<div v-if="circuitloaded">
|
||||
@@ -208,14 +215,15 @@
|
||||
? qtyRef.hasError || !circuitloaded.transactionsEnabled ||
|
||||
((tipoConto === costanti.AccountType.USER) && to_user && (from_username === to_user.username)) ||
|
||||
((tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT) && !from_groupname) ||
|
||||
((tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT) && to_group && from_groupname && (to_group.groupname === from_groupname))
|
||||
((tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT) && to_group && from_groupname && (to_group.groupname === from_groupname)) ||
|
||||
((tipoConto === costanti.AccountType.COMMUNITY_ACCOUNT) && !to_contocom)
|
||||
: false
|
||||
"
|
||||
:label="
|
||||
$t('circuit.sendcoinsto', {
|
||||
qty,
|
||||
coin: circuitsel,
|
||||
dest: to_group ? to_group.groupname : to_user.username,
|
||||
dest: to_group ? to_group.groupname : (to_user ? to_user.username : to_contocom),
|
||||
})
|
||||
"
|
||||
color="positive"
|
||||
|
||||
Reference in New Issue
Block a user