Add Movement !
This commit is contained in:
@@ -3,3 +3,26 @@ caret-square-down
|
||||
caret-down
|
||||
|
||||
user-minus
|
||||
|
||||
|
||||
<q-dialog v-model="shownote">
|
||||
<q-card v-if="eventsel" class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
Note: {{ eventsel.title }}
|
||||
</q-toolbar-title>
|
||||
<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-input
|
||||
v-model="eventsel.note" style="min-height: 50px; " label="Note:"
|
||||
filled dense
|
||||
autogrow
|
||||
type="textarea" debounce="500"
|
||||
input-class="myinput-area"
|
||||
@update:model-value="change_rec(eventsel)">
|
||||
</q-input>
|
||||
|
||||
</q-card-section>
|
||||
</q-card>
|
||||
</q-dialog>
|
||||
|
||||
@@ -85,6 +85,9 @@ export const shared_consts = {
|
||||
DELETE: 2170,
|
||||
ADDADMIN: 2180,
|
||||
REMOVEADMIN: 2185,
|
||||
SENDCOINS_REQ: 2200,
|
||||
SENDCOINS_ACCEPT: 2210,
|
||||
SENDCOINS_REFUSE: 2220,
|
||||
},
|
||||
|
||||
PUBTOSHARE: {
|
||||
@@ -938,6 +941,7 @@ export const shared_consts = {
|
||||
ID_CIRCUIT_REMOVED: 64,
|
||||
ID_CIRCUIT_ADDED_ADMIN: 128,
|
||||
ID_CIRCUIT_REMOVED_ADMIN: 256,
|
||||
ID_CIRCUIT_SENDCOINSREQ: 512,
|
||||
|
||||
TYPEDIR_BOOKING: 6,
|
||||
|
||||
|
||||
66
src/components/CSendCoins/CSendCoins.scss
Executable file
66
src/components/CSendCoins/CSendCoins.scss
Executable file
@@ -0,0 +1,66 @@
|
||||
$heightBtn: 100%;
|
||||
$grayshadow: #555;
|
||||
|
||||
.text-subtitle-carica {
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.75rem;
|
||||
letter-spacing: .00937em;
|
||||
text-shadow: .1rem .1rem .1rem $grayshadow;
|
||||
}
|
||||
|
||||
.text-subtitle-certificato {
|
||||
font-size: 0.75rem;
|
||||
line-height: 1rem;
|
||||
}
|
||||
|
||||
@media (max-width: 718px) {
|
||||
// PER VERSIONE MOBILE
|
||||
.text-subtitle-carica {
|
||||
font-size: 1rem;
|
||||
}
|
||||
}
|
||||
|
||||
.op {
|
||||
text-align: center !important;
|
||||
font-size: 1rem;
|
||||
font-weight: 400;
|
||||
line-height: 1.75rem;
|
||||
letter-spacing: .00937em;
|
||||
text-shadow: .1rem .1rem .1rem $grayshadow;
|
||||
|
||||
&__cell {
|
||||
font-size: 1rem;
|
||||
color: red;
|
||||
}
|
||||
|
||||
&__email {
|
||||
font-size: 1rem;
|
||||
color: #3b5998;
|
||||
}
|
||||
|
||||
&__email a {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&__facebook a {
|
||||
font-size: 1rem;
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
&__storia {
|
||||
margin-top: 1rem;
|
||||
margin-bottom: 1rem;
|
||||
text-align: justify;
|
||||
}
|
||||
}
|
||||
|
||||
.myimg {
|
||||
border-radius: 300px !important;
|
||||
}
|
||||
|
||||
.q-img {
|
||||
&__image {
|
||||
border-radius: 300px !important;
|
||||
}
|
||||
}
|
||||
101
src/components/CSendCoins/CSendCoins.ts
Executable file
101
src/components/CSendCoins/CSendCoins.ts
Executable file
@@ -0,0 +1,101 @@
|
||||
import { computed, defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
|
||||
import { ICircuit, IOperators, ISendCoin, ISpecialField, IUserFields } from '../../model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CSendCoins',
|
||||
emits: ['close'],
|
||||
props: {
|
||||
showprop: {
|
||||
type: Boolean,
|
||||
default: false,
|
||||
},
|
||||
to_user: {
|
||||
type: Object as PropType<IUserFields>,
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
const show = ref(false)
|
||||
const userStore = useUserStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
|
||||
|
||||
const from_username = ref(userStore.my.username)
|
||||
const circuitsel = ref('')
|
||||
const qty = ref(1)
|
||||
const causal = ref('')
|
||||
const bothcircuits = ref(<any>[])
|
||||
|
||||
const circuitloaded = ref(<ICircuit|undefined>undefined)
|
||||
|
||||
|
||||
watch(() => circuitsel.value, (newval, oldval) => {
|
||||
circuitloaded.value = circuitStore.listcircuits.find((rec: ICircuit) => rec.name === newval)
|
||||
})
|
||||
|
||||
watch(() => props.showprop, (newval, oldval) => {
|
||||
console.log('props.showprop', props.showprop, newval)
|
||||
show.value = newval
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
|
||||
|
||||
// ....
|
||||
|
||||
bothcircuits.value = userStore.IsMyCircuitByUser(props.to_user)
|
||||
|
||||
if (bothcircuits.value.length === 1) {
|
||||
circuitsel.value = bothcircuits.value[0]
|
||||
}
|
||||
|
||||
circuitloaded.value = circuitStore.listcircuits.find((rec: ICircuit) => rec.name === circuitsel.value)
|
||||
|
||||
show.value = true
|
||||
}
|
||||
|
||||
function hide() {
|
||||
emit('close', true)
|
||||
}
|
||||
|
||||
function sendCoin() {
|
||||
console.log('sendcoin', qty.value, props.to_user.username)
|
||||
|
||||
if (props.to_user.username && qty.value && circuitloaded.value) {
|
||||
const myrecsendcoin: ISendCoin = {
|
||||
qty: qty.value,
|
||||
dest: props.to_user.username,
|
||||
circuitname: circuitsel.value,
|
||||
causal: causal.value,
|
||||
symbol: circuitloaded.value.symbol,
|
||||
}
|
||||
console.log('myrecsendcoin', myrecsendcoin)
|
||||
if (circuitloaded.value) {
|
||||
tools.sendCoinsByCircuit($q, circuitloaded.value, myrecsendcoin)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
tools,
|
||||
show,
|
||||
bothcircuits,
|
||||
from_username,
|
||||
circuitsel,
|
||||
circuitloaded,
|
||||
qty,
|
||||
hide,
|
||||
sendCoin,
|
||||
causal,
|
||||
}
|
||||
},
|
||||
})
|
||||
51
src/components/CSendCoins/CSendCoins.vue
Executable file
51
src/components/CSendCoins/CSendCoins.vue
Executable file
@@ -0,0 +1,51 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-dialog v-model="show" :maximized="$q.screen.lt.sm" @hide="hide">
|
||||
<q-card class="dialog_card">
|
||||
<q-toolbar class="bg-primary text-white">
|
||||
<q-toolbar-title>
|
||||
{{ $t('circuit.sendcoins') }}
|
||||
</q-toolbar-title>
|
||||
<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 rounded outlined v-model="circuitsel" :options="bothcircuits" label="Circuito">
|
||||
</q-select>
|
||||
|
||||
<q-input v-model="from_username" label="Mittente" class="full-width" disable>
|
||||
</q-input>
|
||||
<q-input v-model="to_user.username" label="Destinatario" class="full-width" disable>
|
||||
</q-input>
|
||||
<q-input v-model="causal" label="Causale" class="full-width">
|
||||
</q-input>
|
||||
|
||||
<q-input outlined v-model="qty" type="number"
|
||||
|
||||
label="Quantità"
|
||||
:prefix="circuitloaded.symbol">
|
||||
<template v-slot:append>
|
||||
<q-avatar>
|
||||
<img src="https://cdn.quasar.dev/logo-v2/svg/logo.svg">
|
||||
</q-avatar>
|
||||
</template>
|
||||
</q-input>
|
||||
|
||||
</q-card-section>
|
||||
<q-card-actions align="center">
|
||||
<q-btn
|
||||
:label="$t('circuit.sendcoinsto', {qty, coin: circuitsel, dest: to_user.username })" color="primary"
|
||||
@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>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CSendCoins.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CSendCoins.scss';
|
||||
</style>
|
||||
1
src/components/CSendCoins/index.ts
Executable file
1
src/components/CSendCoins/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export {default as CSendCoins} from './CSendCoins.vue'
|
||||
@@ -60,3 +60,4 @@ export * from './CFundRaising'
|
||||
export * from './CKeyAndValue'
|
||||
export * from './CNotifSettings'
|
||||
// export * from './CPreloadImages'
|
||||
export * from './CSendCoins'
|
||||
|
||||
@@ -152,6 +152,27 @@
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
<q-item-label caption lines="2" v-else-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-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-plus"
|
||||
color="positive" :label="$t('circuit.accept_coins')"
|
||||
@click="tools.acceptCoins($q, notif.sender, notif.extrarec)"
|
||||
/>
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-minus"
|
||||
color="negative" :label="$t('circuit.refuse_coins')"
|
||||
@click="tools.refuseCoins($q, notif.sender, notif.extrarec)"
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption lines="1" :class="(!notif.read) ? 'unread-date' : 'read-date'" @click="clickNotif(notif)">
|
||||
{{ tools.timeAgo(notif.datenotif) }}
|
||||
|
||||
@@ -246,6 +246,10 @@ export interface IMetaTags {
|
||||
description?: string
|
||||
}
|
||||
|
||||
export interface ICircuitState {
|
||||
listcircuits: ICircuit[]
|
||||
}
|
||||
|
||||
export interface IGlobalState {
|
||||
finishLoading: boolean
|
||||
conta: number
|
||||
@@ -895,8 +899,16 @@ export interface IMyCircuit {
|
||||
date: Date
|
||||
}
|
||||
|
||||
export interface ISendCoin {
|
||||
circuitname: string
|
||||
qty: number
|
||||
dest: string
|
||||
causal: string
|
||||
symbol: string
|
||||
}
|
||||
|
||||
export interface ICircuit {
|
||||
_id: number
|
||||
Num: number
|
||||
groupnameId: string
|
||||
name: string
|
||||
path: string
|
||||
@@ -932,6 +944,7 @@ export interface ICircuit {
|
||||
export interface IAccount {
|
||||
username: string
|
||||
circuitId: number
|
||||
circuit: ICircuit
|
||||
name: string
|
||||
deperibile?: boolean
|
||||
importo_iniziale?: number
|
||||
|
||||
@@ -64,6 +64,7 @@ export const NotifDefault: INotif = {
|
||||
deleted: false,
|
||||
status: StatusMessage.None,
|
||||
extrafield: '',
|
||||
extrarec: '',
|
||||
}
|
||||
|
||||
export interface IMessage {
|
||||
@@ -98,6 +99,7 @@ export interface INotif {
|
||||
idrec?: string
|
||||
deleted?: boolean
|
||||
extrafield?: string
|
||||
extrarec?: any
|
||||
}
|
||||
|
||||
export interface IChat {
|
||||
|
||||
@@ -105,6 +105,7 @@ export interface IUserProfile {
|
||||
asked_circuits: any[]
|
||||
refused_circuits: any[]
|
||||
manage_mycircuits: ICircuit[]
|
||||
useraccounts: IAccount[]
|
||||
}
|
||||
|
||||
export interface IPaymentType {
|
||||
|
||||
@@ -1147,6 +1147,15 @@ const msg_it = {
|
||||
domanda_removeadminofcircuit: 'Rimuovere {username} dall\' incarico di Amministratore del CIrcuito {circuitname} ?',
|
||||
domanda_refuse_circuit: 'Rifiutare la richiesta di {username} per entrare nel Circuito {circuitname}?',
|
||||
refusedcircuit: 'Rifiutato a {username} la richiesta di entrare nel Circuito',
|
||||
sendcoins: 'Invia Monete',
|
||||
sendcoinsto: 'Invia {qty} {coin} a {dest}',
|
||||
question_sendcoinsto: 'Inviare {qty} {coin} a {dest}?',
|
||||
coins_sendrequest_sent: 'Richiesta d\'invio monete avvenuto',
|
||||
coins_sendrequest_failed: 'Richiesta d\'invio monete non avvenuta, riprovare',
|
||||
coins_accepted: 'Monete accettate',
|
||||
coins_refused: 'Monete rifiutate',
|
||||
accept_coins: 'Accetta Monete',
|
||||
refuse_coins: 'Rifiuta Monete',
|
||||
},
|
||||
|
||||
account: {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import {
|
||||
ICircuit,
|
||||
ICircuit, ICircuitState, IGlobalState,
|
||||
} from '@src/model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import translate from '@src/globalroutines/util'
|
||||
@@ -20,7 +20,7 @@ import { costanti } from '@costanti'
|
||||
import globalroutines from '../globalroutines/index'
|
||||
|
||||
export const useCircuitStore = defineStore('CircuitStore', {
|
||||
state: () => ({
|
||||
state: (): ICircuitState => ({
|
||||
listcircuits: []
|
||||
}),
|
||||
|
||||
@@ -29,6 +29,7 @@ export const useCircuitStore = defineStore('CircuitStore', {
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
||||
getImgByCircuit(circ: ICircuit): string {
|
||||
|
||||
try {
|
||||
|
||||
@@ -12,7 +12,7 @@ import {
|
||||
ITodo,
|
||||
IUserFields,
|
||||
Privacy,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit,
|
||||
TipoVisu, IGroup, IMySkill, IMyBacheca, IImgGallery, IMsgGlobParam, IUserExport, ISpecialField, IAccount, IMyCircuit, ISendCoin,
|
||||
} from '@model'
|
||||
|
||||
import { addToDate } from '@quasar/quasar-ui-qcalendar'
|
||||
@@ -4784,6 +4784,29 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
|
||||
acceptCoins($q: any, username: string, recsendcoin: ISendCoin) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
userStore.setCircuitCmd($q, t, username, recsendcoin.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_ACCEPT, 0, recsendcoin)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
tools.showPositiveNotif($q, t('circuit.coins_accepted'))
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
refuseCoins($q: any, username: string, recsendcoin: ISendCoin) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
userStore.setCircuitCmd($q, t, username, recsendcoin.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_REFUSE, recsendcoin)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
tools.showPositiveNotif($q, t('circuit.coins_refused'))
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
refuseReqGroup($q: any, username: string, groupnameDest: string) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
@@ -4863,7 +4886,7 @@ export const tools = {
|
||||
const mygrp = userStore.my.profile.manage_mygroups.find((rec: IMyGroup) => rec.groupname === groupnameDest)
|
||||
console.log('mygrp', mygrp)
|
||||
if (mygrp && mygrp.admins) {
|
||||
mygrp.admins = [...mygrp.admins, {username, date: new Date}]
|
||||
mygrp.admins = [...mygrp.admins, { username, date: new Date }]
|
||||
console.log('mygrp.admins', mygrp.admins)
|
||||
tools.showPositiveNotif($q, t('db.addedtoadmin', { username }))
|
||||
}
|
||||
@@ -5236,6 +5259,39 @@ export const tools = {
|
||||
})
|
||||
},
|
||||
|
||||
sendCoinsByCircuit($q: any, circuit: ICircuit, sendcoinrec: ISendCoin) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
|
||||
const username = userStore.my.username
|
||||
|
||||
let msg = ''
|
||||
msg = t('circuit.question_sendcoinsto', { coin: circuit.symbol, dest: sendcoinrec.dest, qty: sendcoinrec.qty })
|
||||
|
||||
$q.dialog({
|
||||
message: msg,
|
||||
ok: {
|
||||
label: t('dialog.yes'),
|
||||
push: true
|
||||
},
|
||||
cancel: {
|
||||
label: t('dialog.cancel')
|
||||
},
|
||||
title: t('db.domanda')
|
||||
}).onOk(() => {
|
||||
|
||||
userStore.setCircuitCmd($q, t, username, sendcoinrec.circuitname, shared_consts.CIRCUITCMD.SENDCOINS_REQ, true, sendcoinrec)
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
tools.showPositiveNotif($q, t('circuit.coins_sendrequest_sent'))
|
||||
|
||||
} else {
|
||||
tools.showNegativeNotif($q, t('db.coins_sendrequest_failed'))
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
cancelReqCircuit($q: any, username: string, circuitname: string) {
|
||||
const userStore = useUserStore()
|
||||
$q.dialog({
|
||||
@@ -5315,7 +5371,7 @@ export const tools = {
|
||||
const mycircuit = userStore.my.profile.manage_mycircuits.find((rec: ICircuit) => rec.name === circuitname)
|
||||
console.log('mycircuit', mycircuit)
|
||||
if (mycircuit && mycircuit.admins) {
|
||||
mycircuit.admins = [...mycircuit.admins, {username, date: new Date}]
|
||||
mycircuit.admins = [...mycircuit.admins, { username, date: new Date }]
|
||||
console.log('mycircuit.admins', mycircuit.admins)
|
||||
tools.showPositiveNotif($q, t('db.addedtoadmin', { username }))
|
||||
}
|
||||
@@ -5362,7 +5418,7 @@ export const tools = {
|
||||
if (res) {
|
||||
if (userStore.my.profile.manage_mycircuits) {
|
||||
userStore.my.profile.manage_mycircuits = userStore.my.profile.manage_mycircuits.filter((rec: ICircuit) => rec.name !== circuitname)
|
||||
tools.showPositiveNotif($q, t('circuit.deleted', { circuitname } ))
|
||||
tools.showPositiveNotif($q, t('circuit.deleted', { circuitname }))
|
||||
}
|
||||
}
|
||||
})
|
||||
@@ -6151,7 +6207,7 @@ export const tools = {
|
||||
VUE_APP_BACKEND_API_URL: window?.appConfig?.VUE_APP_BACKEND_API_URL || process.env.VUE_APP_BACKEND_API_URL
|
||||
}
|
||||
|
||||
return config[name];
|
||||
return config[name]
|
||||
},
|
||||
|
||||
getArrSector(table: string, rec: any) {
|
||||
@@ -6160,7 +6216,7 @@ export const tools = {
|
||||
else if ((table === toolsext.TABMYBACHECAS) || (table === toolsext.TABMYSKILLS))
|
||||
return rec.sector
|
||||
else if (table === toolsext.TABMYGROUPS)
|
||||
return [{descr: rec.sector}]
|
||||
return [{ descr: rec.sector }]
|
||||
else if (table === toolsext.TABMYHOSPS)
|
||||
return []
|
||||
|
||||
@@ -6178,8 +6234,35 @@ export const tools = {
|
||||
return []
|
||||
|
||||
|
||||
},
|
||||
|
||||
findCommonElements(arr1: any, arr2: any) {
|
||||
return arr1.some((item: any) => arr2.includes(item))
|
||||
},
|
||||
|
||||
// Function to return commonElements
|
||||
getCommon(arr1: any, arr2: any, field: string): any[] {
|
||||
arr1.sort((a: any, b: any) => b[field] - a[field]) // Sort both the arrays
|
||||
arr2.sort((a: any, b: any) => b[field] - a[field])
|
||||
let common = [] // Array to contain common elements
|
||||
let i = 0, j = 0 // i points to arr1 and j to arr2
|
||||
// Break if one of them runs out
|
||||
while (i < arr1.length && j < arr2.length) {
|
||||
|
||||
if (arr1[i][field] == arr2[j][field]) { // If both are same, add it to result
|
||||
common.push(arr1[i][field])
|
||||
i++
|
||||
j++
|
||||
} else if (arr1[i][field] < arr2[j][field]) { // Increment the smaller value so that
|
||||
i++ // it could be matched with the larger
|
||||
} // element
|
||||
else {
|
||||
j++
|
||||
}
|
||||
}
|
||||
|
||||
return common
|
||||
},
|
||||
// getLocale() {
|
||||
// if (navigator.languages && navigator.languages.length > 0) {
|
||||
// return navigator.languages[0]
|
||||
|
||||
@@ -4,7 +4,7 @@ import {
|
||||
ICircuit, IMyCircuit,
|
||||
IFriends, IMsgGlobParam,
|
||||
ISigninOptions,
|
||||
ISignupOptions, IUserFields, IUserNotifType, IUserProfile, IUserState,
|
||||
ISignupOptions, IUserFields, IUserNotifType, IUserProfile, IUserState, IAccount,
|
||||
} from '@src/model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import translate from '@src/globalroutines/util'
|
||||
@@ -68,6 +68,7 @@ export const DefaultUser: IUserFields = {
|
||||
asked_circuits: [],
|
||||
refused_circuits: [],
|
||||
manage_mycircuits: [],
|
||||
useraccounts: [],
|
||||
},
|
||||
cart: {
|
||||
userId: '',
|
||||
@@ -125,6 +126,7 @@ export const DefaultProfile: IUserProfile = {
|
||||
asked_circuits: [],
|
||||
refused_circuits: [],
|
||||
manage_mycircuits: [],
|
||||
useraccounts: [],
|
||||
}
|
||||
|
||||
export const useUserStore = defineStore('UserStore', {
|
||||
@@ -305,6 +307,16 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
IsMyCircuitByUser(user: IUserFields): any[] {
|
||||
|
||||
return tools.getCommon(this.my.profile.mycircuits, user.profile.mycircuits, 'circuitname')
|
||||
},
|
||||
|
||||
|
||||
getAccountByCircuitName(circuitname: string): any {
|
||||
return this.my.profile.useraccounts.find((rec: IAccount) => rec.circuit.name === circuitname)
|
||||
},
|
||||
|
||||
IsRefusedCircuitByName(circuitname: string): boolean {
|
||||
if (this.my.profile.refused_circuits)
|
||||
return this.my.profile.refused_circuits.findIndex((rec: ICircuit) => rec.name === circuitname) >= 0
|
||||
@@ -1210,8 +1222,8 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async setCircuitCmd($q: any, t: any, usernameOrig: string, circuitname: string, cmd: number, value: any) {
|
||||
return Api.SendReq('/users/circuits/cmd', 'POST', { usernameOrig, circuitname, cmd, value })
|
||||
async setCircuitCmd($q: any, t: any, usernameOrig: string, circuitname: string, cmd: number, value: any, extrarec?: any) {
|
||||
return Api.SendReq('/users/circuits/cmd', 'POST', { usernameOrig, circuitname, cmd, value, extrarec })
|
||||
.then((res) => {
|
||||
this.updateTables = true
|
||||
return res.data
|
||||
|
||||
@@ -31,6 +31,7 @@ import translate from '@src/globalroutines/util'
|
||||
import { useTodoStore } from '@store/Todos'
|
||||
import { useMessageStore } from './MessageStore'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
|
||||
|
||||
const stateConnDefault = 'online'
|
||||
@@ -1311,6 +1312,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
async loadSite() {
|
||||
const userStore = useUserStore()
|
||||
const calendarStore = useCalendarStore()
|
||||
const circuitStore = useCircuitStore()
|
||||
// console.log('calendarStore: loadAfterLogin')
|
||||
// Load local data
|
||||
const showall = userStore.isAdmin || userStore.isManager ? '1' : '0'
|
||||
@@ -1332,6 +1334,8 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
calendarStore.wheres = (res.data.wheres) ? res.data.wheres : []
|
||||
calendarStore.contribtype = (res.data.contribtype) ? res.data.contribtype : []
|
||||
|
||||
circuitStore.listcircuits = (res.data.listcircuits) ? res.data.listcircuits : []
|
||||
|
||||
this.settings = (res.data.settings) ? [...res.data.settings] : []
|
||||
this.disciplines = (res.data.disciplines) ? [...res.data.disciplines] : []
|
||||
this.paymenttypes = (res.data.paymenttypes) ? [...res.data.paymenttypes] : []
|
||||
@@ -1356,6 +1360,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
this.mygroups = (res.data.mygroups) ? [...res.data.mygroups] : []
|
||||
this.adtypes = (res.data.adtypes) ? [...res.data.adtypes] : []
|
||||
this.adtypegoods = (res.data.adtypegoods) ? [...res.data.adtypegoods] : []
|
||||
circuitStore.listcircuits = (res.data.listcircuits) ? [...res.data.listcircuits] : []
|
||||
|
||||
// console.log('res.data.cart', res.data.cart)
|
||||
|
||||
@@ -1670,7 +1675,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
myserv = window.location.host
|
||||
|
||||
if (process.env.DEBUGGING) {
|
||||
myserv = 'http://192.168.1.54:3000'
|
||||
myserv = ' http://192.168.1.102:3000'; // 'http://192.168.1.54:3000'
|
||||
}
|
||||
|
||||
if (!myserv) {
|
||||
|
||||
@@ -16,7 +16,7 @@ import { useI18n } from '@/boot/i18n'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { ICity, IFriends, ICircuit, ISearchList, IUserFields } from 'model'
|
||||
import { ICity, IFriends, ICircuit, ISearchList, IUserFields, IAccount } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { colmyUserPeople, colmyUserCircuit } from '@store/Modules/fieldsTable'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
@@ -42,6 +42,7 @@ export default defineComponent({
|
||||
const showPic = ref(false)
|
||||
|
||||
const circuit = ref(<ICircuit|null>{})
|
||||
const account = ref(<IAccount|null>{})
|
||||
const mystatus = ref(<number>0)
|
||||
const users_in_circuit = ref(<IFriends[]>[])
|
||||
|
||||
@@ -81,6 +82,9 @@ export default defineComponent({
|
||||
users_in_circuit.value = []
|
||||
}
|
||||
|
||||
if (circuit.value)
|
||||
account.value = userStore.getAccountByCircuitName(circuit.value.name)
|
||||
|
||||
mystatus.value = status
|
||||
|
||||
loading.value = false
|
||||
@@ -146,14 +150,14 @@ export default defineComponent({
|
||||
function extraparams_rich() {
|
||||
return {
|
||||
querytype: shared_consts.QUERYTYPE_CIRCUIT,
|
||||
myid: circuit.value ? circuit.value._id : '',
|
||||
myid: circuit.value ? circuit.value.Num : '',
|
||||
}
|
||||
}
|
||||
|
||||
function extraparams_refused() {
|
||||
return {
|
||||
querytype: shared_consts.QUERYTYPE_REFUSED_USER_CIRCUIT,
|
||||
myid: circuit.value ? circuit.value._id : '',
|
||||
myid: circuit.value ? circuit.value.Num : '',
|
||||
}
|
||||
}
|
||||
|
||||
@@ -175,6 +179,7 @@ export default defineComponent({
|
||||
tools,
|
||||
costanti,
|
||||
circuit,
|
||||
account,
|
||||
shared_consts,
|
||||
getImgCircuit,
|
||||
checkifShow,
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<div class="q-gutter-sm q-pa-sm q-pb-md">
|
||||
<div v-if="!circuit && !loading">
|
||||
<div v-if="mystatus === 403">
|
||||
<h3>Non hai i permessi per accedere al Gruppo.<br>
|
||||
<h3>Non hai i permessi per accedere al Circuito.<br>
|
||||
|
||||
Occorre prima registrarsi alla App </h3>
|
||||
</div>
|
||||
@@ -39,6 +39,10 @@
|
||||
<em style="font-weight: bold">{{ $t('db.youarerefusedcircuit') }}</em><br>
|
||||
</q-banner>
|
||||
|
||||
<div v-if="account">
|
||||
Saldo: {{ account.saldo}}
|
||||
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<q-btn
|
||||
|
||||
@@ -8,6 +8,7 @@ import { CSkill } from '@/components/CSkill'
|
||||
import { CDateTime } from '@/components/CDateTime'
|
||||
import { CMyGroup } from '@/components/CMyGroup'
|
||||
import { CMyCircuit } from '@/components/CMyCircuit'
|
||||
import { CSendCoins } from '@/components/CSendCoins'
|
||||
import { CMyUser } from '@/components/CMyUser'
|
||||
import { CUserNonVerif } from '@/components/CUserNonVerif'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
@@ -31,7 +32,7 @@ export default defineComponent({
|
||||
name: 'myprofile',
|
||||
components: {
|
||||
CProfile, CTitleBanner, CMyFieldDb, CSkill, CDateTime, CCopyBtn, CUserNonVerif, CMyFieldRec, CMyUser,
|
||||
CMyGroup, CLabel, CMyCircuit
|
||||
CMyGroup, CLabel, CMyCircuit, CSendCoins
|
||||
},
|
||||
props: {},
|
||||
setup() {
|
||||
@@ -51,6 +52,7 @@ export default defineComponent({
|
||||
const filtroutente = ref(<any[]>[])
|
||||
const showPic = ref(false)
|
||||
const caricato = ref(false)
|
||||
const showsendCoinTo = ref(false)
|
||||
|
||||
const myuser = ref(<IUserFields | null>null)
|
||||
|
||||
@@ -184,6 +186,7 @@ export default defineComponent({
|
||||
caricato,
|
||||
listgroupsfiltered,
|
||||
idnotif,
|
||||
showsendCoinTo,
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
@@ -151,6 +151,18 @@
|
||||
:href="getLinkUserTelegram()" target="__blank">
|
||||
</q-btn>
|
||||
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
v-if="userStore.IsMyCircuitByUser(myuser).length > 0" icon="fab fa-telegram"
|
||||
color="blue"
|
||||
size="md"
|
||||
rounded
|
||||
:label="$t('circuit.sendcoins')"
|
||||
@click="showsendCoinTo = true"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
</div>
|
||||
<div v-if="myuser._id" class="col-md-6 col-sm-6 q-ma-xs col-xs-12">
|
||||
<q-btn
|
||||
@@ -299,6 +311,16 @@
|
||||
<img :src="getImgUser()" :alt="username" class="full-width">
|
||||
|
||||
</q-dialog>
|
||||
showsendCoinTo: {{ showsendCoinTo}}
|
||||
<div v-if="showsendCoinTo">
|
||||
<CSendCoins
|
||||
:showprop="showsendCoinTo"
|
||||
:to_user="myuser"
|
||||
@close="showsendCoinTo = false"
|
||||
>
|
||||
|
||||
</CSendCoins>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else-if="caricato">
|
||||
<h2>Utente {{ username }} non trovato</h2>
|
||||
|
||||
Reference in New Issue
Block a user