Members, Circuits

This commit is contained in:
Paolo Arena
2022-10-21 21:25:54 +02:00
parent 9d40649af3
commit 6c306b36f3
73 changed files with 4424 additions and 93 deletions

View File

@@ -1089,6 +1089,7 @@ export default defineComponent({
subname: 1,
longdescr: 1,
regulation: 1,
numMembers: 1,
totCircolante: 1,
totTransato: 1,
systemUserId: 1,
@@ -1098,6 +1099,7 @@ export default defineComponent({
nome_valuta: 1,
fido_scoperto_default: 1,
deperimento: 1,
status: 1,
transactionsEnabled: 1,
qta_max_default: 1,
valuta_per_euro: 1,

View File

@@ -1880,6 +1880,9 @@ export default defineComponent({
visupagedialog.value = true
myrecdialog.value = id
return true
} else if (cmd === costanti.CMD_OPEN_PAGE) {
$router.push(tools.getPathByTableAndRec(mytable.value, id))
return true
}
let action = 0

View File

@@ -2,3 +2,4 @@
display: flex;
flex: 1;
}

View File

@@ -12,6 +12,7 @@ import { useRoute, useRouter } from 'vue-router'
import { CUserNonVerif } from '@/components/CUserNonVerif'
import { CSaldo } from '@/components/CSaldo'
import { toolsext } from '@store/Modules/toolsext'
import { useGlobalStore } from '@store/globalStore'
export default defineComponent({
name: 'CMyCircuit',
@@ -43,6 +44,8 @@ export default defineComponent({
const $router = useRouter()
const $route = useRoute()
const globalStore = useGlobalStore()
const circuit = ref(<ICircuit | null>null)
const account = computed(() => circuit.value ? userStore.getAccountByCircuitId(circuit.value._id) : null )
@@ -51,6 +54,8 @@ export default defineComponent({
const table = ref(toolsext.TABCIRCUITS)
const showingtooltip = ref(false)
watch(() => props.mycircuit, (newval, oldval) => {
mounted()
})
@@ -101,6 +106,8 @@ export default defineComponent({
account,
qtarem,
saldo,
globalStore,
showingtooltip,
}
},
})

View File

@@ -6,29 +6,54 @@
<q-avatar size="60px">
<q-img :src="getImgCircuit(circuit)" :alt="circuit.name" img-class="imgprofile" height="60px"/>
</q-avatar>
<div class=" q-ma-xs q-px-xs shadow-2 rounded-borders"><span class="q-mx-xs">{{ circuit.numMembers }}</span>
<q-icon name="fas fa-users" size="xs" color="blue"></q-icon>
</div>
</q-item-section>
<q-item-section @click="naviga(tools.getPathByTableAndRec(table, circuit))">
<q-item-label><strong>{{ circuit.name }}</strong> <span v-if="circuit.subname"> ({{ circuit.subname }})</span>
<q-item-section>
<q-item-label @click="naviga(tools.getPathByTableAndRec(table, circuit))"><strong>{{ circuit.name }}</strong> <span
v-if="circuit.subname"> ({{ circuit.subname }})</span>
</q-item-label>
<q-item-label v-if="circuit.longdescr" caption lines="3"><em>{{ circuit.longdescr }}</em></q-item-label>
<q-item-label v-if="!circuit.transactionsEnabled" caption lines="1">
<q-icon name="fas fa-lock">
</q-icon></q-item-label>
<q-item-label @click="naviga(tools.getPathByTableAndRec(table, circuit))" v-if="circuit.longdescr" caption lines="3"><em>{{ circuit.longdescr }}</em>
</q-item-label>
<q-item-label caption lines="1">
<q-chip
v-if="circuit.status !== undefined && circuit.status !== 0" :color="circuitStore.getColorCircuitClass(circuit)"
text-color="white"
size="md"
:icon="globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'icon')">{{
globalStore.getValueByTableSingle('statuscircuit', circuit.status)
}}
<q-btn
class="q-ml-sm"
icon="fas fa-info" color="primary" text-color="white"
size="xs"
round
@click="showingtooltip = !showingtooltip">
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'hint')}}</q-tooltip>
</q-btn>
</q-chip>
<q-item-label lines="1">
</q-item-label>
<q-item-label v-if="(!circuit.transactionsEnabled) && (circuit.status === shared_consts.CIRCUIT_STATUS.FASE3_MONETA_ABILITATA)" caption lines="1">
<q-icon v-if="!circuit.transactionsEnabled" name="fas fa-lock">
</q-icon>
<span class="text-red text-weight-bold">{{ $t('circuit.transaction_suspended') }}</span>
</q-item-label>
<q-item-label @click="naviga(tools.getPathByTableAndRec(table, circuit))" lines="1">
<CSaldo
:account="account"
:symbol="circuit.symbol"
:color="circuit.color"
:saldo="saldo"
:qtarem="qtarem"
>
>
</CSaldo>
</q-item-label>
</q-item-section>
<q-item-section side v-if="visu === costanti.USER_CIRCUITS">
<q-item-label>
<q-btn rounded :icon="userStore.IsMyCircuitByName(circuit.name) ? `fas fa-ellipsis-h` : `fas fa-user`">

View File

@@ -322,7 +322,7 @@ export default defineComponent({
function changevalRec(newval: any) {
if (col.value && col.value.allowchar === costanti.ALLOWCHAR_CODE) {
myvalue.value = tools.removespaces(newval)
myvalue.value = tools.removespaces_slash(newval)
}
// console.log('popypedit: changevalRec', newval)

View File

@@ -1,4 +1,6 @@
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
import { useCircuitStore } from '@store/CircuitStore'
import { useGlobalStore } from '@store/globalStore'
import { useUserStore } from '@store/UserStore'
import { IImgGallery, IUserFields, IUserProfile } from 'model'
import { costanti } from '@costanti'
@@ -31,11 +33,15 @@ export default defineComponent({
setup(props, { emit }) {
const userStore = useUserStore()
const circuitStore = useCircuitStore()
const globalStore = useGlobalStore()
// const $q = useQuasar()
const { t } = useI18n()
// const $router = useRouter()
const myrec = ref(<any | null>null)
const circuit = ref(<any | null>null)
const showingtooltip = ref(false)
watch(() => props.prop_myrec, (newval, oldval) => {
@@ -44,7 +50,7 @@ export default defineComponent({
function mounted() {
if (props.prop_myrec) {
myrec.value = props.prop_myrec
circuit.value = props.prop_myrec
}
}
@@ -60,7 +66,7 @@ export default defineComponent({
return {
t,
myrec,
circuit,
costanti,
// naviga,
setCmd,
@@ -70,6 +76,9 @@ export default defineComponent({
toolsext,
fieldsTable,
cmdExt,
globalStore,
circuitStore,
showingtooltip,
}
},
})

View File

@@ -2,45 +2,64 @@
<div class="q-py-xs centermydiv cardrec"
:style="`max-width: `+ (tools.getwidth($q) - 20) +`px; ` + ($q.screen.lt.sm ? (`min-width: `+ (tools.getwidth($q) - 20) +`px;`) : ``)">
<q-item v-if="myrec" clickable v-ripple class="shadow-2 q-btn--rounded bg-teal-1">
<q-item v-if="circuit" clickable v-ripple class="shadow-2 q-btn--rounded bg-teal-1">
<q-item-section v-if="myrec.photo" avatar
@click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)">
<q-item-section v-if="circuit.photos" avatar
@click="cmdExt(costanti.CMD_OPEN_PAGE, circuit)">
<q-avatar size="60px">
<q-img :src="userStore.getImgByCircuit(myrec)" :alt="myrec.descr"
<q-img :src="userStore.getImgByCircuit(circuit)" :alt="circuit.descr"
img-class="imgprofile" height="60px"/>
</q-avatar>
<q-chip class="glossy" icon-right="fas fa-users" text-color="blue"><span style="font-size: 1rem;" class="q-mr-xs">{{circuit.numMembers}}</span></q-chip>
</q-item-section>
<q-item-section @click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)">
<q-item-label v-if="myrec.name" lines="1" class="text_title">
<span class="text-weight-bold">{{ myrec.name }}</span>
</q-item-label>
<q-item-label v-if="myrec.subname" lines="1" class="text_title">
<span>{{ myrec.subname }}</span>
<span v-if="!myrec.transactionsEnabled"><q-icon name="fas fa-lock"></q-icon></span>
</q-item-label>
<q-item-label lines="3" v-if="myrec.longdescr">{{ myrec.longdescr }}<br>
</q-item-label>
<!--
<CCurrencyValue
:symbol="myrec.symbol"
:tips="t('account.saldo_tips')"
:color="myrec.color"
:value="myrec.account.saldo"
label="Saldo">
<q-item-section @click="cmdExt(costanti.CMD_OPEN_PAGE, circuit)">
</CCurrencyValue>
<q-item-label @click="naviga(tools.getPathByTableAndRec(table, circuit))"><strong>{{ circuit.name }}</strong> <span v-if="circuit.subname"> ({{ circuit.subname }})</span>
</q-item-label>
<q-item-label @click="naviga(tools.getPathByTableAndRec(table, circuit))" v-if="circuit.longdescr" caption lines="3"><em>{{ circuit.longdescr }}</em></q-item-label>
<q-item-label caption lines="1">
<q-chip
v-if="circuit.status !== undefined && circuit.status !== 0" :color="circuitStore.getColorCircuitClass(circuit)"
text-color="white"
size="md"
:icon="globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'icon')">{{ globalStore.getValueByTableSingle('statuscircuit', circuit.status) }}
<q-btn
class="q-ml-sm"
icon="fas fa-info" color="primary" text-color="white"
size="xs"
round
@click="showingtooltip = !showingtooltip">
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'hint')}}</q-tooltip>
</q-btn>
</q-chip>
</q-item-label>
<q-item-label v-if="(!circuit.transactionsEnabled) && (circuit.status === shared_consts.CIRCUIT_STATUS.FASE3_MONETA_ABILITATA)" caption lines="1">
<q-icon v-if="!circuit.transactionsEnabled" name="fas fa-lock">
</q-icon>
<span class="text-red text-weight-bold">{{ $t('circuit.transaction_suspended') }}</span>
</q-item-label>
<!--
<q-item-label v-if="circuit.name" lines="1" class="text_title">
<span class="text-weight-bold">{{ circuit.name }}</span>
</q-item-label>
<q-item-label v-if="circuit.subname" lines="1" class="text_title">
<span>{{ circuit.subname }}</span>
<span v-if="!circuit.transactionsEnabled"><q-icon name="fas fa-lock"></q-icon></span>
</q-item-label>
<q-item-label lines="3" v-if="circuit.longdescr">{{ circuit.longdescr }}<br>
</q-item-label>
-->
</q-item-section>
<q-item-section side v-if="tools.canModifyThisRec(myrec, table)">
<q-item-section side v-if="tools.canModifyThisRec(circuit, table)">
<q-item-label>
<q-btn rounded icon="fas fa-pencil-alt">
<q-menu>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup
@click="cmdExt(costanti.CMD_MODIFY, myrec._id)">
@click="cmdExt(costanti.CMD_MODIFY, circuit._id)">
<q-item-section side>
<q-icon name="fas fa-pencil-alt"/>
</q-item-section>
@@ -48,7 +67,7 @@
</q-item>
</q-list>
<q-list style="min-width: 150px">
<q-item clickable v-close-popup @click="cmdExt(costanti.CMD_DELETE, myrec._id)">
<q-item clickable v-close-popup @click="cmdExt(costanti.CMD_DELETE, circuit._id)">
<q-item-section side>
<q-icon name="fas fa-trash-alt"/>
</q-item-section>

View File

@@ -5,7 +5,7 @@
<q-item v-if="myrec" clickable v-ripple class="shadow-2 q-btn--rounded bg-teal-1">
<q-item-section v-if="(shared_consts.TABLES_VISU_IMG.includes(table)) && (myrec.photos && myrec.photos.length > 0)" avatar
@click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)">
@click="cmdExt(costanti.CMD_OPEN_PAGE, myrec)">
<q-avatar size="60px">
<q-img :src="tools.getFullFileName(myrec.photos, table, myrec.username, myrec.groupname)" :alt="myrec.descr"
img-class="imgprofile" height="60px"/>
@@ -22,7 +22,7 @@
</q-avatar>
</q-item-section>
<q-item-section @click="cmdExt(costanti.CMD_SHOW_PAGE, myrec)">
<q-item-section @click="cmdExt(costanti.CMD_OPEN_PAGE, myrec)">
<q-item-label class="full-width">
<span v-for="(rec, ind) of myrec.recCatGrp" :key="ind"> <q-chip
dense

View File

@@ -9,7 +9,7 @@
<template v-slot:avatar>
<q-icon name="fas fa-exclamation-triangle" color="yellow" size="xs"/>
</template>
<q-item clickable v-for="(notif, index) in lasts_notifs_req" :key="index">
<q-item v-for="(notif, index) in lasts_notifs_req" :key="index">
<!--<q-item-section avatar>
<q-avatar>
@@ -24,24 +24,26 @@
</q-item-section>
<q-item-section v-ripple>
<q-item-section>
<q-item-label lines="5" :class="(!notif.read) ? 'unread' : 'read'" @click="clickNotif(notif)">
<div v-html="getNotifText($t, notif, false)"></div>
</q-item-label>
<q-item-label caption lines="18"
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_SENDCOINSREQ"
v-ripple>
>
<div class="row no-wrap justify-evenly q-pa-sm">
<q-btn
size="md"
icon="fas fa-coins"
:disable="notif.disablecoinclick"
color="positive" :label="$t('circuit.accept_coins_qty', {qty: notif.extrarec.qty, symbol: notif.extrarec.symbol})"
@click="tools.acceptCoins(q, notif.sender, notif)"
@click="notif.disablecoinclick = true; tools.acceptCoins(q, notif.sender, notif)"
/>
<q-btn
size="md"
:disable="notif.disablecoinclick"
color="negative" :label="$t('circuit.refuse_coins_qty', {qty: notif.extrarec.qty, symbol: notif.extrarec.symbol})"
@click="tools.refuseCoins(q, notif.sender, notif)"
@click="notif.disablecoinclick = true; tools.refuseCoins(q, notif.sender, notif)"
/>
</div>
</q-item-label>

View File

@@ -235,7 +235,7 @@ body.mobile .landing:before {
.home {
//background-color: rgb(250, 250, 250);
padding: 3.125rem;
padding: 2.125rem;
display: flex;
//flex-wrap: nowrap;
flex-direction: column;
@@ -244,7 +244,7 @@ body.mobile .landing:before {
}
.btn-start {
margin: 3.125rem;
margin: 1.125rem;
}
.shadow {
@@ -461,3 +461,7 @@ ul li::before {
margin-left: 5px;
}
}
.buttreg {
font-weight: bold;
}

View File

@@ -7,6 +7,7 @@ import { tools } from '@store/Modules/tools'
import { LandingFooter, Logo } from '@components'
import { CFundRaising } from '@/components/CFundRaising'
import { CShowContentPage } from '@/components/CShowContentPage'
import { static_data } from '@src/db/static_data'
export default defineComponent({
@@ -124,6 +125,7 @@ export default defineComponent({
openCreatePostModal,
slide,
tools,
static_data,
animare,
}
},

View File

@@ -37,7 +37,11 @@
</div>
<div>
<div v-if="!tools.isLogged()" style="margin: 5px; padding: 5px;" class="home">
<div v-if="!tools.isLogged()" style="margin: 5px; padding: 5px" class="home">
<q-btn
v-if="static_data.functionality.ENABLE_REGISTRATION && static_data.functionality.ENABLE_REG_BY_BOT"
type="a" rounded size="lg" color="primary" href="/bot" :label="$t('reg.submit')" class="buttreg">
</q-btn>
<q-btn
rounded size="lg" color="primary" @click="PagLogin"
class="btn-start">

View File

@@ -64,7 +64,14 @@
</div>
<div
v-if="static_data.functionality.ENABLE_REGISTRATION && showregbutt"
v-if="static_data.functionality.ENABLE_REGISTRATION && showregbutt && static_data.functionality.ENABLE_REG_BY_BOT"
style="margin-top:10px; text-align: center;">
Se non sei ancora Registrato:<br>
<q-btn type="a" rounded size="md" color="primary" href="/bot" :label="$t('reg.submit')">
</q-btn>
</div>
<div
v-else-if="static_data.functionality.ENABLE_REGISTRATION && showregbutt"
style="margin-top:10px; text-align: center;">
Se non sei ancora Registrato:<br>
<q-btn rounded size="md" color="primary" to="/signup" :label="$t('reg.submit')">

View File

@@ -28,16 +28,9 @@
<q-btn class="q-ma-sm" color="positive" icon="fas fa-home" label="Se sei già Registrato CLICCA QUI" to="/"></q-btn>
<q-banner
v-if="need_Telegram"
rounded
class="bg-warning text-black"
style="text-align: center;"
>
<span class="mybanner" v-html="t('pages.need_Telegram')"></span>
</q-banner>
<div v-if="need_Telegram" class="mybanner" v-html="t('pages.need_Telegram')"></div><br>
<div v-if="!isalreadyReg">
<div v-if="!isalreadyReg && !(visubuttBOT && need_Telegram)">
<CTitleBanner :title="$t('pages.SignUp')"></CTitleBanner>
</div>
@@ -45,6 +38,7 @@
</div>
</div>
<div v-if="visubuttBOT && need_Telegram" class="q-gutter-md">
<q-banner
rounded