ver 0.5.51

This commit is contained in:
Surya Paolo
2023-01-03 16:51:45 +01:00
parent 3f9f608d4e
commit ce4bf65fc4
49 changed files with 1610 additions and 440 deletions

View File

@@ -25,22 +25,24 @@ export default defineComponent({
const deferredPrompt = computed(() => globalStore.deferredPrompt)
function initprompt() {
window.addEventListener('beforeinstallprompt', (event) => {
event.preventDefault()
console.log('beforeinstallprompt !')
// Stash the event so it can be triggered later.
globalStore.deferredPrompt = event
})
}
function installApp() {
if (globalStore.deferredPrompt)
globalStore.deferredPrompt.prompt()
if (globalStore.deferredPrompt) {
globalStore.deferredPrompt.prompt()
// Wait for the user to respond to the prompt
globalStore.deferredPrompt.userChoice.then((choiceResult: any)=>{
if (choiceResult.outcome === 'accepted') {
globalStore.deferredPrompt = null;
// console.log('User accepted the A2HS prompt');
} else {
// console.log('User dismissed the A2HS prompt');
}
});
}
}
function mounted() {
initprompt()
tools.checkApp()
}

View File

@@ -9,8 +9,8 @@
</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 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>
@@ -41,7 +41,7 @@
<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) }}
<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>

View File

