Conto Comunitario...
This commit is contained in:
@@ -11,7 +11,13 @@ import { CRegistration } from '@/components/CRegistration'
|
||||
export default defineComponent({
|
||||
name: 'CCheckIfIsLogged',
|
||||
components: { CRegistration },
|
||||
props: {},
|
||||
props: {
|
||||
showalways: {
|
||||
type: Boolean,
|
||||
required: true,
|
||||
default: false,
|
||||
},
|
||||
},
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<template>
|
||||
<div v-if="!tools.isLogged()">
|
||||
<div v-if="showalways || (!showalways && !tools.isLogged())">
|
||||
<div class="q-pa-md q-gutter-sm">
|
||||
<div id="logo" class="text-center">
|
||||
<q-img
|
||||
|
||||
@@ -974,6 +974,16 @@
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CHECK_EMAIL"></div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CHECKIFISLOGGED">
|
||||
<q-select
|
||||
v-model="myel.container"
|
||||
:options="[{label: 'Mostra Sempre', value: true, label: 'Solo se Offline', value: false}]"
|
||||
label="Quando mostrarlo"
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
</q-select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
|
||||
@@ -478,7 +478,7 @@
|
||||
</div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.CHECKIFISLOGGED">
|
||||
<div v-if="editOn" class="elemEdit">CCheckIfIsLogged</div>
|
||||
<CCheckIfIsLogged></CCheckIfIsLogged>
|
||||
<CCheckIfIsLogged :showalways="myel.container"></CCheckIfIsLogged>
|
||||
</div>
|
||||
<div v-else-if="myel.type === shared_consts.ELEMTYPE.INFO_VERSION">
|
||||
<div>Versione: {{ tools.getvers() }}</div>
|
||||
|
||||
@@ -95,22 +95,24 @@ export default defineComponent({
|
||||
const mybutt = []
|
||||
mybutt.push({ label: t('mypages.find_people'), value: costanti.FIND_PEOPLE })
|
||||
|
||||
if (costanti.ENABLE_FRIENDS) {
|
||||
if (numFriends.value > 0 || props.modelValue === costanti.FRIENDS)
|
||||
mybutt.push({ label: t('mypages.friends') + ' (' + numFriends.value + ')', value: costanti.FRIENDS })
|
||||
|
||||
if (numReqFriends.value > 0 || props.modelValue === costanti.REQ_FRIENDS)
|
||||
mybutt.push({
|
||||
label: t('mypages.request_friends') + ' (' + numReqFriends.value + ')',
|
||||
value: costanti.REQ_FRIENDS
|
||||
})
|
||||
if (numHandShake.value > 0 || props.modelValue === costanti.HANDSHAKE)
|
||||
mybutt.push({ label: t('mypages.handshake') + ' (' + numHandShake.value + ')', value: costanti.HANDSHAKE })
|
||||
|
||||
if (numAskSentFriends.value > 0 || props.modelValue === costanti.ASK_SENT_FRIENDS)
|
||||
mybutt.push({
|
||||
label: t('mypages.request_sent') + ' (' + numAskSentFriends.value + ')',
|
||||
value: costanti.ASK_SENT_FRIENDS
|
||||
})
|
||||
}
|
||||
|
||||
if (numHandShake.value > 0 || props.modelValue === costanti.HANDSHAKE)
|
||||
mybutt.push({ label: t('mypages.handshake') + ' (' + numHandShake.value + ')', value: costanti.HANDSHAKE })
|
||||
|
||||
if (numAskTrust.value > 0 || props.modelValue === costanti.ASK_TRUST)
|
||||
mybutt.push({ label: t('mypages.request_trust') + ' (' + numAskTrust.value + ')', value: costanti.ASK_TRUST })
|
||||
if (numTrusted.value > 0 || props.modelValue === costanti.TRUSTED)
|
||||
|
||||
@@ -42,6 +42,7 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
4
src/components/CMyGroupOnlyView/CMyGroupOnlyView.scss
Executable file
4
src/components/CMyGroupOnlyView/CMyGroupOnlyView.scss
Executable file
@@ -0,0 +1,4 @@
|
||||
.myflex{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
122
src/components/CMyGroupOnlyView/CMyGroupOnlyView.ts
Executable file
122
src/components/CMyGroupOnlyView/CMyGroupOnlyView.ts
Executable file
@@ -0,0 +1,122 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { IMyGroup, IImgGallery, IUserFields, IUserProfile, IFriends, ICircuit, IAccount } from 'model'
|
||||
import { costanti } from '@costanti'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyGroupOnlyView',
|
||||
emits: ['setCmd'],
|
||||
components: {},
|
||||
props: {
|
||||
mygrp: {
|
||||
type: Object as PropType<IMyGroup | null>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
mygroupname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
visu: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
circuitname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
noaut: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
labelextra: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
const $route = useRoute()
|
||||
|
||||
const groupname = ref('')
|
||||
const circuitStore = useCircuitStore()
|
||||
|
||||
const showsendCoinTo = ref(false)
|
||||
|
||||
const grp = ref(<IMyGroup | null>null)
|
||||
|
||||
const table = ref(toolsext.TABMYGROUPS)
|
||||
|
||||
const circuit = ref(<ICircuit | null | undefined>null)
|
||||
|
||||
watch(() => props.mygrp, (newval, oldval) => {
|
||||
mounted()
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
if (!props.mygrp) {
|
||||
if (props.mygroupname) {
|
||||
groupname.value = props.mygroupname
|
||||
//++Todo: carica contact
|
||||
grp.value = null
|
||||
}
|
||||
} else {
|
||||
if (props.mygrp) {
|
||||
grp.value = props.mygrp
|
||||
groupname.value = props.mygrp.groupname
|
||||
}
|
||||
}
|
||||
circuit.value = circuitStore.getCircuitByName(props.circuitname)
|
||||
}
|
||||
|
||||
function getImgGroup(group: IMyGroup) {
|
||||
return userStore.getImgByGroup(group)
|
||||
}
|
||||
|
||||
function naviga(path: string) {
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
function setCmd(cmd: number, myusername: string, value: any = '') {
|
||||
emit('setCmd', cmd, myusername, value)
|
||||
}
|
||||
|
||||
function myusername() {
|
||||
return userStore.my.username
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
grp,
|
||||
costanti,
|
||||
getImgGroup,
|
||||
naviga,
|
||||
setCmd,
|
||||
shared_consts,
|
||||
userStore,
|
||||
tools,
|
||||
table,
|
||||
myusername,
|
||||
circuit,
|
||||
showsendCoinTo,
|
||||
}
|
||||
},
|
||||
})
|
||||
41
src/components/CMyGroupOnlyView/CMyGroupOnlyView.vue
Executable file
41
src/components/CMyGroupOnlyView/CMyGroupOnlyView.vue
Executable file
@@ -0,0 +1,41 @@
|
||||
<template>
|
||||
<div v-if="tools.isUserOk()">
|
||||
<div v-if="grp">
|
||||
<q-item class="q-my-sm" clickable>
|
||||
<q-item-section
|
||||
avatar
|
||||
@click="naviga(tools.getPathByGroup(grp, table))"
|
||||
>
|
||||
<q-item-label v-if="labelextra"
|
||||
><strong>{{ labelextra }}</strong></q-item-label
|
||||
>
|
||||
<q-avatar size="60px">
|
||||
<q-img
|
||||
:src="getImgGroup(grp)"
|
||||
:alt="grp.groupname"
|
||||
img-class="imgprofile"
|
||||
height="60px"
|
||||
/>
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section @click="naviga(tools.getPathByGroup(grp, table))">
|
||||
<q-item-label
|
||||
><strong>{{ grp.title }}</strong> ({{ grp.groupname }})
|
||||
</q-item-label>
|
||||
<q-item-label v-if="grp.descr" caption lines="3"
|
||||
><em>{{ grp.descr }}</em></q-item-label
|
||||
>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else></div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyGroupOnlyView.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyGroupOnlyView.scss';
|
||||
</style>
|
||||
1
src/components/CMyGroupOnlyView/index.ts
Executable file
1
src/components/CMyGroupOnlyView/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CMyGroupOnlyView } from './CMyGroupOnlyView.vue'
|
||||
@@ -594,7 +594,7 @@
|
||||
<q-menu>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item
|
||||
v-if="!userStore.IsMyFriendByUsername(contact.username)"
|
||||
v-if="costanti.ENABLE_FRIENDS && !userStore.IsMyFriendByUsername(contact.username)"
|
||||
clickable
|
||||
icon="fas fa-user-plus"
|
||||
v-close-popup
|
||||
@@ -672,6 +672,7 @@
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item
|
||||
v-if="
|
||||
costanti.ENABLE_FRIENDS &&
|
||||
!userStore.IsMyFriendByUsername(contact.username) &&
|
||||
!userStore.IsAskedFriendByUsername(contact.username)
|
||||
"
|
||||
@@ -696,6 +697,7 @@
|
||||
</q-item>
|
||||
<q-item
|
||||
v-else-if="
|
||||
costanti.ENABLE_FRIENDS &&
|
||||
!userStore.IsMyFriendByUsername(contact.username) &&
|
||||
userStore.IsAskedFriendByUsername(contact.username)
|
||||
"
|
||||
@@ -719,7 +721,7 @@
|
||||
}}</q-item-section>
|
||||
</q-item>
|
||||
<q-item
|
||||
v-else-if="userStore.IsMyFriendByUsername(contact.username)"
|
||||
v-else-if="costanti.ENABLE_FRIENDS && userStore.IsMyFriendByUsername(contact.username)"
|
||||
style="min-width: 200px"
|
||||
clickable
|
||||
v-close-popup
|
||||
|
||||
@@ -8,6 +8,7 @@ import { useCircuitStore } from '@store/CircuitStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { CMyUserOnlyView } from '@/components/CMyUserOnlyView'
|
||||
import { CMyGroupOnlyView } from '@/components/CMyGroupOnlyView'
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
export default defineComponent({
|
||||
@@ -22,6 +23,11 @@ export default defineComponent({
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
qtydefault: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '1'
|
||||
},
|
||||
to_user: {
|
||||
type: Object as PropType<IUserFields>,
|
||||
required: false,
|
||||
@@ -38,7 +44,7 @@ export default defineComponent({
|
||||
default: null,
|
||||
},
|
||||
},
|
||||
components: { CSaldo, CMyUserOnlyView },
|
||||
components: { CSaldo, CMyUserOnlyView, CMyGroupOnlyView },
|
||||
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
@@ -48,18 +54,22 @@ export default defineComponent({
|
||||
const circuitStore = useCircuitStore()
|
||||
|
||||
const from_username = ref(userStore.my.username)
|
||||
const from_groupname = ref('')
|
||||
const circuitsel = ref('')
|
||||
const qty = ref(<string | number>'')
|
||||
const causal = ref('')
|
||||
const bothcircuits = ref(<any>[])
|
||||
|
||||
const groupSel = ref(<IMyGroup | null | undefined>null)
|
||||
|
||||
const circuitloaded = ref(<ICircuit | undefined>undefined)
|
||||
const circuitdest = ref(<ICircuit | undefined>undefined)
|
||||
const accountloaded = ref(<IAccount | undefined>undefined)
|
||||
const accountloaded = ref(<IAccount | undefined | null>undefined)
|
||||
const accountdest = ref(<IAccount | undefined>undefined)
|
||||
const remainingCoins = ref(0)
|
||||
const maxsendable = ref(0)
|
||||
const numstep = ref(0)
|
||||
const tipoConto = ref(0)
|
||||
|
||||
const priceLabel = computed(() => circuitloaded.value ? `${qty.value} ` + circuitloaded.value.symbol : '')
|
||||
const arrayMarkerLabel = ref(<any>[])
|
||||
@@ -67,20 +77,52 @@ export default defineComponent({
|
||||
const qtyRef = ref(<any>null)
|
||||
const causalRef = ref(<any>null)
|
||||
|
||||
const groupsListAdmin = ref(<IMyGroup[]>[])
|
||||
|
||||
const arrGroupsList = ref(<any[]>[])
|
||||
|
||||
watch(() => circuitsel.value, (newval, oldval) => {
|
||||
tools.setCookie(tools.CIRCUIT_USE, newval)
|
||||
aggiorna()
|
||||
})
|
||||
|
||||
watch(() => tipoConto.value, (newval, oldval) => {
|
||||
aggiorna()
|
||||
})
|
||||
|
||||
watch(() => from_groupname.value, (newval, oldval) => {
|
||||
aggiorna()
|
||||
})
|
||||
|
||||
watch(() => from_username.value, (newval, oldval) => {
|
||||
aggiorna()
|
||||
})
|
||||
|
||||
watch(() => props.showprop, (newval, oldval) => {
|
||||
console.log('props.showprop', props.showprop, newval)
|
||||
show.value = newval
|
||||
})
|
||||
|
||||
function aggiorna() {
|
||||
groupSel.value = null
|
||||
accountloaded.value = null
|
||||
circuitloaded.value = circuitStore.listcircuits.find((rec: ICircuit) => rec.name === circuitsel.value)
|
||||
if (circuitloaded.value) {
|
||||
if (tipoConto.value === costanti.AccountType.USER) {
|
||||
accountloaded.value = userStore.getAccountByCircuitId(circuitloaded.value._id)
|
||||
} else if (tipoConto.value === costanti.AccountType.COMMUNITY_ACCOUNT) {
|
||||
groupSel.value = userStore.my.profile.manage_mygroups.find((group: IMyGroup) => from_groupname.value === group.groupname)
|
||||
accountloaded.value = groupSel.value ? groupSel.value.account : null
|
||||
}
|
||||
|
||||
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin()
|
||||
|
||||
arrGroupsList.value = []
|
||||
|
||||
for (const group of groupsListAdmin.value) {
|
||||
arrGroupsList.value.push({ label: group.groupname, value: group.groupname });
|
||||
}
|
||||
|
||||
// accountdest.value = userStore.getAccountByCircuitId(circuitloaded.value._id)
|
||||
if (accountloaded.value) {
|
||||
remainingCoins.value = circuitStore.getRemainingCoinsToSend(accountloaded.value)
|
||||
@@ -132,6 +174,8 @@ export default defineComponent({
|
||||
circuitsel.value = bothcircuits.value[0]
|
||||
}
|
||||
|
||||
qty.value = props.qtydefault
|
||||
|
||||
aggiorna()
|
||||
|
||||
show.value = true
|
||||
@@ -191,6 +235,8 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -217,6 +263,9 @@ export default defineComponent({
|
||||
numstep,
|
||||
costanti,
|
||||
userStore,
|
||||
tipoConto,
|
||||
arrGroupsList,
|
||||
from_groupname,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-dialog v-model="show" :maximized="$q.screen.lt.sm" @hide="hide" @show="qtyRef ? qtyRef.focus() : ''">
|
||||
<q-dialog
|
||||
v-model="show"
|
||||
:maximized="$q.screen.lt.sm"
|
||||
@hide="hide"
|
||||
@show="qtyRef ? qtyRef.focus() : ''"
|
||||
>
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
@@ -9,9 +14,14 @@
|
||||
<q-btn flat round color="white" icon="close" v-close-popup></q-btn>
|
||||
</q-toolbar>
|
||||
<q-card-section class="q-pa-xs inset-shadow">
|
||||
|
||||
<q-select
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'" rounded outlined v-model="circuitsel" :options="bothcircuits" label="Circuito">
|
||||
:behavior="$q.platform.is.ios === true ? 'dialog' : 'menu'"
|
||||
rounded
|
||||
outlined
|
||||
v-model="circuitsel"
|
||||
:options="bothcircuits"
|
||||
label="Circuito"
|
||||
>
|
||||
</q-select>
|
||||
|
||||
<CSaldo
|
||||
@@ -19,14 +29,58 @@
|
||||
:symbol="circuitloaded.symbol"
|
||||
:color="circuitloaded.color"
|
||||
:saldo="accountloaded ? accountloaded.saldo : 0"
|
||||
:qtarem="accountloaded ? circuitStore.getRemainingCoinsToSend(accountloaded) : 0"
|
||||
:qtarem="
|
||||
accountloaded
|
||||
? circuitStore.getRemainingCoinsToSend(accountloaded)
|
||||
: 0
|
||||
"
|
||||
>
|
||||
|
||||
</CSaldo>
|
||||
|
||||
<q-input v-model="from_username" label="Mittente" class="full-width" readonly>
|
||||
<div>
|
||||
<q-btn-toggle
|
||||
v-model="tipoConto"
|
||||
class="my-custom-toggle"
|
||||
no-caps
|
||||
rounded
|
||||
unelevated
|
||||
toggle-color="primary"
|
||||
color="white"
|
||||
text-color="primary"
|
||||
:options="[
|
||||
{ label: 'Utente', value: costanti.AccountType.USER },
|
||||
{
|
||||
label: 'Conto Comunitario',
|
||||
value: costanti.AccountType.COMMUNITY_ACCOUNT,
|
||||
},
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<q-input
|
||||
v-if="tipoConto === costanti.AccountType.USER"
|
||||
v-model="from_username"
|
||||
label="Mittente"
|
||||
class="full-width"
|
||||
readonly
|
||||
>
|
||||
</q-input>
|
||||
<div v-else>
|
||||
<q-select
|
||||
v-model="from_groupname"
|
||||
:options="arrGroupsList"
|
||||
label="Gruppo"
|
||||
rounded
|
||||
emit-value
|
||||
map-options
|
||||
>
|
||||
<!-- Mostra i gruppi su cui sei Admin -->
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<!-- Destination -->
|
||||
<CMyUserOnlyView
|
||||
v-if="to_user"
|
||||
:mycontact="to_user"
|
||||
:visu="costanti.FIND_PEOPLE"
|
||||
@setCmd="tools.setCmd"
|
||||
@@ -34,39 +88,72 @@
|
||||
>
|
||||
</CMyUserOnlyView>
|
||||
|
||||
<CMyGroupOnlyView v-if="to_group" :mygrp="to_group" :visu="costanti.USER_GROUPS"
|
||||
:circuitname="circuitloaded.name"
|
||||
labelextra="Destinatario">
|
||||
</CMyGroupOnlyView>
|
||||
|
||||
<div v-if="circuitloaded">
|
||||
<q-banner
|
||||
v-if="!circuitloaded.transactionsEnabled"
|
||||
rounded
|
||||
class="bg-red text-white"
|
||||
style="text-align: center;"
|
||||
style="text-align: center"
|
||||
>
|
||||
<em style="font-weight: bold">{{ $t('circuit.transactionsEnabled_text') }}</em><br>
|
||||
<em style="font-weight: bold">{{
|
||||
$t('circuit.transactionsEnabled_text')
|
||||
}}</em
|
||||
><br />
|
||||
</q-banner>
|
||||
|
||||
<q-input
|
||||
ref="qtyRef"
|
||||
class="q-py-sm text-h5"
|
||||
outlined v-model="qty" type="number"
|
||||
outlined
|
||||
v-model="qty"
|
||||
type="number"
|
||||
:rules="[
|
||||
val => val <= circuitStore.getRemainingCoinsToSend(accountloaded) || t('circuit.qta_remaining_to_send', { maxqta: circuitStore.getRemainingCoinsToSend(accountloaded), symbol: circuitloaded.symbol }),
|
||||
val => val > 0 || t('circuit.qta_not_valid')]"
|
||||
:label="t('movement.amount_to_send', {qtamax: circuitStore.getRemainingCoinsToSend(accountloaded) ? circuitStore.getRemainingCoinsToSend(accountloaded).toFixed(2) : 0 + ` ` + circuitloaded.symbol})"
|
||||
(val) =>
|
||||
val <= circuitStore.getRemainingCoinsToSend(accountloaded) ||
|
||||
t('circuit.qta_remaining_to_send', {
|
||||
maxqta: circuitStore.getRemainingCoinsToSend(accountloaded),
|
||||
symbol: circuitloaded.symbol,
|
||||
}),
|
||||
(val) => val > 0 || t('circuit.qta_not_valid'),
|
||||
]"
|
||||
:label="
|
||||
t('movement.amount_to_send', {
|
||||
qtamax: circuitStore.getRemainingCoinsToSend(accountloaded)
|
||||
? circuitStore
|
||||
.getRemainingCoinsToSend(accountloaded)
|
||||
.toFixed(2)
|
||||
: 0 + ` ` + circuitloaded.symbol,
|
||||
})
|
||||
"
|
||||
input-class="text-right"
|
||||
v-on:keyup.enter="$event.target.nextElementSibling.focus()"
|
||||
>
|
||||
<!--val => val > circuitStore.getMaxCoinsToSend(accountloaded) || t('circuit.qta_max_to_send', { maxqta: tools.getRemainingCoinsToSend(accountloaded), symbol: circuitloaded.symbol })]" -->
|
||||
<template v-slot:append>
|
||||
<div class="text-h5">
|
||||
<em class="q-px-sm text-white rounded-borders"
|
||||
:style="`background-color: ` + (circuitloaded.color ? circuitloaded.color : '#ff5500')">{{ circuitloaded.symbol }}</em>
|
||||
<em
|
||||
class="q-px-sm text-white rounded-borders"
|
||||
:style="
|
||||
`background-color: ` +
|
||||
(circuitloaded.color ? circuitloaded.color : '#ff5500')
|
||||
"
|
||||
>{{ circuitloaded.symbol }}</em
|
||||
>
|
||||
</div>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
<q-slider
|
||||
class="q-ma-xs"
|
||||
v-if="(qty !== '') && circuitStore.getRemainingCoinsToSend(accountloaded) > 0"
|
||||
v-if="
|
||||
qty !== '' &&
|
||||
circuitStore.getRemainingCoinsToSend(accountloaded) > 0
|
||||
"
|
||||
v-model="qty"
|
||||
color="green"
|
||||
markers
|
||||
@@ -85,17 +172,36 @@
|
||||
|
||||
<q-input
|
||||
ref="causalRef"
|
||||
v-model="causal" label="Note" class="q-my-sm full-width">
|
||||
v-model="causal"
|
||||
label="Note"
|
||||
class="q-my-sm full-width"
|
||||
>
|
||||
</q-input>
|
||||
|
||||
</q-card-section>
|
||||
<q-card-actions align="center">
|
||||
<q-btn
|
||||
v-if="circuitloaded"
|
||||
:disable="qtyRef ? (qtyRef.hasError || !circuitloaded.transactionsEnabled) : false"
|
||||
:label="$t('circuit.sendcoinsto', {qty, coin: circuitsel, dest: to_group ? to_group.groupname : to_user.username })" color="positive"
|
||||
@click="sendCoin()"></q-btn>
|
||||
<q-btn flat :label="$t('dialog.cancel')" color="primary" v-close-popup></q-btn>
|
||||
:disable="
|
||||
qtyRef
|
||||
? qtyRef.hasError || !circuitloaded.transactionsEnabled
|
||||
: false
|
||||
"
|
||||
:label="
|
||||
$t('circuit.sendcoinsto', {
|
||||
qty,
|
||||
coin: circuitsel,
|
||||
dest: to_group ? to_group.groupname : to_user.username,
|
||||
})
|
||||
"
|
||||
color="positive"
|
||||
@click="sendCoin()"
|
||||
></q-btn>
|
||||
<q-btn
|
||||
flat
|
||||
:label="$t('dialog.cancel')"
|
||||
color="primary"
|
||||
v-close-popup
|
||||
></q-btn>
|
||||
</q-card-actions>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
@@ -41,6 +41,8 @@ export interface IMyGroup {
|
||||
date_blocked?: Date
|
||||
createdBy?: string
|
||||
mycircuits?: IMyCircuit[]
|
||||
|
||||
account?: IAccount
|
||||
}
|
||||
|
||||
export interface ICalcStat {
|
||||
|
||||
@@ -1051,7 +1051,7 @@ const msg_it = {
|
||||
friends: 'Amici',
|
||||
bacheca: 'Bacheca',
|
||||
services: 'Servizi',
|
||||
handshake: 'Strette',
|
||||
handshake: 'Raporti di fiducia',
|
||||
hosp: 'Ospitalità',
|
||||
events: 'Eventi',
|
||||
goods: 'Beni',
|
||||
@@ -1060,7 +1060,7 @@ const msg_it = {
|
||||
request_friends: 'Richieste Amicizia',
|
||||
request_sent: 'Richieste Inviate',
|
||||
request_trust: 'Richieste Fiducia',
|
||||
trusted: 'Fiducia Accettata',
|
||||
trusted: 'Amici inseriti',
|
||||
rejected: 'Rifiutati',
|
||||
provapao: 'Prova pao',
|
||||
circuits: 'Circuiti',
|
||||
|
||||
@@ -17,6 +17,14 @@ export const costanti = {
|
||||
CERCO: 2,
|
||||
},
|
||||
|
||||
ENABLE_FRIENDS: false,
|
||||
ENABLE_CONTI_COMUNITARI: true,
|
||||
|
||||
AccountType: {
|
||||
USER: 0,
|
||||
COMMUNITY_ACCOUNT: 1,
|
||||
},
|
||||
|
||||
Lang: {
|
||||
IT: 1,
|
||||
EN: 2,
|
||||
|
||||
@@ -6543,6 +6543,31 @@ export const tools = {
|
||||
|
||||
},
|
||||
|
||||
getGroupsWhereIAmTheAdminOfTheCircuit(name: string, username: string) {
|
||||
const userStore = useUserStore()
|
||||
|
||||
let arr: any[] = []
|
||||
|
||||
let risultato = false
|
||||
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
const ris = userStore.my.profile.manage_mycircuits.find((circuit: ICircuit) => {
|
||||
if (circuit.name === name) {
|
||||
return true
|
||||
}
|
||||
})
|
||||
// console.log('ris', ris)
|
||||
if (ris && ris.admins) {
|
||||
const isadmin = ris.admins.find((user: IFriends) => user.username === username)
|
||||
risultato = !!isadmin
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return arr
|
||||
|
||||
},
|
||||
|
||||
setCmd($q: any, cmd: number, username: string, value: any, dest: string) {
|
||||
console.log('setcmd', cmd)
|
||||
if (cmd === shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP) {
|
||||
|
||||
@@ -244,20 +244,8 @@ export const useUserStore = defineStore('UserStore', {
|
||||
return false
|
||||
},
|
||||
|
||||
GroupsListWhereIAmAdmin(username: string): string[] {
|
||||
let myarr: any[] = []
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (this.my.profile && globalStore.mygroups) {
|
||||
myarr = globalStore.mygroups.filter((mygroup: IMyGroup) => {
|
||||
if (mygroup.admins && mygroup.admins.findIndex((useradmin: IUserAdmins) => useradmin.username === username) >= 0) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
})
|
||||
}
|
||||
|
||||
return myarr
|
||||
GroupsListWhereIAmAdmin(): IMyGroup[] {
|
||||
return this.my.profile.manage_mygroups
|
||||
},
|
||||
|
||||
IsAskedFriendByUsername(username: string): boolean {
|
||||
|
||||
@@ -20,7 +20,7 @@ import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { CNotifAtTop } from '@src/components/CNotifAtTop'
|
||||
import { costanti } from '@costanti'
|
||||
import { ICity, IFriends, ICircuit, ISearchList, IUserFields, IAccount } from 'model'
|
||||
import { ICity, IFriends, ICircuit, ISearchList, IUserFields, IAccount, IMyGroup } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { colmyUserPeople, colmyUserPeopleSaldi, colmyUserCircuit, colmyMovement, colmyMovementTable } from '@store/Modules/fieldsTable'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
@@ -44,7 +44,7 @@ export default defineComponent({
|
||||
|
||||
const showonlymine = ref(true)
|
||||
const tabellare = ref(false)
|
||||
const groupsListAdmin = ref(<string[]>[])
|
||||
const groupsListAdmin = ref(<IMyGroup[]>[])
|
||||
const groupnameSel = ref('')
|
||||
|
||||
const animation = ref('fade')
|
||||
@@ -267,7 +267,7 @@ export default defineComponent({
|
||||
await loadCircuit()
|
||||
|
||||
if (userStore.my.username)
|
||||
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin(userStore.my.username)
|
||||
groupsListAdmin.value = userStore.GroupsListWhereIAmAdmin()
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@
|
||||
<div>
|
||||
<q-banner
|
||||
v-if="
|
||||
userStore.my.profile.calc.numGoodsAndServices <= 0 &&
|
||||
userStore.my.profile && userStore.my.profile.calc.numGoodsAndServices <= 0 &&
|
||||
userStore.IsMyCircuitByName(circuit.name)
|
||||
"
|
||||
rounded
|
||||
@@ -228,7 +228,7 @@
|
||||
icon="fas fa-file-word"
|
||||
></q-tab>
|
||||
<q-tab
|
||||
v-if="false && tools.iAmAdminCircuit(circuit.name)"
|
||||
v-if="costanti.ENABLE_CONTI_COMUNITARI && tools.iAmAdminCircuit(circuit.name)"
|
||||
:label="t('circuit.gruppicom')"
|
||||
name="gruppicom"
|
||||
icon="fas fa-coins"
|
||||
|
||||
@@ -415,6 +415,7 @@
|
||||
<div
|
||||
class="row centeritems q-ma-sm q-pa-sm"
|
||||
v-if="
|
||||
costanti.ENABLE_FRIENDS &&
|
||||
userStore.IsReqFriendByUsername(
|
||||
userStore.userprofile.username
|
||||
)
|
||||
@@ -449,6 +450,7 @@
|
||||
<div v-else>
|
||||
<q-btn
|
||||
v-if="
|
||||
costanti.ENABLE_FRIENDS &&
|
||||
!userStore.IsMyFriendByUsername(
|
||||
userStore.userprofile.username
|
||||
) &&
|
||||
@@ -507,6 +509,7 @@
|
||||
</q-item>
|
||||
<q-item
|
||||
v-if="
|
||||
costanti.ENABLE_FRIENDS &&
|
||||
userStore.IsMyFriendByUsername(
|
||||
userStore.userprofile.username
|
||||
)
|
||||
@@ -582,6 +585,7 @@
|
||||
|
||||
<q-btn
|
||||
v-if="
|
||||
costanti.ENABLE_FRIENDS &&
|
||||
userStore.IsAskedFriendByUsername(
|
||||
userStore.userprofile.username
|
||||
) &&
|
||||
|
||||
Reference in New Issue
Block a user