- Add saldo to member's list

This commit is contained in:
paoloar77
2022-11-06 13:38:38 +01:00
parent 5a3205ebda
commit 3302d9c23e
21 changed files with 270 additions and 66 deletions

View File

@@ -56,6 +56,7 @@ const msg_website_it = {
SignUpIscrizione: 'Diventa Socio CNM',
SignUp_alreadylista: 'Registrazione per quelli che erano già nella lista di Notevole (del 2019) !',
SignUp2: 'Registrazione',
SignUp3: 'Reg',
SignUpBot: 'Registrati',
SignIn: 'Login',
status: 'Statistiche',

View File

@@ -773,7 +773,7 @@ const baseroutes: IListRoutes[] = [
{
active: functionality.ENABLE_REGISTRATION && functionality.ENABLE_REG_NEED_TELEGRAM,
order: 1000,
path: '/signup/:invited/:usernameteleg/:idteleg',
path: '/signup/:invited/:usernameteleg/:idteleg/:regexpire',
materialIcon: 'how_to_reg',
name: 'pages.SignUp',
component: () => import('@/views/login/signup/signup.vue'),
@@ -813,6 +813,17 @@ const baseroutes: IListRoutes[] = [
infooter: false,
separator: false
},
{
active: true,
order: 1002,
path: '/signup/:invited/:regexpire',
materialIcon: 'how_to_reg',
name: 'pages.SignUp3',
component: () => import('@/views/login/signup/signup.vue'),
inmenu: false,
infooter: false,
separator: false
},
{
active: functionality.ENABLE_REGISTRATION,
order: 2000,

View File

@@ -278,7 +278,10 @@ module.exports = configure((ctx) => ({
pwa: {
workboxPluginMode: 'InjectManifest', // 'GenerateSW' or 'InjectManifest'
workboxOptions: {}, // only for GenerateSW
extendGenerateSWOptions (cfg) {
cfg.skipWaiting = false
cfg.clientsClaim = false
},
// for the custom service worker ONLY (/src-pwa/custom-service-worker.[js|ts])
// if using workbox in InjectManifest mode
chainWebpackCustomSW(chain) {
@@ -320,6 +323,26 @@ module.exports = configure((ctx) => ({
sizes: '96x96',
type: 'image/png',
},
{
src: 'images/riso-apple-icon-120x120.png',
sizes: '120x120',
type: 'image/png',
},
{
src: 'images/riso-apple-icon-144x144.png',
sizes: '144x144',
type: 'image/png',
},
{
src: 'images/riso-apple-icon-152x152.png',
sizes: '152x152',
type: 'image/png',
},
{
src: 'images/riso-apple-icon-180x180.png',
sizes: '180x180',
type: 'image/png',
},
],
},
},

View File

@@ -7,6 +7,10 @@ import { useI18n } from '@/boot/i18n'
export default defineComponent({
name: 'CCurrencyValue',
props: {
small: {
type: Boolean,
default: false,
},
label: {
type: String,
required: false,

View File

@@ -1,22 +1,35 @@
<template>
<div v-if="value !== null" :class="`text-h5 bordo_stondato_stretto full-width`"
:style="(!$q.screen.lt.sm ? `min-width: 250px; ` : ``) + (color_border ? `border-color: ` + color_border + `!important;`: '')">
<div class="text-center text-h7-dense text-italic text-grey-14">
{{ label }}
</div>
<div>
<q-field
dense
borderless
:readonly="readonly"
type="number"
rounded
class="q-px-sm text-h5"
color="green"
>
<template v-slot:prepend>
<div v-if="small">
<q-chip
dense class="cltexth4 chipbooked shadow-5 q-pa-sm2"
size="md"
:color="value > 0 ? `green` : value === 0 ? `gray` : `red`" text-color="white"
icon="fas fa-coins">
{{ tools.roundDec2(value) }} <span class="text-currency">&nbsp;<em class="q-pa-xxs text-white rounded-borders shadow-2" :style="`background-color: ` + (color ? color : '#ff5500')">{{ symbol }}</em></span>
</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 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>
</span>
<span v-else>{{ label }}</span>
</div>
<div>
<q-field
dense
borderless
:readonly="readonly"
type="number"
rounded
:class="!small ? `q-px-sm text-h5`: `q-px-xs text-h7`"
:color="value > 0 ? `green` : `red`"
>
<template v-slot:prepend>
<!--<img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg">-->
<q-btn v-if="tips"
<q-btn v-if="tips && !small"
icon="fas fa-info"
color="primary" text-color="white"
round
@@ -25,22 +38,23 @@
>
</q-btn>
<q-icon v-else name="fas fa-coins" size="sm"/>
</template>
<template v-slot:control>
<div class="align_elem_right">{{valueextra}}{{ tools.roundDec2(value) }}
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{tips}}</q-tooltip>
</div>
</template>
<template v-slot:append>
<div class="text-h5">
<em class="q-px-sm text-white rounded-borders" :style="`background-color: ` + (color ? color : '#ff5500')">{{ symbol }}</em>
</div>
</template>
<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) }}
<q-tooltip :offset="[10, 10]" v-model="showingtooltip">{{ tips }}</q-tooltip>
</div>
</template>
<template v-slot:append>
<div v-if="!small" :class="small ? `text-h7-dense` : `text-h5`">
<em class="q-px-sm text-white rounded-borders" :style="`background-color: ` + (color ? color : '#ff5500')">{{ symbol }}</em>
</div>
</template>
</q-field>
</div>
</q-field>
</div>
</div>
</template>

View File

@@ -168,6 +168,13 @@ export default defineComponent({
return []
}
},
filterextra: {
type: Array,
required: false,
default: () => {
return []
}
},
extraparams: {
required: false,
default: {},
@@ -763,6 +770,8 @@ export default defineComponent({
// @ts-ignore
filtercustom,
// @ts-ignore
filterextra: props.filterextra,
// @ts-ignore
filter_gte,
sortBy: myobj,
descending,

View File

@@ -21,7 +21,7 @@
<q-chip
v-if="circuit.status !== undefined && circuit.status !== 0" :color="circuitStore.getColorCircuitClass(circuit)"
text-color="white"
size="md"
size="sm"
:icon="globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'icon')">{{
globalStore.getValueByTableSingle('statuscircuit', circuit.status)
}}

View File

@@ -22,7 +22,7 @@
<q-chip
v-if="circuit.status !== undefined && circuit.status !== 0" :color="circuitStore.getColorCircuitClass(circuit)"
text-color="white"
size="md"
size="sm"
:icon="globalStore.getValueByTableSingle('statuscircuit', circuit.status, 'icon')">{{ globalStore.getValueByTableSingle('statuscircuit', circuit.status) }}
<q-btn
class="q-ml-sm"

View File

@@ -1,17 +1,19 @@
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
import { useUserStore } from '@store/UserStore'
import { IImgGallery, IUserFields, IUserProfile } from 'model'
import { ICircuit, IImgGallery, IUserFields, IUserProfile } from 'model'
import { costanti } from '@costanti'
import { shared_consts } from '@/common/shared_vuejs'
import { tools } from '@store/Modules/tools'
import { useQuasar } from 'quasar'
import { CSendCoins } from '@/components/CSendCoins'
import { CSaldo } from '@/components/CSaldo'
import { useI18n } from '@/boot/i18n'
import { useRoute, useRouter } from 'vue-router'
import { useCircuitStore } from '@store/CircuitStore'
export default defineComponent({
name: 'CMyUser',
components: { CSendCoins },
components: { CSendCoins, CSaldo },
emits: ['setCmd'],
props: {
mycontact: {
@@ -63,6 +65,7 @@ export default defineComponent({
setup(props, { emit }) {
const userStore = useUserStore()
const circuitStore = useCircuitStore()
const $q = useQuasar()
const { t } = useI18n()
const $router = useRouter()
@@ -72,6 +75,7 @@ export default defineComponent({
const showsendCoinTo = ref(false)
const contact = ref(<IUserFields | null>null)
const circuit = ref(<ICircuit | null | undefined>null)
watch(() => props.mycontact, (newval, oldval) => {
console.log('watch: mycontact')
@@ -91,6 +95,8 @@ export default defineComponent({
username.value = props.mycontact.username
}
}
circuit.value = circuitStore.getCircuitByName(props.circuitname)
}
function getImgUser(profile: IUserFields) {
@@ -121,6 +127,7 @@ export default defineComponent({
userStore,
tools,
showsendCoinTo,
circuit,
}
},
})

View File

@@ -15,9 +15,21 @@
<q-item-label v-if="contact.profile" caption lines="1"><em>{{ contact.profile.qualifica }}</em></q-item-label>
<q-item-label caption lines="1"></q-item-label>
<q-item-label v-if="labelFooter" lines="1"><em>{{ labelFooter }}</em></q-item-label>
<q-item-label v-if="contact.account" caption lines="2">
<CSaldo
:small="true"
:account="contact.account"
:symbol="tools.getSymbolByCircuit(circuit)"
:color="tools.getColorByCircuit(circuit)"
:saldo="contact.account.saldo"
>
</CSaldo>
</q-item-label>
</q-item-section>
<q-item-section side>
<q-btn
v-if="userStore.IsMyCircuitByUser(contact).length > 0 && contact.username !== userStore.my.username"
icon="fas fa-coins"

View File

@@ -13,6 +13,10 @@ import { colTableNotifCoins } from '@store/Modules/fieldsTable'
export default defineComponent({
name: 'CSaldo',
props: {
small: {
type: Boolean,
default: false,
},
symbol: {
type: String,
required: true,

View File

@@ -1,17 +1,27 @@
<template>
<CCurrencyValue
v-if="small"
:small="true"
:symbol="symbol"
:color_border="saldo > 0 ? `green` : `red`"
:color="color"
:value="saldo"
:label="t('account.saldo')">
</CCurrencyValue>
<CCurrencyValue
v-else
:symbol="symbol"
:tips="t('account.saldo_tips', {fido: qtarem, symbol})"
:color="color"
:value="saldo"
:valueextra="account && account.notifspending.length > 0 ? `* `: ''"
:valueextra="account && account.notifspending && account.notifspending.length > 0 ? `* `: ''"
:label="t('account.saldo') + ` (` + t('account.dispon') + `: ` + qtarem + `)`">
</CCurrencyValue>
<div v-if="account && account.notifspending.length > 0" :class="`text-h5 bordo_stondato_stretto full-width`"
<div v-if="!small && account && account.notifspending && account.notifspending.length > 0" :class="`text-h5 bordo_stondato_stretto full-width`"
:style="(!$q.screen.lt.sm ? `min-width: 250px; ` : ``) + (color_border ? `border-color: ` + color_border + `!important;`: '')">
<div class="text-center text-h7-dense text-italic text-grey-14">
{{ t('movement.pendingtransaction') }}

View File

@@ -281,7 +281,6 @@ export default defineComponent({
}
}
function myRuleEmail(val: string) {
return new Promise((resolve, reject) => {

View File

@@ -12,7 +12,7 @@
</q-banner>
<div class="row q-ma-sm q-pa-sm justify-center">
<q-btn class="q-ma-sm" color="primary" icon="fas fa-home" label="Vai alla Home" to="/"></q-btn>
<q-btn class="q-ma-sm" color="primary" icon="fas fa-home" label="Vai alla Home" to="/"></q-btn>
<q-btn class="q-ma-sm" color="accent" icon="fas fa-sign" label="Voglio vedere la pagina di Registrazione" @click="visureg = true"></q-btn>
<br>

View File

@@ -235,6 +235,21 @@ $heightBtn: 100%;
letter-spacing: .00937em;
}
.text-3d {
letter-spacing: .00937em;
font-size: 1rem;
text-shadow: 1rem 1rem 2rem #ff0;
}
.text-currency {
padding: 2px 2px;
font-size: 0.65rem;
font-weight: bold !important;
line-height: 1.55rem;
text-shadow: .0525rem .0525rem .125rem rgb(0, 0, 0);
letter-spacing: .00937em;
}
@media (max-width: 718px) {
// PER VERSIONE MOBILE
@@ -734,7 +749,11 @@ $heightBtn: 100%;
}
.text-h8{
font-size: 0.85rem;
font-size: 0.85rem !important;
}
.text-h9{
font-size: 0.65rem !important;
}
.bordo_stondato, .bordo_stondato_blu{
@@ -771,6 +790,16 @@ $heightBtn: 100%;
border: solid 3px #49b502;
}
.bordo_stondato_small{
margin: 0px;
border-radius: 2rem;
padding-left: 4px;
padding-right: 4px;
padding-top: 0px;
padding-bottom: 0px;
border: solid 2px #49b502;
}
.bordo_stondato_pending{
margin: 4px;
border-radius: 3rem;
@@ -1039,16 +1068,6 @@ $heightBtn: 100%;
}
.bordo_stondato_small{
margin: 4px;
border-radius: 1rem;
padding-left: 2px;
padding-right: 2px;
padding-top: 2px;
padding-bottom: 2px;
border: solid 2px #49b502;
}
.accom_num, .accom_maxosp {
font-size: 1.25rem;
background-color: green;
@@ -1171,3 +1190,11 @@ $heightBtn: 100%;
padding: 2px;
font-weight: bold;
}
.q-pa-xxs {
padding: 2px 2px;
}
.q-pa-sm2 {
padding: 12px 12px;
}

View File

@@ -573,6 +573,7 @@ export interface IParamsQuery {
filtersearch: string
filtersearch2: string
filtercustom: string
filterextra?: string
filter_gte: string
lookup1?: IParLookup
lookup2?: IParLookup

View File

@@ -93,6 +93,7 @@ export default defineComponent({
filtersearch: '',
filtersearch2: '',
filtercustom: '',
filterextra: '',
filter_gte: '',
sortBy: myobj,
descending,

View File

@@ -68,6 +68,10 @@ export const useCircuitStore = defineStore('CircuitStore', {
return 'red'
},
getCircuitByName(circuitname: string): ICircuit | undefined | null {
return this.listcircuits.find((rec: ICircuit) => rec.name === circuitname)
},
async loadCircuits() {
return Api.SendReq('/users/circuits', 'POST', null)
.then((res) => {

View File

@@ -2377,6 +2377,12 @@ export const colTableUsersISP = [
AddCol({
name: 'profile.teleg_id', field: 'profile', subfield: 'teleg_id', label_trans: 'reg.teleg_id',
}),
AddCol({
name: 'tokenreg', label_trans: 'reg.tokenreg',
}),
AddCol({
name: 'date_tokenreg', label_trans: 'reg.date_tokenreg',
}),
AddCol({
name: 'profile.teleg_id_old',
field: 'profile',

View File

@@ -49,13 +49,13 @@ export default defineComponent({
const path = computed(() => $route.params.path ? $route.params.path.toString() : '')
const idnotif = computed(() => $route.query.idnotif ? $route.query.idnotif.toString() : '')
const filtroutente = ref(<any[]>[])
const filtroutente = ref([] as any[])
const showPic = ref(false)
const circuit = ref(<ICircuit | null>{})
const circuit = ref({} as ICircuit | null)
const account = computed(() => circuit.value ? userStore.getAccountByCircuitId(circuit.value._id) : null)
const mystatus = ref(<number>0)
const users_in_circuit = ref(<IFriends[]>[])
const mystatus = ref(0 as number)
const users_in_circuit = ref([] as IFriends[])
const qtarem = computed(() => account.value ? circuitStore.getRemainingCoinsToSend(account.value) : 0)
const saldo = computed(() => account.value ? account.value.saldo : 0)
@@ -69,11 +69,12 @@ export default defineComponent({
const tab = ref('membri')
const arrfilterand: any = ref([])
const filterextra: any = ref([])
const filtercustom: any = ref([])
const filtercustom_rich: any = ref([])
const searchList = ref(<ISearchList[]>[])
const searchList = ref([] as ISearchList[])
const cities = ref(<ICity[]>[])
const cities = ref([] as ICity[])
watch(() => path.value, (to: any, from: any) => {
loadCircuit()
@@ -105,8 +106,8 @@ export default defineComponent({
searchList.value = []
if (circuit.value) {
filtercustom.value = [
{
filterextra.value = [
/*{
'profile.mycircuits':
{
$elemMatch: {
@@ -115,6 +116,71 @@ export default defineComponent({
}
}
},
*/
{
$match: {idapp: process.env.APP_ID,
'profile.mycircuits': {
$elemMatch: {circuitname: {$eq: circuit.value.name}},
},
},
},
{
$lookup: {
from: 'circuits',
as: 'circuit',
let: {circuitname: circuit.value.name, idapp: '$idapp'},
pipeline: [
{
$match:
{
$expr:
{
$and:
[
{$eq: ['$name', '$$circuitname']},
{$eq: ['$idapp', '$$idapp']},
],
},
},
},
],
},
},
{ $unwind: '$circuit'},
{
$project: { username: 1, profile: 1, idapp: 1, 'circuit.name': 1, 'circuit._id': 1 }
},
{
$lookup: {
from: 'accounts',
as: 'account',
let: {username: '$username', idapp: '$idapp', circuitId: '$circuit._id'},
pipeline: [
{
$match:
{
$expr:
{
$and:
[
{$eq: ['$$username', '$username']},
{$eq: ['$$idapp', '$idapp']},
{$eq: ['$$circuitId', '$circuitId']},
],
},
},
},
],
},
},
{ $unwind: '$account'},
]
}
arrfilterand.value = []
@@ -139,17 +205,17 @@ export default defineComponent({
}
function checkifShow(col: string) {
//++Todo: checkifShow Permessi !
// ++Todo: checkifShow Permessi !
return true
}
function extraparams() {
let lk_tab = 'users'
let lk_LF = 'userId'
let lk_FF = '_id'
let lk_as = 'user'
let af_objId_tab = 'myId'
const lk_tab = 'users'
const lk_LF = 'userId'
const lk_FF = '_id'
const lk_as = 'user'
const af_objId_tab = 'myId'
return {
lookup1: {
@@ -232,6 +298,7 @@ export default defineComponent({
t,
animation,
arrfilterand,
filterextra,
filtercustom,
filtercustom_rich,
searchList,

View File

@@ -132,6 +132,7 @@
noresultLabel="movimenti non trovati con questa ricerca"
:arrfilters="arrfilterand"
:filtercustom="filtercustom_rich"
:filterextra="filterextra"
:prop_searchList="searchList"
:prop_pagination="{ sortBy: 'transactionDate', descending: true, page: 1, rowsNumber: 20, rowsPerPage: 20 }"
:showType="costanti.SHOW_MOVEMENTS"
@@ -373,6 +374,7 @@
noresultLabel="Username non trovato"
:arrfilters="arrfilterand"
:filtercustom="filtercustom"
:filterextra="filterextra"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO"
:showCol="false"
@@ -403,6 +405,7 @@
:butt_modif_new="false"
noresultLabel="Username non trovato"
:arrfilters="arrfilterand"
:filterextra="filterextra"
:filtercustom="filtercustom_rich"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO"
@@ -435,6 +438,7 @@
noresultLabel="Username non trovato"
:arrfilters="arrfilterand"
:filtercustom="filtercustom_rich"
:filterextra="filterextra"
:prop_searchList="searchList"
:showType="costanti.SHOW_USERINFO"
keyMain=""