@@ -135,8 +135,8 @@ export default defineComponent({
*/
watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => {
updatefilter(value)
},
updatefilter(value)
},
)
const mypagination = computed(() => {
@@ -1115,6 +1115,8 @@ export default defineComponent({
status: 1,
transactionsEnabled: 1,
qta_max_default: 1,
fido_scoperto_default_grp: 1,
qta_max_default_grp: 1,
valuta_per_euro: 1,
symbol: 1,
idCity: 1,
@@ -1239,7 +1241,7 @@ export default defineComponent({
username: 1,
name: 1,
surname: 1,
lasttimeonline: 1,
lasttimeonline: 1,
comune: 1,
mycities: 1,
'profile.img': 1,
@@ -1310,7 +1312,7 @@ lasttimeonline: 1,
username: 1,
name: 1,
surname: 1,
lasttimeonline: 1,
lasttimeonline: 1,
comune: 1,
mycities: 1,
'profile.img': 1,
@@ -1358,7 +1360,7 @@ lasttimeonline: 1,
username: 1,
name: 1,
surname: 1,
lasttimeonline: 1,
lasttimeonline: 1,
comune: 1,
mycities: 1,
'profile.img': 1,

View File

@@ -321,6 +321,7 @@
:offset="350"
debounce="300"
>
<div v-if="showHeaderCol">
<div
v-for="col in mycolumns"
@@ -417,15 +418,16 @@
</div>
<div
v-else-if="
(showType === costanti.SHOW_GROUPINFO &&
((showType === costanti.SHOW_GROUPINFO &&
myvertical !== costanti.VISUTABLE_SCHEDA_GROUP) ||
(myvertical === 2 && tablesel === 'mygroups')
(myvertical === 2 && tablesel === 'mygroups')) || (myvertical === costanti.VISUTABLE_GROUP_CIRCUIT)
"
class="fill-all-width"
>
<div>
<CMyGroups
v-model="filtergrp"
:circuitname="circuitname"
:finder="false"
:mygrp="row"
:visu="costanti.FIND_GROUP"

View File

@@ -1,6 +1,6 @@
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
import { useUserStore } from '@store/UserStore'
import { IMyGroup, IImgGallery, IUserFields, IUserProfile, IFriends } from 'model'
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'
@@ -9,11 +9,14 @@ import { useI18n } from '@/boot/i18n'
import { useRoute, useRouter } from 'vue-router'
import { CUserNonVerif } from '@/components/CUserNonVerif'
import { toolsext } from '@store/Modules/toolsext'
import { CSaldo } from '@/components/CSaldo'
import { CSendCoins } from '@/components/CSendCoins'
import { useCircuitStore } from '@store/CircuitStore'
export default defineComponent({
name: 'CMyGroup',
emits: ['setCmd'],
components: {CUserNonVerif},
components: {CUserNonVerif, CSaldo, CSendCoins},
props: {
mygrp: {
type: Object as PropType<IMyGroup | null>,
@@ -28,7 +31,12 @@ export default defineComponent({
visu: {
type: Number,
required: true,
}
},
circuitname: {
type: String,
required: false,
default: '',
},
},
setup(props, { emit }) {
@@ -40,11 +48,16 @@ export default defineComponent({
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()
})
@@ -62,6 +75,7 @@ export default defineComponent({
groupname.value = props.mygrp.groupname
}
}
circuit.value = circuitStore.getCircuitByName(props.circuitname)
}
function getImgGroup(group: IMyGroup) {
@@ -93,6 +107,8 @@ export default defineComponent({
tools,
table,
myusername,
circuit,
showsendCoinTo,
}
},
})

View File

@@ -2,130 +2,435 @@
<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-section
avatar
@click="naviga(tools.getPathByGroup(grp, table))"
>
<q-avatar size="60px">
<q-img :src="getImgGroup(grp)" :alt="grp.groupname" img-class="imgprofile" height="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
><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-label v-if="grp.account && circuitname" caption lines="2">
<CSaldo
:small="true"
:account="grp.account"
:symbol="tools.getSymbolByCircuit(circuit)"
:color="tools.getColorByCircuit(circuit)"
:saldo="grp.account.saldo"
>
</CSaldo>
</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-section side v-if="visu === costanti.MY_GROUPS">
<q-item-label>
<q-item-label>
<q-btn
v-if="userStore.my.profile.calc.numGoodsAndServices > 0 && circuitname"
icon="fas fa-coins"
color="green"
size="md"
dense
@click="showsendCoinTo = true"
>
</q-btn>
</q-item-label>
<q-item-section side>
<q-item-label v-if="visu === costanti.MY_GROUPS">
<q-btn rounded icon="fas fa-ellipsis-h">
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="tools.setCmd($q, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</q-item-section>
<q-item
clickable
icon="fas fa-user-minus"
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.remove_from_mygroups')
}}</q-item-section>
</q-item>
</q-list>
<q-list v-if="tools.iAmAdminGroup(grp.groupname)" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.DELETE_GROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.delete_group') }}</q-item-section>
<q-list
v-if="tools.iAmAdminGroup(grp.groupname)"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.DELETE_GROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.delete_group')
}}</q-item-section>
</q-item>
</q-list>
<q-list style="min-width: 150px">
<q-item v-if="!tools.iAmAdminGroup(grp.groupname)" clickable icon="fas fa-ban" v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.BLOCK_GROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.block_group') }}</q-item-section>
<q-item
v-if="!tools.iAmAdminGroup(grp.groupname)"
clickable
icon="fas fa-ban"
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.BLOCK_GROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.block_group')
}}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.USER_GROUPS">
<q-item-label>
<q-btn rounded :icon="userStore.IsMyGroupByGroupname(grp.groupname) ? `fas fa-ellipsis-h` : `fas fa-user`">
<q-item-label v-else-if="visu === costanti.USER_GROUPS">
<q-btn
rounded
:icon="
userStore.IsMyGroupByGroupname(grp.groupname)
? `fas fa-ellipsis-h`
: `fas fa-user`
"
>
<q-menu>
<q-list v-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && !userStore.IsAskedGroupByGroupname(grp.groupname) && !userStore.IsRefusedGroupByGroupname(grp.groupname))" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), true, grp.groupname)">
<q-item-section>{{ $t('groups.ask_group') }}</q-item-section>
<q-list
v-if="
!userStore.IsMyGroupByGroupname(grp.groupname) &&
!userStore.IsAskedGroupByGroupname(grp.groupname) &&
!userStore.IsRefusedGroupByGroupname(grp.groupname)
"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REQGROUP,
myusername(),
true,
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.ask_group')
}}</q-item-section>
</q-item>
</q-list>
<q-list v-else-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && userStore.IsAskedGroupByGroupname(grp.groupname) && !userStore.IsRefusedGroupByGroupname(grp.groupname))" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, myusername(), false, grp.groupname)">
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
<q-list
v-else-if="
!userStore.IsMyGroupByGroupname(grp.groupname) &&
userStore.IsAskedGroupByGroupname(grp.groupname) &&
!userStore.IsRefusedGroupByGroupname(grp.groupname)
"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REFUSE_REQ_GROUP,
myusername(),
false,
grp.groupname
)
"
>
<q-item-section>{{
$t('shared.refuse_ask')
}}</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, grp.groupname)">
<q-item-section>{{ $t('shared.cancel_ask') }}</q-item-section>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REQGROUP,
myusername(),
false,
grp.groupname
)
"
>
<q-item-section>{{
$t('shared.cancel_ask')
}}</q-item-section>
</q-item>
</q-list>
<q-list v-else-if="userStore.IsMyGroupByGroupname(grp.groupname)" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.exit_group') }}</q-item-section>
<q-list
v-else-if="userStore.IsMyGroupByGroupname(grp.groupname)"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.exit_group')
}}</q-item-section>
</q-item>
</q-list>
<q-list v-if="tools.iAmAdminGroup(grp.groupname)" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.DELETE_GROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.delete_group') }}</q-item-section>
<q-list
v-if="tools.iAmAdminGroup(grp.groupname)"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.DELETE_GROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.delete_group')
}}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.REQ_GROUP">
<q-item-label>
<q-item-label v-else-if="visu === costanti.REQ_GROUP">
<q-btn rounded icon="fas fa-ellipsis-h">
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, grp.groupname)">
<q-item-section>{{ $t('groups.reject_ask_group') }}</q-item-section>
<q-item
clickable
icon="fas fa-user-minus"
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REQGROUP,
myusername(),
false,
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.reject_ask_group')
}}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.ASK_SENT_GROUP">
<q-item-label>
<q-item-label v-else-if="visu === costanti.ASK_SENT_GROUP">
<q-btn rounded icon="fas fa-ellipsis-h">
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="tools.setCmd($q, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
<q-item
clickable
icon="fas fa-user-minus"
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REFUSE_REQ_GROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('shared.refuse_ask')
}}</q-item-section>
</q-item>
<q-item clickable icon="fas fa-user-minus" v-close-popup
@click="tools.setCmd($q, shared_consts.GROUPSCMD.CANCEL_REQ_GROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('shared.cancel_ask') }}</q-item-section>
<q-item
clickable
icon="fas fa-user-minus"
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.CANCEL_REQ_GROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('shared.cancel_ask')
}}</q-item-section>
</q-item>
</q-list>
</q-menu>
</q-btn>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.FIND_GROUP">
<q-item-label>
<q-btn rounded :icon="userStore.IsMyGroupByGroupname(grp.groupname) ? `fas fa-ellipsis-h` : `fas fa-user`">
<q-item-label v-else-if="visu === costanti.FIND_GROUP">
<q-btn
rounded
:icon="
userStore.IsMyGroupByGroupname(grp.groupname)
? `fas fa-ellipsis-h`
: `fas fa-user`
"
>
<q-menu>
<q-list v-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && !userStore.IsAskedGroupByGroupname(grp.groupname))" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), true, grp.groupname)">
<q-item-section>{{ $t('groups.ask_group') }}</q-item-section>
<q-list
v-if="
!userStore.IsMyGroupByGroupname(grp.groupname) &&
!userStore.IsAskedGroupByGroupname(grp.groupname)
"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REQGROUP,
myusername(),
true,
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.ask_group')
}}</q-item-section>
</q-item>
</q-list>
<q-list v-else-if="(!userStore.IsMyGroupByGroupname(grp.groupname) && userStore.IsAskedGroupByGroupname(grp.groupname))" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REFUSE_REQ_GROUP, myusername(), false, grp.groupname)">
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
<q-list
v-else-if="
!userStore.IsMyGroupByGroupname(grp.groupname) &&
userStore.IsAskedGroupByGroupname(grp.groupname)
"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REFUSE_REQ_GROUP,
myusername(),
false,
grp.groupname
)
"
>
<q-item-section>{{
$t('shared.refuse_ask')
}}</q-item-section>
</q-item>
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REQGROUP, myusername(), false, grp.groupname)">
<q-item-section>{{ $t('shared.cancel_ask') }}</q-item-section>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REQGROUP,
myusername(),
false,
grp.groupname
)
"
>
<q-item-section>{{
$t('shared.cancel_ask')
}}</q-item-section>
</q-item>
</q-list>
<q-list v-else-if="userStore.IsMyGroupByGroupname(grp.groupname)" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.exit_group') }}</q-item-section>
<q-list
v-else-if="userStore.IsMyGroupByGroupname(grp.groupname)"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.REMOVE_FROM_MYGROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.exit_group')
}}</q-item-section>
</q-item>
</q-list>
<q-list v-if="tools.iAmAdminGroup(grp.groupname)" style="min-width: 200px">
<q-item clickable v-close-popup @click="tools.setCmd($q, shared_consts.GROUPSCMD.DELETE_GROUP, myusername(), '', grp.groupname)">
<q-item-section>{{ $t('groups.delete_group') }}</q-item-section>
<q-list
v-if="tools.iAmAdminGroup(grp.groupname)"
style="min-width: 200px"
>
<q-item
clickable
v-close-popup
@click="
tools.setCmd(
$q,
shared_consts.GROUPSCMD.DELETE_GROUP,
myusername(),
'',
grp.groupname
)
"
>
<q-item-section>{{
$t('groups.delete_group')
}}</q-item-section>
</q-item>
</q-list>
</q-menu>
@@ -138,11 +443,20 @@
<div v-else>
<CUserNonVerif></CUserNonVerif>
</div>
<div v-if="showsendCoinTo">
<CSendCoins
:showprop="showsendCoinTo"
:to_group="grp"
:circuitname="circuitname"
@close="showsendCoinTo = false"
>
</CSendCoins>
</div>
</template>
<script lang="ts" src="./CMyGroup.ts">
</script>
<style lang="scss" scoped>
@import './CMyGroup.scss';
@import './CMyGroup.scss';
</style>

View File

@@ -44,6 +44,11 @@ export default defineComponent({
required: false,
default: 0,
},
circuitname: {
type: String,
required: false,
default: '',
},
},
setup(props, { emit }) {
const userStore = useUserStore()

View File

@@ -27,7 +27,7 @@
class="q-my-sm"
clickable
>
<CMyGroup :mygrp="grp" :visu="modelValue"> </CMyGroup>
<CMyGroup :mygrp="grp" :visu="modelValue" :circuitname="circuitname"> </CMyGroup>
</span>
</q-list>
</div>
@@ -35,7 +35,7 @@
<div v-else>
<q-list class="width-container">
<span class="q-my-sm" clickable>
<CMyGroup :mygrp="mygrp" :visu="visu"> </CMyGroup>
<CMyGroup :mygrp="mygrp" :visu="visu" :circuitname="circuitname"> </CMyGroup>
</span>
</q-list>
</div>

View File

@@ -11,12 +11,7 @@
img-class="imgprofile" height="60px"/>
</q-avatar>
</q-item-section>
<q-item-section v-else avatar @click="naviga(`/my/` + myrec.username)">
<q-badge v-if="showBadge" class="q-my-xs self-center" :color="fieldsTable.getColByAdType(myrec.adType)">
{{ fieldsTable.getValByTabAndId(table, 'adType', myrec.adType) }}
<q-icon :name="fieldsTable.getIconByAdType(myrec.adType)" color="white"
class="q-ml-xs"/>
</q-badge>
<q-item-section v-else avatar>
<q-avatar size="60px">
<q-img :src="getImgUser(myrec)" :alt="myrec.username" img-class="imgprofile" height="60px"/>
</q-avatar>
@@ -37,11 +32,10 @@
<q-item-label lines="3" v-if="myrec.descr">{{ myrec.descr }}<br>
</q-item-label>
<q-item-label lines="1" style="text-align: right" class="text_user_city">
<span v-if="myrec.visibility.includes(shared_consts.Visibility_Group.PRIVATE)" class="q-mr-xs">
<span v-if="myrec.visibility && myrec.visibility.includes(shared_consts.Visibility_Group.PRIVATE)" class="q-mr-xs">
<q-icon name="fas fa-lock"></q-icon></span>
<span v-if="myrec.visibility.includes(shared_consts.Visibility_Group.HIDDEN)" class="q-mr-xs">
<span v-if="myrec.visibility && myrec.visibility.includes(shared_consts.Visibility_Group.HIDDEN)" class="q-mr-xs">
<q-icon name="fas fa-eye-slash"></q-icon></span>
<span class="text-weight-bold">{{ tools.getNameToShow(myrec) }}</span> -
<span v-for="(rec, ind) of myrec.mycities" :key="ind"><span v-if="ind > 0">, </span>{{ rec.comune }}</span>
</q-item-label>

View File

@@ -33,7 +33,7 @@
<q-btn
v-if="userStore.IsMyCircuitByUser(contact).length > 0 && contact.username !== userStore.my.username && userStore.my.profile.calc.numGoodsAndServices > 0"
v-if="userStore.getMyCircuitsInCommonByUser(contact).length > 0 && contact.username !== userStore.my.username && userStore.my.profile.calc.numGoodsAndServices > 0"
icon="fas fa-coins"
color="green"
size="md"

View File

@@ -271,7 +271,6 @@
</div>
</section>
<LandingFooter></LandingFooter>
</div>
</q-page>
</template>

View File

@@ -1,6 +1,6 @@
import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue'
import { IAccount, ICircuit, IOperators, ISendCoin, ISpecialField, IUserFields } from '../../model'
import { IAccount, ICircuit, IMyGroup, IOperators, ISendCoin, ISpecialField, IUserFields } from '../../model'
import { tools } from '@store/Modules/tools'
import { CSaldo } from '@/components/CSaldo'
import { useUserStore } from '@store/UserStore'
@@ -24,7 +24,18 @@ export default defineComponent({
},
to_user: {
type: Object as PropType<IUserFields>,
required: true,
required: false,
default: null
},
to_group: {
type: Object as PropType<IMyGroup>,
required: false,
default: null,
},
from_group: {
type: Object as PropType<IMyGroup>,
required: false,
default: null,
},
},
components: { CSaldo, CMyUserOnlyView },
@@ -36,10 +47,9 @@ export default defineComponent({
const userStore = useUserStore()
const circuitStore = useCircuitStore()
const from_username = ref(userStore.my.username)
const circuitsel = ref('')
const qty = ref(<string|number>'')
const qty = ref(<string | number>'')
const causal = ref('')
const bothcircuits = ref(<any>[])
@@ -111,7 +121,25 @@ export default defineComponent({
// ....
if (props.to_user) {
console.log('user', props.to_user)
bothcircuits.value = userStore.IsMyCircuitByUser(props.to_user)
bothcircuits.value = userStore.getMyCircuitsInCommonByUser(props.to_user)
if (props.circuitname) {
circuitsel.value = props.circuitname
} else {
circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0])
}
if (!userStore.IsMyCircuitByName(circuitsel.value)) {
circuitsel.value = bothcircuits.value[0]
}
aggiorna()
show.value = true
}
if (props.to_group) {
console.log('group', props.to_group)
bothcircuits.value = userStore.getMyCircuitsInCommonByGroup(props.to_group)
if (props.circuitname) {
circuitsel.value = props.circuitname
@@ -133,16 +161,25 @@ export default defineComponent({
}
function sendCoin() {
console.log('sendcoin', qty.value, props.to_user.username)
console.log('sendcoin', qty.value, props.to_group ? props.to_group.groupname : props.to_user.username)
if (props.to_user.username && qty.value && circuitloaded.value) {
const myrecsendcoin: ISendCoin = {
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 = {
qty: tools.convstrToNum(qty.value),
dest: props.to_user.username,
dest: '',
groupdest: '',
grouporig: '',
circuitname: circuitsel.value,
causal: causal.value,
symbol: circuitloaded.value.symbol,
}
myrecsendcoin.groupdest = props.to_group ? props.to_group.groupname : ''
myrecsendcoin.dest = props.to_user ? props.to_user.username : ''
myrecsendcoin.grouporig = props.from_group ? props.from_group.groupname : ''
if (myrecsendcoin) {
tools.sendCoinsByCircuit($q, circuitloaded.value, myrecsendcoin)
.then((ris: any) => {

View File

@@ -93,7 +93,7 @@
<q-btn
v-if="circuitloaded"
:disable="qtyRef ? (qtyRef.hasError || !circuitloaded.transactionsEnabled) : false"
:label="$t('circuit.sendcoinsto', {qty, coin: circuitsel, dest: to_user.username })" color="positive"
: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>

View File

@@ -13,7 +13,7 @@ export const validations = computed(() => {
},
username: {
required,
minLength: minLength(6),
minLength: minLength(3),
},
},
}

View File

@@ -10,7 +10,7 @@ import { CTitleBanner } from '../CTitleBanner'
import { CCopyBtn } from '../CCopyBtn'
import { CRegistration } from '../CRegistration'
import { PagePolicy } from '../PagePolicy'
import { computed, defineComponent, reactive, ref, watch } from 'vue'
import { computed, defineComponent, onMounted, reactive, ref, watch } from 'vue'
import { CSignIn } from '@/components/CSignIn'
import { useQuasar } from 'quasar'
import { useI18n } from '@/boot/i18n'
@@ -64,11 +64,26 @@ export default defineComponent({
required: false,
default: '',
},
name_default: {
type: String,
required: false,
default: '',
},
username_default: {
type: String,
required: false,
default: '',
},
need_Telegram: {
type: Boolean,
required: false,
default: false,
},
collettivo: {
type: Boolean,
required: false,
default: false,
},
},
setup(props, { emit }) {
const $q = useQuasar()
@@ -143,10 +158,13 @@ export default defineComponent({
},
username: {
required,
minLength: minLength(6),
minLength: minLength(3),
complexityUser,
registereduser,
},
name: {
required: props.collettivo ? true : false,
},
terms: {
required,
},
@@ -296,6 +314,11 @@ export default defineComponent({
signup.profile.teleg_id = $route.params.idteleg ? parseInt($route.params.idteleg.toString(), 10) : 0
}
if (props.collettivo) {
signup.username = props.username_default!
signup.name = props.name_default!
}
console.log('1) aportador_solidario', signup.aportador_solidario)
if (!signup.aportador_solidario)

View File

@@ -1,7 +1,9 @@
<template>
<div>
<div
v-if="needTelegram && tools.isLogged() && tools.getUsername()"
v-if="
needTelegram && tools.isLogged() && tools.getUsername() && !collettivo
"
class="text-center"
>
<q-banner rounded class="bg-green text-white" style="text-align: center">
@@ -30,7 +32,7 @@
<br />
</div>
</div>
<div v-if="!tools.isLogged() || visureg" class="text-center">
<div v-if="!tools.isLogged() || visureg || collettivo" class="text-center">
<div>
<div>
<logo
@@ -43,7 +45,10 @@
</div>
</div>
<div v-if="visubuttBOT && needTelegram" class="q-gutter-md">
<div
v-if="visubuttBOT && needTelegram && !collettivo"
class="q-gutter-md"
>
<div class="q-ma-md">
<CRegistration
:invited="signup.aportador_solidario"
@@ -54,7 +59,7 @@
</div>
</div>
<div v-else-if="!isalreadyReg" class="q-gutter-sm q-mt-sm">
<div v-else-if="!isalreadyReg || collettivo" class="q-gutter-sm q-mt-sm">
<div v-if="signup.username === 'undefined'">
<br />
Vai su <b>BOT RISO</b> Telegram ed imposta l'Username di Telegram.<br /><br />
@@ -96,7 +101,11 @@
"
maxlength="20"
debounce="1000"
:label="$t('reg.aportador_solidario')"
:label="
collettivo
? $t('reg.username_admin_collettivo')
: $t('reg.aportador_solidario')
"
>
<template v-slot:prepend>
<q-icon name="person" />
@@ -114,7 +123,11 @@
v-on:keyup.enter="!checkifDisabled ? $refs.carousel.next() : null"
debounce="2000"
:rules="[myRuleEmail]"
:label="$t('reg.email_reg')"
:label="
collettivo
? $t('reg.email_reg_collettivo')
: $t('reg.email_reg')
"
>
<template v-slot:prepend>
<q-icon name="email" />
@@ -150,7 +163,29 @@
</template>
</q-input>
<div v-if="show_namesurname">
<div v-if="collettivo">
<q-input
ref="inputName"
v-model="signup.name"
rounded
outlined
@blur="v$.name.$touch"
:error="v$.name.$error"
maxlength="30"
debounce="1000"
v-on:keyup.enter="
!checkifDisabled ? $refs.carousel.next() : null
"
:error-message="tools.errorMsg('name', v$.name)"
:label="$t('reg.name_opt_collettivo')"
>
<template v-slot:prepend>
<q-icon name="person" />
</template>
</q-input>
</div>
<div v-else-if="show_namesurname">
<q-input
ref="inputName"
v-model="signup.name"
@@ -265,7 +300,7 @@
:label="$t('reg.submit')"
>
</q-btn>
<br>
<br />
</div>
</div>
<div v-else>
@@ -332,7 +367,11 @@
"
maxlength="20"
debounce="1000"
:label="$t('reg.aportador_solidario')"
:label="
collettivo
? $t('reg.username_admin_collettivo')
: $t('reg.aportador_solidario')
"
>
<template v-slot:prepend>
<q-icon name="person" />
@@ -352,7 +391,11 @@
"
debounce="2000"
:rules="[myRuleEmail]"
:label="$t('reg.email_reg')"
:label="
collettivo
? $t('reg.email_reg_collettivo')
: $t('reg.email_reg')
"
>
<template v-slot:prepend>
<q-icon name="email" />
@@ -384,14 +427,36 @@
tools.errorMsg('username', v$.username) ||
(isalreadyReg ? 'L\'Username è gia stato registrato!' : '')
"
:label="$t('reg.username_reg')"
:label="$t('reg.username_reg_collettivo')"
>
<template v-slot:prepend>
<q-icon name="person" />
</template>
</q-input>
<div v-if="show_namesurname">
<div v-if="collettivo">
<q-input
ref="inputName"
v-model="signup.name"
rounded
outlined
@blur="v$.name.$touch"
:error="v$.name.$error"
maxlength="30"
debounce="1000"
v-on:keyup.enter="
!checkifDisabled ? $refs.carousel.next() : null
"
:error-message="tools.errorMsg('name', v$.name)"
:label="$t('reg.name_opt_collettivo')"
>
<template v-slot:prepend>
<q-icon name="person" />
</template>
</q-input>
</div>
<div v-else-if="show_namesurname">
<q-input
ref="inputName"
v-model="signup.name"
@@ -623,7 +688,7 @@
</div>
</div>
</div>
<div v-else-if="isalreadyReg">
<div v-else-if="isalreadyReg && !collettivo">
<q-banner
class="bg-negative text-white text-h5"
transition-show="jump-down"

View File

@@ -0,0 +1,9 @@
.myshad {
text-shadow: .125rem .125rem .125rem darkgray;
}
.nonvisibile{
border-radius: 16px;
border: red solid 3px;
padding: 4px;
}

View File

@@ -0,0 +1,37 @@
import { defineComponent, ref } from 'vue'
export default defineComponent({
name: 'CTitleSec',
props: {
title: {
type: String,
required: true,
},
bgcolor: {
type: String,
required: false,
default: 'bg-primary',
},
clcolor: {
type: String,
required: false,
default: 'text-white',
},
icon: {
type: String,
required: false,
default: '',
},
},
components: {},
setup(props, { emit }) {
function iconopen() {
return 'fas fa-chevron-down q-icon q-expansion-item__toggle-icon q-focusable rotate-180'
}
return {
iconopen,
}
},
})

View File

@@ -0,0 +1,30 @@
<template>
<div>
<q-banner
inline-actions
rounded
dense
:class="bgcolor + ` cursor-pointer q-my-sm ` + clcolor + ` `"
style="text-align: center"
>
<template v-slot:avatar>
<q-icon v-if="icon" :name="icon" color="white" />
</template>
<span :class="`mybanner `">{{
title
}}</span>
</q-banner>
<q-slide-transition>
<div>
<slot></slot>
</div>
</q-slide-transition>
</div>
</template>
<script lang="ts" src="./CTitleSec.ts">
</script>
<style lang="scss" scoped>
@import './CTitleSec.scss';
</style>

View File

@@ -0,0 +1 @@
export {default as CTitleSec} from './CTitleSec.vue'

View File

@@ -373,6 +373,7 @@
id="user-actions"
class="column justify-center q-gutter-sm q-ma-sm center-150"
>
<q-btn
rounded
color="primary"
@@ -385,7 +386,7 @@
rounded
color="orange"
icon="house"
:to="`/skills/` + getMyUsername()"
:to="`/attivita/` + getMyUsername()"
> &nbsp;{{ t('otherpages.myactivities') }}
</q-btn>
<!--<q-btn round color="warning" icon="lock"></q-btn>-->