fix Saldo when press refuse coins.
fix Risolvere problema del ritardo quando si fa il primo login...
This commit is contained in:
@@ -1,17 +1,17 @@
|
||||
APP_VERSION="0.5.1"
|
||||
APP_VERSION="0.5.6"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
DIRECTORY_SERVER="freeplanet_serverside"
|
||||
SERVERDIR_WEBSITE=""
|
||||
SERVERPW_WEBSITE=""
|
||||
APP_URL="http://localhost"
|
||||
APP_URL="https://localhost"
|
||||
URL_FACEBOOK="https://www.facebook.com/freeplanetapp"
|
||||
PROVA_PAOLO="PROVA ENV FUNZIONA!"
|
||||
LANG_DEFAULT="it"
|
||||
PAO_APP_ID="KKPPAA5KJK435J3KSS9F9D8S9F8SD98F9SDF"
|
||||
MASTER_KEY="KKPPSS5KJK435J3KSS9F9D8S9F8SD3CR3T"
|
||||
MONGODB_HOST="http://localhost:3000"
|
||||
MONGODB_HOST="https://localhost:3000"
|
||||
LOGO_REG='riso-logo-full.png'
|
||||
TEST_NAME="Paolo"
|
||||
TEST_SURNAME="Arena"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.1"
|
||||
APP_VERSION="0.5.6"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.1"
|
||||
APP_VERSION="0.5.6"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.1"
|
||||
APP_VERSION="0.5.6"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="12"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.1"
|
||||
APP_VERSION="0.5.6"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.1"
|
||||
APP_VERSION="0.5.6"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="13"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -20,6 +20,7 @@ const functionality: IFunctionality = {
|
||||
SHOW_IF_IS_SERVER_CONNECTION: false,
|
||||
SHOW_MESSAGES: false,
|
||||
SHOW_NOTIF: true,
|
||||
SHOW_COINS: true,
|
||||
BOOKING_EVENTS: true,
|
||||
ENABLE_ECOMMERCE: false,
|
||||
ENABLE_REG_ISP: true,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.1"
|
||||
APP_VERSION="0.5.6"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="14"
|
||||
DIRECTORY_LOCAL="newfreeplanet"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
APP_VERSION="0.5.1"
|
||||
APP_VERSION="0.5.6"
|
||||
SERVICE_WORKER_FILE="service-worker.js"
|
||||
APP_ID="14"
|
||||
DIRECTORY_LOCAL=newfreeplanet
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "riso",
|
||||
"version": "0.5.1",
|
||||
"version": "0.5.3",
|
||||
"description": "Siamo la Rete Italiana di Scambio Orizzontale, abbiamo creato questa piattaforma per metterla al servizio di chi vuole riscoprire il valore della condivisione e della cooperazione. Valori semplici e profondi che ci aiutano a ritrovare il Senso della Vita, perduto in questa società consumista, e riporti quei Sani Pricìpi Naturali ed Umani di Fratellanza che intere popolazioni antiche conoscevano bene.",
|
||||
"productName": "Riso",
|
||||
"author": "Paolo Arena",
|
||||
@@ -113,7 +113,7 @@
|
||||
"typescript": "^4.8.2",
|
||||
"vue-cli-plugin-element-ui": "^1.1.4",
|
||||
"vueify": "^9.4.1",
|
||||
"webpack": "^5.0.0",
|
||||
"webpack": "^5.74.0",
|
||||
"workbox-webpack-plugin": "^6.5.4"
|
||||
},
|
||||
"browser": {
|
||||
|
||||
@@ -2,7 +2,7 @@ function geturl() {
|
||||
const miaurl = document.location.href
|
||||
|
||||
if (miaurl.includes('localhost')) {
|
||||
// return 'http://192.168.170.47:8084'
|
||||
return 'https://127.0.0.1:8084'
|
||||
}
|
||||
return ''
|
||||
}
|
||||
|
||||
2
public/js/workbox-sw-6-1.js
Executable file
2
public/js/workbox-sw-6-1.js
Executable file
@@ -0,0 +1,2 @@
|
||||
!function(){'use strict';try{self['workbox:sw:6.1.0']&&_()}catch(t){}const t={backgroundSync:'background-sync',broadcastUpdate:'broadcast-update',cacheableResponse:'cacheable-response',core:'core',expiration:'expiration',googleAnalytics:'offline-ga',navigationPreload:'navigation-preload',precaching:'precaching',rangeRequests:'range-requests',routing:'routing',strategies:'strategies',streams:'streams',recipes:'recipes'};self.workbox=new class{constructor(){return this.v={},this.Pt={debug:'localhost'===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.$t=this.Pt.debug?'dev':'prod',this.jt=!1,new Proxy(this,{get(e,s){if(e[s])return e[s];const o=t[s];return o&&e.loadModule('workbox-'+o),e[s]}})}setConfig(t={}){if(this.jt)throw new Error('Config must be set before accessing workbox.* modules');Object.assign(this.Pt,t),this.$t=this.Pt.debug?'dev':'prod'}loadModule(t){const e=this.St(t);try{importScripts(e),this.jt=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}St(t){if(this.Pt.modulePathCb)return this.Pt.modulePathCb(t,this.Pt.debug);let e=['https://storage.googleapis.com/workbox-cdn/releases/6.1.0'];const s=`${t}.${this.$t}.js`,o=this.Pt.modulePathPrefix;return o&&(e=o.split('/'),''===e[e.length-1]&&e.splice(e.length-1,1)),e.push(s),e.join('/')}}}();
|
||||
//# sourceMappingURL=workbox-sw.js.map
|
||||
2
public/js/workbox-sw.js
Executable file → Normal file
2
public/js/workbox-sw.js
Executable file → Normal file
@@ -1,2 +1,2 @@
|
||||
!function(){'use strict';try{self['workbox:sw:6.1.0']&&_()}catch(t){}const t={backgroundSync:'background-sync',broadcastUpdate:'broadcast-update',cacheableResponse:'cacheable-response',core:'core',expiration:'expiration',googleAnalytics:'offline-ga',navigationPreload:'navigation-preload',precaching:'precaching',rangeRequests:'range-requests',routing:'routing',strategies:'strategies',streams:'streams',recipes:'recipes'};self.workbox=new class{constructor(){return this.v={},this.Pt={debug:'localhost'===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.$t=this.Pt.debug?'dev':'prod',this.jt=!1,new Proxy(this,{get(e,s){if(e[s])return e[s];const o=t[s];return o&&e.loadModule('workbox-'+o),e[s]}})}setConfig(t={}){if(this.jt)throw new Error('Config must be set before accessing workbox.* modules');Object.assign(this.Pt,t),this.$t=this.Pt.debug?'dev':'prod'}loadModule(t){const e=this.St(t);try{importScripts(e),this.jt=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}St(t){if(this.Pt.modulePathCb)return this.Pt.modulePathCb(t,this.Pt.debug);let e=['https://storage.googleapis.com/workbox-cdn/releases/6.1.0'];const s=`${t}.${this.$t}.js`,o=this.Pt.modulePathPrefix;return o&&(e=o.split('/'),''===e[e.length-1]&&e.splice(e.length-1,1)),e.push(s),e.join('/')}}}();
|
||||
!function(){"use strict";try{self["workbox:sw:5.1.4"]&&_()}catch(t){}const t={backgroundSync:"background-sync",broadcastUpdate:"broadcast-update",cacheableResponse:"cacheable-response",core:"core",expiration:"expiration",googleAnalytics:"offline-ga",navigationPreload:"navigation-preload",precaching:"precaching",rangeRequests:"range-requests",routing:"routing",strategies:"strategies",streams:"streams"};self.workbox=new class{constructor(){return this.v={},this.t={debug:"localhost"===self.location.hostname,modulePathPrefix:null,modulePathCb:null},this.s=this.t.debug?"dev":"prod",this.o=!1,new Proxy(this,{get(e,s){if(e[s])return e[s];const o=t[s];return o&&e.loadModule("workbox-"+o),e[s]}})}setConfig(t={}){if(this.o)throw new Error("Config must be set before accessing workbox.* modules");Object.assign(this.t,t),this.s=this.t.debug?"dev":"prod"}loadModule(t){const e=this.i(t);try{importScripts(e),this.o=!0}catch(s){throw console.error(`Unable to import module '${t}' from '${e}'.`),s}}i(t){if(this.t.modulePathCb)return this.t.modulePathCb(t,this.t.debug);let e=["https://storage.googleapis.com/workbox-cdn/releases/5.1.4"];const s=`${t}.${this.s}.js`,o=this.t.modulePathPrefix;return o&&(e=o.split("/"),""===e[e.length-1]&&e.splice(e.length-1,1)),e.push(s),e.join("/")}}}();
|
||||
//# sourceMappingURL=workbox-sw.js.map
|
||||
|
||||
@@ -10,19 +10,21 @@ import {
|
||||
CacheFirst,
|
||||
} from 'workbox-strategies'
|
||||
|
||||
const ENABLE_DYNAMIC_CACHING = false;
|
||||
|
||||
// Used for filtering matches based on status code, header, or both
|
||||
import { CacheableResponsePlugin } from 'workbox-cacheable-response'
|
||||
// Used to limit entries in cache, remove entries after a certain period of time
|
||||
import { ExpirationPlugin } from 'workbox-expiration'
|
||||
|
||||
console.log(
|
||||
' [ VER-0.5.1 ] _---------________------ PAO: this is my custom service worker')
|
||||
' [ VER-0.5.4 ] _---------________------ PAO: this is my custom service worker')
|
||||
|
||||
importScripts('js/idb.js')
|
||||
importScripts('js/storage.js')
|
||||
// importScripts('js/workbox-sw.js')
|
||||
importScripts('js/workbox-sw.js')
|
||||
|
||||
importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.4/workbox-sw.js');
|
||||
// importScripts('https://storage.googleapis.com/workbox-cdn/releases/5.1.4/workbox-sw.js');
|
||||
|
||||
|
||||
|
||||
@@ -34,7 +36,7 @@ let port = 3000
|
||||
if (self.location.hostname.startsWith('test')) {
|
||||
port = 3001
|
||||
}
|
||||
console.log('SW-06 1')
|
||||
console.log('SW- app ver 0.5.4')
|
||||
|
||||
const cfgenv = {
|
||||
serverweb: `${self.location.protocol}//${self.location.hostname}:${port}`,
|
||||
@@ -126,6 +128,7 @@ if (workbox) {
|
||||
}),
|
||||
)
|
||||
|
||||
/*
|
||||
// Per Articoli....
|
||||
const articleHandler = new NetworkFirst({
|
||||
cacheName: 'articles-cache',
|
||||
@@ -142,7 +145,7 @@ if (workbox) {
|
||||
|
||||
registerRoute(
|
||||
new RegExp(/(.*)article(.*)\.html/), args => articleHandler.handle(args),
|
||||
)
|
||||
) */
|
||||
|
||||
registerRoute(
|
||||
new RegExp(/.*(?:googleapis|gstatic)\.com.*$/),
|
||||
@@ -259,6 +262,7 @@ if (workbox) {
|
||||
return fetch(args.event.request)
|
||||
.then((res) => caches.open('dynamic')
|
||||
.then((cache) => {
|
||||
console.log('fetch cache')
|
||||
console.log('cache', args.event.request.url)
|
||||
cache.put(args.event.request.url, res.clone())
|
||||
return res
|
||||
@@ -352,13 +356,15 @@ if ('serviceWorker' in navigator) {
|
||||
|
||||
}
|
||||
|
||||
self.addEventListener('fetch', (event) => {
|
||||
/* self.addEventListener('fetch', (event) => {
|
||||
if (event.request.url === '/') {
|
||||
const StaleWhileRevalidate = new StaleWhileRevalidate();
|
||||
event.respondWith(StaleWhileRevalidate.handle({ event }));
|
||||
}
|
||||
});
|
||||
|
||||
*/
|
||||
|
||||
self.addEventListener('fetch', function (event) {
|
||||
console.log('[Service Worker] Fetching something ....', event);
|
||||
console.log('event.request.cache=', event.request.cache)
|
||||
@@ -366,7 +372,26 @@ self.addEventListener('fetch', function (event) {
|
||||
console.log('SAME ORIGIN!', event);
|
||||
return;
|
||||
}
|
||||
event.respondWith(caches.match(event.request));
|
||||
event.respondWith((async () => {
|
||||
const cachedResponse = await caches.match(event.request);
|
||||
if (cachedResponse) {
|
||||
return cachedResponse;
|
||||
}
|
||||
|
||||
const response = await fetch(event.request);
|
||||
|
||||
if (!response || response.status !== 200 || response.type !== 'basic') {
|
||||
return response;
|
||||
}
|
||||
|
||||
if (ENABLE_DYNAMIC_CACHING) {
|
||||
const responseToCache = response.clone();
|
||||
const cache = await caches.open(DYNAMIC_CACHE)
|
||||
await cache.put(event.request, response.clone());
|
||||
}
|
||||
|
||||
return response;
|
||||
})());
|
||||
});
|
||||
|
||||
|
||||
@@ -384,6 +409,7 @@ self.addEventListener('message', event => {
|
||||
console.log(event.data)
|
||||
})
|
||||
|
||||
|
||||
addEventListener('fetch', event => {
|
||||
// Prevent the default, and handle the request ourselves.
|
||||
event.respondWith(async function() {
|
||||
@@ -398,19 +424,7 @@ addEventListener('fetch', event => {
|
||||
}());
|
||||
});
|
||||
|
||||
self.addEventListener('fetch', function (event) {
|
||||
event.respondWith(
|
||||
caches.match(event.request).then(function (response) {
|
||||
return response ||
|
||||
fetch(event.request, event.headers)
|
||||
.catch(err => {
|
||||
console.log('_______________________ ERRORE FETCH SW: ', event.request, err)
|
||||
writeData('config', { _id: 2, stateconn: 'offline' })
|
||||
return caches.match(event.request);
|
||||
})
|
||||
})
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
self.addEventListener('fetch', function (event) {
|
||||
event.respondWith(
|
||||
@@ -423,6 +437,7 @@ self.addEventListener('fetch', function (event) {
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
self.addEventListener('sync', function (event) {
|
||||
console.log('[Service Worker V5] Background syncing', event);
|
||||
console.log('event:', event);
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
import { register } from 'register-service-worker'
|
||||
|
||||
register(process.env.SERVICE_WORKER_FILE ? process.env.SERVICE_WORKER_FILE : '', {
|
||||
scope: '/',
|
||||
ready() {
|
||||
console.log('READY::: App is being served from cache by a service worker.')
|
||||
},
|
||||
|
||||
@@ -904,6 +904,11 @@ export const shared_consts = {
|
||||
STATUS_GROUPS_REMOVED: 7,
|
||||
},
|
||||
|
||||
QualiNotifs: {
|
||||
CIRCUITS: 1,
|
||||
OTHERS: 2,
|
||||
},
|
||||
|
||||
TypeNotifs: {
|
||||
TYPEDIR_BACHECA: 1,
|
||||
ID_BACHECA_NEW_GOOD: 1,
|
||||
@@ -954,8 +959,24 @@ export const shared_consts = {
|
||||
TYPEDIR_MSGS: 7,
|
||||
ID_MSGS_NEW_REC: 1,
|
||||
|
||||
TYPEDIR_TEST: 444,
|
||||
ID_TEST_NEW_REC: 1,
|
||||
},
|
||||
|
||||
TypeNotifs_Test: [
|
||||
{
|
||||
value: 1, //
|
||||
labeltrans: 'typenotifs.test',
|
||||
descr: 'typenotifs.new_rec_bacheca_descr',
|
||||
icon:'fas fa-house-user',
|
||||
list: [
|
||||
{
|
||||
value: 1, // ID_TEST_NEW_REC
|
||||
labeltrans: 'notifsid.test_new',
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
|
||||
TypeNotifs_Arr: [
|
||||
{
|
||||
|
||||
@@ -29,6 +29,11 @@ export default defineComponent({
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
noButtAdd: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
},
|
||||
ind: {
|
||||
type: Number,
|
||||
required: false,
|
||||
|
||||
@@ -39,9 +39,9 @@
|
||||
:nodataLabel="noMsgRecord"
|
||||
:prop_search="true"
|
||||
:finder="true"
|
||||
:labelBtnAddExtra="`Aggiungi ${strextra}`"
|
||||
:labelBtnAddExtra="noButtAdd ? `` : `Aggiungi ${strextra}`"
|
||||
:choose_visutype="visuType"
|
||||
:butt_modif_new="true"
|
||||
:butt_modif_new="true && !noButtAdd"
|
||||
noresultLabel="Il filtro selezionato non ha trovato nessun risultato"
|
||||
:arrfilters="arrfilterand"
|
||||
:filtercustom="filtercustom"
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
@click="canEdit = !canEdit">
|
||||
</q-btn>
|
||||
<q-btn
|
||||
v-if="mytable" rounded size="md" color="primary"
|
||||
v-if="mytable && labelBtnAddExtra" rounded size="md" color="primary"
|
||||
class="centermydiv q-mb-sm"
|
||||
:label="labelBtnAddExtra"
|
||||
:disable="loading"
|
||||
|
||||
@@ -9,6 +9,7 @@ import { ICircuit, ISearchList, IUserFields } from 'model'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import { CUserNonVerif } from '@/components/CUserNonVerif'
|
||||
import { CMyCircuits } from '@/components/CMyCircuits'
|
||||
|
||||
|
||||
export default defineComponent({
|
||||
@@ -25,6 +26,11 @@ export default defineComponent({
|
||||
type: Boolean,
|
||||
required: true,
|
||||
},
|
||||
showfinder: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: true,
|
||||
},
|
||||
circuit: {
|
||||
type: Object as PropType<ICircuit | null>,
|
||||
required: false,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div v-if="tools.isUserOk()">
|
||||
<div v-if="finder" class="q-gutter-sm q-pa-sm q-pb-sm">
|
||||
<div v-if="finder && showfinder" class="q-gutter-sm q-pa-sm q-pb-sm">
|
||||
<q-btn-toggle
|
||||
:model-value="modelValue"
|
||||
@update:model-value="updateValue"
|
||||
@@ -16,7 +16,7 @@
|
||||
/>
|
||||
</div>
|
||||
<div v-if="finder" class="">
|
||||
<div v-if="modelValue === costanti.FIND_CIRCUIT">
|
||||
<div v-if="modelValue === costanti.FIND_CIRCUIT || listcircuitsfiltered.length === 0">
|
||||
<slot></slot>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
||||
@@ -5,11 +5,13 @@ 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 { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyUser',
|
||||
components: { CSendCoins },
|
||||
emits: ['setCmd'],
|
||||
props: {
|
||||
mycontact: {
|
||||
@@ -67,6 +69,7 @@ export default defineComponent({
|
||||
const $route = useRoute()
|
||||
|
||||
const username = ref('')
|
||||
const showsendCoinTo = ref(false)
|
||||
|
||||
const contact = ref(<IUserFields | null>null)
|
||||
|
||||
@@ -117,6 +120,7 @@ export default defineComponent({
|
||||
shared_consts,
|
||||
userStore,
|
||||
tools,
|
||||
showsendCoinTo,
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
@@ -17,6 +17,19 @@
|
||||
<q-item-label v-if="labelFooter" lines="1"><em>{{ labelFooter }}</em></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"
|
||||
color="green"
|
||||
size="md"
|
||||
rounded
|
||||
@click="showsendCoinTo = true"
|
||||
>
|
||||
</q-btn>
|
||||
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section side v-if="visu === costanti.FRIENDS">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
@@ -298,6 +311,15 @@
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
<div v-if="showsendCoinTo && contact">
|
||||
<CSendCoins
|
||||
:showprop="showsendCoinTo"
|
||||
:to_user="contact"
|
||||
@close="showsendCoinTo = false"
|
||||
>
|
||||
|
||||
</CSendCoins>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyUser.ts">
|
||||
|
||||
4
src/components/CMyUserOnlyView/CMyUserOnlyView.scss
Executable file
4
src/components/CMyUserOnlyView/CMyUserOnlyView.scss
Executable file
@@ -0,0 +1,4 @@
|
||||
.myflex{
|
||||
display: flex;
|
||||
flex: 1;
|
||||
}
|
||||
122
src/components/CMyUserOnlyView/CMyUserOnlyView.ts
Executable file
122
src/components/CMyUserOnlyView/CMyUserOnlyView.ts
Executable file
@@ -0,0 +1,122 @@
|
||||
import { defineComponent, onMounted, PropType, ref, watch } from 'vue'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
import { 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 { useI18n } from '@/boot/i18n'
|
||||
import { useRoute, useRouter } from 'vue-router'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'CMyUserOnlyView',
|
||||
emits: ['setCmd'],
|
||||
props: {
|
||||
mycontact: {
|
||||
type: Object as PropType<IUserFields | null>,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
myusername: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: null,
|
||||
},
|
||||
visu: {
|
||||
type: Number,
|
||||
required: true,
|
||||
},
|
||||
groupname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
circuitname: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
name: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
labelextra: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
labelFooter: {
|
||||
type: String,
|
||||
required: false,
|
||||
default: '',
|
||||
},
|
||||
notsetcmd: {
|
||||
type: Boolean,
|
||||
required: false,
|
||||
default: false,
|
||||
}
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
|
||||
const userStore = useUserStore()
|
||||
const $q = useQuasar()
|
||||
const { t } = useI18n()
|
||||
const $router = useRouter()
|
||||
const $route = useRoute()
|
||||
|
||||
const username = ref('')
|
||||
|
||||
const contact = ref(<IUserFields | null>null)
|
||||
|
||||
watch(() => props.mycontact, (newval, oldval) => {
|
||||
console.log('watch: mycontact')
|
||||
mounted()
|
||||
})
|
||||
|
||||
function mounted() {
|
||||
if (!props.mycontact) {
|
||||
if (props.myusername) {
|
||||
username.value = props.myusername
|
||||
//++Todo: carica contact
|
||||
contact.value = null
|
||||
}
|
||||
} else {
|
||||
if (props.mycontact) {
|
||||
contact.value = props.mycontact
|
||||
username.value = props.mycontact.username
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getImgUser(profile: IUserFields) {
|
||||
return userStore.getImgByProfile(profile)
|
||||
}
|
||||
|
||||
function naviga(path: string) {
|
||||
$router.push(path)
|
||||
}
|
||||
|
||||
function setCmd($q: any, cmd: number, myusername: string, value: any, dest: string) {
|
||||
if (props.notsetcmd) {
|
||||
tools.setCmd($q, cmd, myusername, value, dest)
|
||||
}else {
|
||||
emit('setCmd', $q, cmd, myusername, value, dest)
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
contact,
|
||||
costanti,
|
||||
getImgUser,
|
||||
naviga,
|
||||
setCmd,
|
||||
shared_consts,
|
||||
userStore,
|
||||
tools,
|
||||
}
|
||||
},
|
||||
})
|
||||
308
src/components/CMyUserOnlyView/CMyUserOnlyView.vue
Executable file
308
src/components/CMyUserOnlyView/CMyUserOnlyView.vue
Executable file
@@ -0,0 +1,308 @@
|
||||
<template>
|
||||
<div v-if="contact">
|
||||
<q-item class="q-my-sm" clickable>
|
||||
<q-item-section avatar @click="naviga(`/my/` + contact.username)">
|
||||
<q-avatar size="60px">
|
||||
<q-img :src="getImgUser(contact)" :alt="contact.username" img-class="imgprofile" height="60px"/>
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section @click="naviga(`/my/` + contact.username)">
|
||||
<q-item-label v-if="labelextra && (labelextra !== contact.username)"><strong>{{ labelextra }}</strong></q-item-label>
|
||||
<q-item-label><span class="username">{{ contact.username }}</span> <span v-if="contact.name">({{ contact.name }} {{ contact.surname }})</span>
|
||||
</q-item-label>
|
||||
<q-item-label v-if="contact.reported" caption lines="1"><em style="color: red; font-weight: bold">{{ $t('db.reporteduser', {date_report: tools.getstrDateTimeShort(contact.date_report)}) }}</em></q-item-label>
|
||||
<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-section>
|
||||
|
||||
<q-item-section side v-if="visu === costanti.FRIENDS">
|
||||
<q-item-label>
|
||||
<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="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', contact.username)">
|
||||
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-ban" v-close-popup
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.BLOCK_USER, userStore.my.username, '', contact.username)">
|
||||
<q-item-section>{{ $t('friends.block_user') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_FRIENDS">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
<q-item clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.SETFRIEND, userStore.my.username, '', contact.username)">
|
||||
<q-item-section>{{ $t('friends.accept_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, false, contact.username, false)">
|
||||
<q-item-section>{{ $t('friends.reject_ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_ADD_USER_TO_GROUP">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
|
||||
<q-item clickable v-close-popup @click="tools.addToMyGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
{{ $t('groups.accept_group') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.refuseReqGroup($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.cancelReqGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('shared.cancel_ask_short') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_REMOVE_USER_TO_GROUP">
|
||||
<q-item-label v-if="contact.username !== userStore.my.username">
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-if="!tools.isUserAdminGroup(groupname, contact.username)" v-close-popup @click="tools.addtoAdminOfMyGroup($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-shield"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('groups.addasadmin') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-if="tools.isUserAdminGroup(groupname, contact.username) && tools.iAmTheCreatorOfTheGroup(groupname)" v-close-popup @click="tools.removeAdminOfMyGroup($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-times"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('groups.remove_as_admin') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-if="!tools.isUserTheCreatorOfTheGroup(groupname, contact.username)" v-close-popup @click="tools.removeFromMyGroups($q, contact.username, groupname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('groups.remove_from_mygroups') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="tools.reportUser($q, userStore.my.username, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-flag"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.report_user') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_ADD_USER_TO_CIRCUIT">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="true" style="min-width: 150px">
|
||||
|
||||
<q-item clickable v-close-popup @click="tools.addToMyCircuits($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>
|
||||
{{ $t('circuit.accept') }}
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.refuseReqCircuit($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('shared.refuse_ask') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup
|
||||
@click="tools.cancelReqCircuit($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
|
||||
<q-item-section>{{ $t('shared.cancel_ask_short') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REQ_REMOVE_USER_TO_CIRCUIT">
|
||||
<q-item-label v-if="contact.username !== userStore.my.username">
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-if="!tools.isUserAdminCircuit(circuitname, contact.username)" v-close-popup @click="tools.addtoAdminOfCircuit($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-shield"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('circuit.addasadmin') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-if="tools.isUserAdminCircuit(circuitname, contact.username) && tools.iAmTheCreatorOfTheCircuit(circuitname)" v-close-popup @click="tools.removeAdminOfCircuit($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-times"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('circuit.remove_as_admin') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-if="!tools.isUserTheCreatorOfTheCircuit(circuitname, contact.username)" v-close-popup @click="tools.removeFromMyCircuits($q, contact.username, circuitname)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('circuit.remove_from_mycircuit') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="tools.reportUser($q, userStore.my.username, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-flag"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.report_user') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.ASK_SENT_FRIENDS">
|
||||
<q-item-label>
|
||||
<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="setCmd($q, shared_consts.FRIENDSCMD.CANCEL_REQ_FRIEND, userStore.my.username, '', contact.username, '')">
|
||||
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.ASK_TRUST">
|
||||
<q-item-label>
|
||||
<q-btn color="positive" :label="$t('friends.accept_trust')"
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, true, contact.username)"/>
|
||||
</q-item-label>
|
||||
<q-item-label>
|
||||
<q-btn color="negative" :label="$t('friends.refuse_trust')"
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, false, contact.username)"/>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.TRUSTED">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list v-if="!userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px">
|
||||
<q-item clickable icon="fas fa-user-plus" v-close-popup
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, true, contact.username)">
|
||||
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, false, contact.username)">
|
||||
<q-item-section>{{ $t('friends.reject_trust') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.FIND_PEOPLE">
|
||||
<q-item-label>
|
||||
|
||||
<q-btn v-if="contact.username !== userStore.my.username" rounded
|
||||
:icon="userStore.IsMyFriendByUsername(contact.username) ? `fas fa-ellipsis-h` : `fas fa-user`">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item v-if="(!userStore.IsMyFriendByUsername(contact.username) && !userStore.IsAskedFriendByUsername(contact.username))"
|
||||
clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, true, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="positive" name="fas fa-user-plus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-else-if="(!userStore.IsMyFriendByUsername(contact.username) && userStore.IsAskedFriendByUsername(contact.username))"
|
||||
clickable v-close-popup @click="setCmd($q, shared_consts.FRIENDSCMD.REQFRIEND, userStore.my.username, false, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.cancel_ask_friend') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item v-else-if="userStore.IsMyFriendByUsername(contact.username)" style="min-width: 200px"
|
||||
clickable v-close-popup
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.REMOVE_FROM_MYFRIENDS, userStore.my.username, '', contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-user-minus"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.remove_from_myfriends') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="tools.reportUser($q, userStore.my.username, contact.username)">
|
||||
<q-item-section avatar>
|
||||
<q-icon color="negative" name="fas fa-flag"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('friends.report_user') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side v-else-if="visu === costanti.REJECTED">
|
||||
<q-item-label>
|
||||
<q-btn rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 200px">
|
||||
<q-item clickable icon="fas fa-user-minus" v-close-popup
|
||||
@click="setCmd($q, shared_consts.FRIENDSCMD.SETTRUST, userStore.my.username, true, contact.username)">
|
||||
<q-item-section>{{ $t('friends.accept_trust') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
</q-item>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./CMyUserOnlyView.ts">
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
@import './CMyUserOnlyView.scss';
|
||||
</style>
|
||||
1
src/components/CMyUserOnlyView/index.ts
Executable file
1
src/components/CMyUserOnlyView/index.ts
Executable file
@@ -0,0 +1 @@
|
||||
export { default as CMyUserOnlyView } from './CMyUserOnlyView.vue'
|
||||
@@ -7,7 +7,7 @@ import { useUserStore } from '@store/UserStore'
|
||||
import { useCircuitStore } from '@store/CircuitStore'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { CMyUser } from '@/components/CMyUser'
|
||||
import { CMyUserOnlyView } from '@/components/CMyUserOnlyView'
|
||||
import { costanti } from '@costanti'
|
||||
|
||||
export default defineComponent({
|
||||
@@ -23,7 +23,7 @@ export default defineComponent({
|
||||
required: true,
|
||||
},
|
||||
},
|
||||
components: { CSaldo, CMyUser },
|
||||
components: { CSaldo, CMyUserOnlyView },
|
||||
|
||||
setup(props, { emit }) {
|
||||
const $q = useQuasar()
|
||||
@@ -35,7 +35,7 @@ export default defineComponent({
|
||||
|
||||
const from_username = ref(userStore.my.username)
|
||||
const circuitsel = ref('')
|
||||
const qty = ref(1)
|
||||
const qty = ref('')
|
||||
const causal = ref('')
|
||||
const bothcircuits = ref(<any>[])
|
||||
|
||||
@@ -103,17 +103,19 @@ export default defineComponent({
|
||||
|
||||
|
||||
// ....
|
||||
if (props.to_user) {
|
||||
console.log('user', props.to_user)
|
||||
bothcircuits.value = userStore.IsMyCircuitByUser(props.to_user)
|
||||
|
||||
bothcircuits.value = userStore.IsMyCircuitByUser(props.to_user)
|
||||
circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0])
|
||||
if (!userStore.IsMyCircuitByName(circuitsel.value)) {
|
||||
circuitsel.value = bothcircuits.value[0]
|
||||
}
|
||||
|
||||
circuitsel.value = tools.getCookie(tools.CIRCUIT_USE, bothcircuits.value[0])
|
||||
if (!userStore.IsMyCircuitByName(circuitsel.value)) {
|
||||
circuitsel.value = bothcircuits.value[0]
|
||||
aggiorna()
|
||||
|
||||
show.value = true
|
||||
}
|
||||
|
||||
aggiorna()
|
||||
|
||||
show.value = true
|
||||
}
|
||||
|
||||
function hide() {
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-dialog v-model="show" :maximized="$q.screen.lt.sm" @hide="hide" @show="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>
|
||||
@@ -25,18 +25,16 @@
|
||||
|
||||
<q-input v-model="from_username" label="Mittente" class="full-width" readonly>
|
||||
</q-input>
|
||||
<CMyUser
|
||||
<CMyUserOnlyView
|
||||
:mycontact="to_user"
|
||||
:visu="costanti.FIND_PEOPLE"
|
||||
@setCmd="tools.setCmd"
|
||||
labelextra="Destinatario"
|
||||
>
|
||||
</CMyUser>
|
||||
</CMyUserOnlyView>
|
||||
|
||||
<div v-if="circuitloaded">
|
||||
<q-input
|
||||
mask="#.##"
|
||||
reverse-fill-mask
|
||||
ref="qtyRef"
|
||||
class="q-py-sm text-h5"
|
||||
outlined v-model="qty" type="text"
|
||||
|
||||
@@ -96,7 +96,7 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
userStore.signin($router, signin.value)
|
||||
.then((riscode: number) => {
|
||||
.then((riscode: any) => {
|
||||
console.log('signin FINITO CALL: riscode=', riscode)
|
||||
if ($q.screen.lt.sm) {
|
||||
globalStore.setleftDrawerOpen(false)
|
||||
@@ -129,6 +129,7 @@ export default defineComponent({
|
||||
emit('checkErrors', riscode)
|
||||
}
|
||||
|
||||
console.log('iswaitingforRes FALSE')
|
||||
iswaitingforRes.value = false
|
||||
|
||||
})
|
||||
|
||||
@@ -12,6 +12,7 @@ import { useRouter } from 'vue-router'
|
||||
import { static_data } from '@/db/static_data'
|
||||
import messagePopover from '../../layouts/toolbar/messagePopover/messagePopover.vue'
|
||||
import notifPopover from '../../layouts/toolbar/notifPopover/notifPopover.vue'
|
||||
import coinsPopover from '../../layouts/toolbar/coinsPopover/coinsPopover.vue'
|
||||
import drawer from '../../layouts/drawer/drawer.vue'
|
||||
import { CMyAvatar } from '@/components/CMyAvatar'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
@@ -25,7 +26,7 @@ import { CMyCart, CSigninNoreg } from '@/components'
|
||||
export default defineComponent({
|
||||
name: 'MyHeader',
|
||||
components: {
|
||||
drawer, messagePopover, CMyAvatar, CSigninNoreg, CMyCart, notifPopover
|
||||
drawer, messagePopover, CMyAvatar, CSigninNoreg, CMyCart, notifPopover, coinsPopover
|
||||
},
|
||||
props: {
|
||||
extraContent: {
|
||||
@@ -61,8 +62,6 @@ export default defineComponent({
|
||||
const testStore = useTestStore()
|
||||
|
||||
const stateconn = ref(globalStore.stateConnection)
|
||||
const rightCartOpen = ref(globalStore.rightCartOpen)
|
||||
const rightNotifOpen = ref(globalStore.rightNotifOpen)
|
||||
|
||||
const {
|
||||
getUsernameChatByMsg,
|
||||
@@ -161,6 +160,13 @@ export default defineComponent({
|
||||
return globalStore.isNewVersionAvailable
|
||||
}
|
||||
|
||||
function closeAll() {
|
||||
globalStore.rightNotifOpen = false
|
||||
globalStore.rightCartOpen = false
|
||||
globalStore.rightDrawerOpen = false
|
||||
globalStore.rightCoinsOpen = false
|
||||
}
|
||||
|
||||
const leftDrawerOpen = computed({
|
||||
get: () => globalStore.leftDrawerOpen,
|
||||
set: val => {
|
||||
@@ -171,17 +177,33 @@ export default defineComponent({
|
||||
const rightDrawerOpen = computed({
|
||||
get: () => globalStore.rightDrawerOpen,
|
||||
set: val => {
|
||||
closeAll()
|
||||
globalStore.rightDrawerOpen = val
|
||||
if (globalStore.rightDrawerOpen) globalStore.rightCartOpen = false
|
||||
if (globalStore.rightDrawerOpen) globalStore.rightNotifOpen = false
|
||||
},
|
||||
})
|
||||
|
||||
watch(() => rightNotifOpen, (newval, oldval) => {
|
||||
if (newval) {
|
||||
globalStore.rightDrawerOpen = false
|
||||
globalStore.rightCartOpen = false
|
||||
}
|
||||
const rightCartOpen = computed({
|
||||
get: () => globalStore.rightCartOpen,
|
||||
set: val => {
|
||||
closeAll()
|
||||
globalStore.rightCartOpen = val
|
||||
},
|
||||
})
|
||||
|
||||
const rightNotifOpen = computed({
|
||||
get: () => globalStore.rightNotifOpen,
|
||||
set: val => {
|
||||
closeAll()
|
||||
globalStore.rightNotifOpen = val
|
||||
},
|
||||
})
|
||||
|
||||
const rightCoinsOpen = computed({
|
||||
get: () => globalStore.rightCoinsOpen,
|
||||
set: val => {
|
||||
closeAll()
|
||||
globalStore.rightCoinsOpen = val
|
||||
},
|
||||
})
|
||||
|
||||
const lang = computed({
|
||||
@@ -429,6 +451,7 @@ export default defineComponent({
|
||||
rightDrawerOpen,
|
||||
rightCartOpen,
|
||||
rightNotifOpen,
|
||||
rightCoinsOpen,
|
||||
lang,
|
||||
langshort,
|
||||
getnumOrdersCart,
|
||||
|
||||
@@ -91,6 +91,10 @@
|
||||
<div v-if="static_data.functionality.SHOW_MESSAGES">
|
||||
<message-popover></message-popover>
|
||||
</div>
|
||||
<div v-if="static_data.functionality.SHOW_COINS">
|
||||
<coinsPopover
|
||||
v-model="rightCoinsOpen"></coinsPopover>
|
||||
</div>
|
||||
<div v-if="static_data.functionality.SHOW_NOTIF">
|
||||
<notifPopover
|
||||
v-model="rightNotifOpen"></notifPopover>
|
||||
|
||||
@@ -40,6 +40,7 @@ export * from './CMyCardPopup'
|
||||
export * from './CFacebookFrame'
|
||||
export * from './CVerifyEmail'
|
||||
export * from './CMyUser'
|
||||
export * from './CMyUserOnlyView'
|
||||
export * from './CVerifyTelegram'
|
||||
export * from './CMyFriends'
|
||||
export * from './CMyGroups'
|
||||
|
||||
@@ -7,7 +7,7 @@ import {
|
||||
import { func } from '@store/Modules/fieldsTable'
|
||||
|
||||
const functionality: IFunctionality = {
|
||||
PWA: !(process.env.DEV),
|
||||
PWA: true,
|
||||
SHOW_USER_MENU: true, // Cambiare con true
|
||||
SHOW_PROFILE: true,
|
||||
SHOW_REG_BUTTON: false,
|
||||
@@ -20,6 +20,7 @@ const functionality: IFunctionality = {
|
||||
SHOW_IF_IS_SERVER_CONNECTION: false,
|
||||
SHOW_MESSAGES: false,
|
||||
SHOW_NOTIF: true,
|
||||
SHOW_COINS: true,
|
||||
BOOKING_EVENTS: true,
|
||||
ENABLE_ECOMMERCE: false,
|
||||
ENABLE_REG_ISP: true,
|
||||
|
||||
36
src/layouts/toolbar/coinsPopover/coinsPopover.scss
Executable file
36
src/layouts/toolbar/coinsPopover/coinsPopover.scss
Executable file
@@ -0,0 +1,36 @@
|
||||
.list {
|
||||
max-width: 400px;
|
||||
}
|
||||
|
||||
.item > img.item-primary:not(.thumbnail) {
|
||||
border-radius: 10px !important;
|
||||
}
|
||||
|
||||
.item > img.item-primary {
|
||||
width: 48px;
|
||||
height: 46px;
|
||||
}
|
||||
|
||||
.item > .item-secondary {
|
||||
width: 57px;
|
||||
font-size: 13px;
|
||||
}
|
||||
|
||||
.unread {
|
||||
|
||||
}
|
||||
|
||||
.unread-date {
|
||||
color: royalblue;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.read {
|
||||
color: grey;
|
||||
}
|
||||
|
||||
|
||||
.my-custom-toggle {
|
||||
border: 1px solid #027be3;
|
||||
}
|
||||
|
||||
193
src/layouts/toolbar/coinsPopover/coinsPopover.ts
Executable file
193
src/layouts/toolbar/coinsPopover/coinsPopover.ts
Executable file
@@ -0,0 +1,193 @@
|
||||
import { computed, defineComponent, onMounted, ref, watch } from 'vue'
|
||||
|
||||
import {
|
||||
IChat,
|
||||
IMessage, IMsgUsers, INotif,
|
||||
} from '@model'
|
||||
|
||||
import { date } from 'quasar'
|
||||
|
||||
import { tools } from '@src/store/Modules/tools'
|
||||
|
||||
import { useRouter } from 'vue-router'
|
||||
import MixinUsers from '../../../mixins/mixin-users'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
import { CMyFieldRec } from '@/components/CMyFieldRec'
|
||||
import { CMyFieldDb } from '@/components/CMyFieldDb'
|
||||
import { CMyCircuits } from '@/components/CMyCircuits'
|
||||
import { CFinder } from '@/components/CFinder'
|
||||
import { shared_consts } from '@/common/shared_vuejs'
|
||||
import { useI18n } from '@/boot/i18n'
|
||||
import { useQuasar } from 'quasar'
|
||||
import { costanti } from '@costanti'
|
||||
import { toolsext } from '@store/Modules/toolsext'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'coinsPopover',
|
||||
components: { CTitleBanner, CMyFieldRec, CMyFieldDb, CMyCircuits, CFinder },
|
||||
emits: ['update:modelValue'],
|
||||
props: {
|
||||
modelValue: {
|
||||
required: true,
|
||||
type: [String, Number, Boolean],
|
||||
}
|
||||
},
|
||||
|
||||
setup(props, { emit }) {
|
||||
const $router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const { t } = useI18n()
|
||||
const q = useQuasar()
|
||||
|
||||
const loading = ref(false)
|
||||
|
||||
const myuser = ref({})
|
||||
const filter = ref(costanti.MY_CIRCUITS)
|
||||
|
||||
const show_all = ref(true)
|
||||
const username = computed(() => userStore.my.username)
|
||||
|
||||
const getlasts_coins = computed(() => notifStore.getlasts_coins().filter((rec) => show_all.value ? true : !rec.read))
|
||||
const num_notifs_unread = computed(() => notifStore.getnumCoinsUnread())
|
||||
|
||||
const notifsel = ref(<INotif>{
|
||||
dest: '',
|
||||
datenotif: new Date()
|
||||
})
|
||||
|
||||
const open = computed({
|
||||
get() {
|
||||
return props.modelValue
|
||||
},
|
||||
|
||||
set(value) {
|
||||
return emit('update:modelValue', value)
|
||||
}
|
||||
})
|
||||
|
||||
const { getNumNotifUnread, getNumNotif, getUsernameChatByNotif, getImgByNotif, getNotifText, getTypeDirNotif, getTypeIdNotif } = MixinUsers()
|
||||
|
||||
// function getlasts_coins (state: IUserState) => IMessage[] {
|
||||
//
|
||||
// }
|
||||
|
||||
watch(() => userStore.my.username, async (to: any, from: any) => {
|
||||
if (userStore.my.username) {
|
||||
await refreshdata(userStore.my.username)
|
||||
}
|
||||
})
|
||||
|
||||
watch(() => notifStore.updateNotification, async (to: any, from: any) => {
|
||||
if (notifStore.updateNotification) {
|
||||
await refreshdata(userStore.my.username)
|
||||
}
|
||||
})
|
||||
|
||||
function clickNotif(notif: INotif) {
|
||||
if (notif.openUrl) {
|
||||
let mylink = tools.updateQueryStringParameter(notif.openUrl, 'idnotif', notif._id)
|
||||
console.log('mylink', mylink, notif._id)
|
||||
if (mylink) {
|
||||
$router.replace(mylink)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function getlastnotif(username: string): any {
|
||||
// Get msg for this chat
|
||||
if (notifStore.last_notifs)
|
||||
return notifStore.last_notifs.find((rec: INotif) => rec.dest === username)
|
||||
// return users_msg_saved[username]
|
||||
}
|
||||
|
||||
function getlastdataread(username: string): any {
|
||||
// Get msg for this
|
||||
|
||||
let myrec = getlastnotif(username)
|
||||
const lastdata: any = (myrec && myrec.lastdataread) ? myrec.lastdataread : tools.getLastDateReadReset()
|
||||
|
||||
let mydate = ''
|
||||
if (!tools.isIsoDate(lastdata))
|
||||
mydate = lastdata.toISOString()
|
||||
else
|
||||
return lastdata
|
||||
|
||||
// console.log('getlastdataread', mydate)
|
||||
return mydate
|
||||
}
|
||||
|
||||
|
||||
async function refreshdata(username: string) {
|
||||
try {
|
||||
|
||||
if (!!username) {
|
||||
notifsel.value.dest = ''
|
||||
console.log('refreshdata')
|
||||
loading.value = true
|
||||
|
||||
return notifStore.updateNotifDataFromServer({
|
||||
username,
|
||||
lastdataread: getlastdataread(username)
|
||||
}).then((ris) => {
|
||||
|
||||
notifStore.updateNotification = false
|
||||
notifsel.value.dest = username
|
||||
loading.value = false
|
||||
|
||||
const element = document.getElementById('last')
|
||||
tools.scrollToElement(element)
|
||||
|
||||
// changemsgs('', '')
|
||||
|
||||
}).catch((err) => {
|
||||
console.error(' refreshdata', err)
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(' refreshdata', e)
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
async function mounted() {
|
||||
myuser.value = userStore.my
|
||||
await refreshdata(userStore.my.username)
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
getlasts_coins,
|
||||
num_notifs_unread,
|
||||
clickNotif,
|
||||
getNumNotifUnread,
|
||||
getNumNotif,
|
||||
getUsernameChatByNotif,
|
||||
getImgByNotif,
|
||||
getNotifText,
|
||||
getTypeDirNotif,
|
||||
getTypeIdNotif,
|
||||
tools,
|
||||
shared_consts,
|
||||
myuser,
|
||||
costanti,
|
||||
toolsext,
|
||||
open,
|
||||
notifStore,
|
||||
show_all,
|
||||
t,
|
||||
username,
|
||||
userStore,
|
||||
q,
|
||||
filter,
|
||||
}
|
||||
},
|
||||
})
|
||||
196
src/layouts/toolbar/coinsPopover/coinsPopover.vue
Executable file
196
src/layouts/toolbar/coinsPopover/coinsPopover.vue
Executable file
@@ -0,0 +1,196 @@
|
||||
<template>
|
||||
<div>
|
||||
<q-btn flat round dense icon="fas fa-coins" class="q-mx-xs" @click="open = !open">
|
||||
<q-badge v-if="num_notifs_unread > 0" floating color="red">{{ num_notifs_unread }}</q-badge>
|
||||
</q-btn>
|
||||
<q-btn v-if="false" flat round dense icon="fas fa-coins">
|
||||
<q-badge v-if="num_notifs_unread > 0" floating color="red">{{ num_notifs_unread }}</q-badge>
|
||||
</q-btn>
|
||||
|
||||
|
||||
<q-drawer v-model="open" side="right" elevated class="text-black"
|
||||
:overlay="true"
|
||||
:breakpoint="1200"
|
||||
:width="q.screen.lt.sm ? tools.getwidth($q) : 450"
|
||||
>
|
||||
<q-bar class="bg-primary text-white">
|
||||
{{ $t('notifs.coins') }}
|
||||
<q-space/>
|
||||
<q-btn round dense icon="fas fa-pencil-alt" class="q-mx-xs">
|
||||
<q-menu style="min-width: 200px">
|
||||
<q-list style="">
|
||||
<q-item clickable v-close-popup to="/notifs">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-cog"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.settings') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="notifStore.setAllRead(username, shared_consts.QualiNotifs.CIRCUITS)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-check"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.setallread') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="notifStore.deleteAll(username, shared_consts.QualiNotifs.CIRCUITS)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.deleteall') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
<q-btn flat round color="white" icon="close" @click="open = false"></q-btn>
|
||||
</q-bar>
|
||||
|
||||
<CMyCircuits
|
||||
v-model="filter"
|
||||
:finder="true"
|
||||
:showfinder="true"
|
||||
>
|
||||
|
||||
<CFinder
|
||||
:table="toolsext.TABCIRCUITS"
|
||||
:noButtAdd="true"
|
||||
:showFilterPersonal="false"
|
||||
/>
|
||||
|
||||
</CMyCircuits>
|
||||
|
||||
<div class="row justify-center margin_buttons q-gutter-lg">
|
||||
<q-btn-toggle
|
||||
v-model="show_all"
|
||||
class="my-custom-toggle"
|
||||
no-caps
|
||||
rounded
|
||||
dense
|
||||
unelevated
|
||||
toggle-color="primary"
|
||||
color="white"
|
||||
text-color="primary"
|
||||
:options="[
|
||||
{label: t('notifs.all'), value: true},
|
||||
{label: t('notifs.notread'), value: false}
|
||||
]"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<div class="clBorderSperator"></div>
|
||||
|
||||
<div class="q-ma-xs">
|
||||
<q-list bordered class="rounded-borders">
|
||||
|
||||
<div v-if="num_notifs_unread === 0">
|
||||
<q-item>
|
||||
<q-item-label lines="1">{{ $t('notifs.nocoins') }}</q-item-label>
|
||||
|
||||
</q-item>
|
||||
</div>
|
||||
|
||||
|
||||
<q-item clickable v-for="(notif, index) in getlasts_coins" :key="index">
|
||||
|
||||
<!--<q-item-section avatar>
|
||||
<q-avatar>
|
||||
<q-item-label lines="1">{{ getTypeDirNotif(notif) }}</q-item-label>
|
||||
</q-avatar>
|
||||
</q-item-section>-->
|
||||
|
||||
<q-item-section avatar>
|
||||
<q-avatar>
|
||||
<img :src="notif.myimgsender" :alt="notif.sender">
|
||||
</q-avatar>
|
||||
</q-item-section>
|
||||
|
||||
|
||||
<q-item-section v-ripple>
|
||||
<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="2"
|
||||
v-if="notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS && notif.status === 0 && notif.typeid === shared_consts.TypeNotifs.ID_CIRCUIT_REQUEST_TO_ENTER"
|
||||
v-ripple>
|
||||
|
||||
<div class="row no-wrap justify-evenly" v-if="tools.iAmAdminCircuit(notif.extrafield)">
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-plus"
|
||||
color="positive" :label="$t('circuit.accept')"
|
||||
@click="tools.addToMyCircuits(q, notif.sender, notif.extrafield)"
|
||||
/>
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-minus"
|
||||
color="negative" :label="$t('shared.refuse_ask')"
|
||||
@click="tools.refuseReqCircuit(q, notif.sender, notif.extrafield)"
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
<q-item-label caption lines="2"
|
||||
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-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-plus"
|
||||
color="positive" :label="$t('circuit.accept_coins')"
|
||||
@click="tools.acceptCoins(q, notif.sender, notif)"
|
||||
/>
|
||||
<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)"
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption lines="1" :class="(!notif.read) ? 'unread-date' : 'read-date'" @click="clickNotif(notif)">
|
||||
{{ tools.timeAgo(notif.datenotif) }}
|
||||
<!--{{ // getUsernameChatByNotif(notif) }}-->
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
<q-item-section side>
|
||||
<q-item-label>
|
||||
<q-btn dense rounded icon="fas fa-ellipsis-h">
|
||||
<q-menu>
|
||||
<q-list style="min-width: 150px">
|
||||
<q-item clickable v-close-popup @click="notifStore.deleteRec(username, notif._id)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.delete_notif') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="notifStore.deactivateRec(notif._id)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-bell-slash"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.deactivate_notif') }}</q-item-section>
|
||||
</q-item>
|
||||
</q-list>
|
||||
</q-menu>
|
||||
</q-btn>
|
||||
</q-item-label>
|
||||
</q-item-section>
|
||||
|
||||
</q-item>
|
||||
<q-separator/>
|
||||
</q-list>
|
||||
</div>
|
||||
</q-drawer>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script lang="ts" src="./coinsPopover.ts">
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
@import './coinsPopover.scss';
|
||||
</style>
|
||||
@@ -12,6 +12,7 @@ import { tools } from '@src/store/Modules/tools'
|
||||
import { useRouter } from 'vue-router'
|
||||
import MixinUsers from '../../../mixins/mixin-users'
|
||||
import { useNotifStore } from '@store/NotifStore'
|
||||
import { useGlobalStore } from '@store/globalStore'
|
||||
import { useUserStore } from '@store/UserStore'
|
||||
|
||||
import { CTitleBanner } from '@/components/CTitleBanner'
|
||||
@@ -38,6 +39,7 @@ export default defineComponent({
|
||||
const $router = useRouter()
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const { t } = useI18n()
|
||||
const q = useQuasar()
|
||||
@@ -51,9 +53,7 @@ export default defineComponent({
|
||||
|
||||
const lasts_notifs = computed(() => notifStore.getlasts_notifs().filter((rec) => show_all.value ? true : !rec.read))
|
||||
const num_notifs_unread = computed(() => notifStore.getnumNotifUnread())
|
||||
const usernotifs = computed(() => userStore.my.profile.notifs)
|
||||
|
||||
const userId = ref('')
|
||||
// const usernotifs = computed(() => userStore.my.profile.notifs)
|
||||
|
||||
const polling = ref(<any> null)
|
||||
const eseguipolling = ref(true)
|
||||
@@ -89,10 +89,10 @@ export default defineComponent({
|
||||
console.log('checkifpolling')
|
||||
if (eseguipolling.value) {
|
||||
if (!polling.value) {
|
||||
console.log('esegui POLLING....')
|
||||
console.log('esegui POLLING 2....')
|
||||
polling.value = setInterval(() => {
|
||||
checkIfArrivedSomeNotif()
|
||||
}, 3000)
|
||||
}, 2000)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -103,19 +103,17 @@ export default defineComponent({
|
||||
clearInterval(polling.value)
|
||||
}
|
||||
|
||||
/*
|
||||
watch(() => usernotifs.value, async (to: any, from: any) => {
|
||||
|
||||
if (usernotifs.value) {
|
||||
console.log('usernotifs.value', usernotifs.value, to)
|
||||
const ret = await userStore.setUserNotifs(usernotifs.value)
|
||||
/*if (ret) {
|
||||
tools.showPositiveNotif(q, t('db.recupdated'))
|
||||
} else {
|
||||
tools.showNegativeNotif(q, t('db.recfailed'))
|
||||
}*/
|
||||
}
|
||||
})
|
||||
|
||||
*/
|
||||
|
||||
watch(() => userStore.my.username, async (to: any, from: any) => {
|
||||
if (userStore.my.username) {
|
||||
await refreshdata(userStore.my.username)
|
||||
@@ -163,31 +161,38 @@ export default defineComponent({
|
||||
|
||||
|
||||
async function refreshdata(username: string) {
|
||||
console.log('refreshdata')
|
||||
loading.value = true
|
||||
userId.value = userStore.my._id
|
||||
try {
|
||||
if (globalStore.finishLoading) {
|
||||
|
||||
notifsel.value.dest = ''
|
||||
|
||||
if (!!username) {
|
||||
if (!!username) {
|
||||
notifsel.value.dest = ''
|
||||
console.log('refreshdata')
|
||||
loading.value = true
|
||||
|
||||
return notifStore.updateNotifDataFromServer({
|
||||
username,
|
||||
lastdataread: getlastdataread(username)
|
||||
}).then((ris) => {
|
||||
return notifStore.updateNotifDataFromServer({
|
||||
username,
|
||||
lastdataread: getlastdataread(username)
|
||||
}).then((ris) => {
|
||||
|
||||
notifStore.updateNotification = false
|
||||
notifsel.value.dest = username
|
||||
loading.value = false
|
||||
notifStore.updateNotification = false
|
||||
notifsel.value.dest = username
|
||||
loading.value = false
|
||||
|
||||
const element = document.getElementById('last')
|
||||
tools.scrollToElement(element)
|
||||
const element = document.getElementById('last')
|
||||
tools.scrollToElement(element)
|
||||
|
||||
// changemsgs('', '')
|
||||
// changemsgs('', '')
|
||||
|
||||
}).catch((err) => {
|
||||
loading.value = false
|
||||
})
|
||||
}).catch((err) => {
|
||||
console.error(' refreshdata', err)
|
||||
loading.value = false
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.error(' refreshdata', e)
|
||||
loading.value = false
|
||||
}
|
||||
}
|
||||
|
||||
@@ -211,9 +216,7 @@ export default defineComponent({
|
||||
getTypeDirNotif,
|
||||
getTypeIdNotif,
|
||||
tools,
|
||||
usernotifs,
|
||||
shared_consts,
|
||||
userId,
|
||||
myuser,
|
||||
costanti,
|
||||
open,
|
||||
|
||||
@@ -25,13 +25,13 @@
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.settings') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="notifStore.setAllRead(username)">
|
||||
<q-item clickable v-close-popup @click="notifStore.setAllRead(username, shared_consts.QualiNotifs.OTHERS)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-check"/>
|
||||
</q-item-section>
|
||||
<q-item-section>{{ $t('notifs.setallread') }}</q-item-section>
|
||||
</q-item>
|
||||
<q-item clickable v-close-popup @click="notifStore.deleteAll(username)">
|
||||
<q-item clickable v-close-popup @click="notifStore.deleteAll(username, shared_consts.QualiNotifs.OTHERS)">
|
||||
<q-item-section side>
|
||||
<q-icon name="fas fa-trash-alt"/>
|
||||
</q-item-section>
|
||||
@@ -135,51 +135,6 @@
|
||||
/>
|
||||
</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_REQUEST_TO_ENTER"
|
||||
v-ripple>
|
||||
|
||||
<div class="row no-wrap justify-evenly" v-if="tools.iAmAdminCircuit(notif.extrafield)">
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-plus"
|
||||
color="positive" :label="$t('circuit.accept')"
|
||||
@click="tools.addToMyCircuits(q, notif.sender, notif.extrafield)"
|
||||
/>
|
||||
<q-btn
|
||||
dense
|
||||
rounded
|
||||
size="sm"
|
||||
icon="fas fa-user-minus"
|
||||
color="negative" :label="$t('shared.refuse_ask')"
|
||||
@click="tools.refuseReqCircuit(q, notif.sender, notif.extrafield)"
|
||||
/>
|
||||
</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)"
|
||||
/>
|
||||
<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)"
|
||||
/>
|
||||
</div>
|
||||
</q-item-label>
|
||||
|
||||
<q-item-label caption lines="1" :class="(!notif.read) ? 'unread-date' : 'read-date'" @click="clickNotif(notif)">
|
||||
{{ tools.timeAgo(notif.datenotif) }}
|
||||
|
||||
@@ -262,6 +262,7 @@ export interface IGlobalState {
|
||||
leftDrawerOpen: boolean
|
||||
rightDrawerOpen: boolean
|
||||
rightNotifOpen: boolean
|
||||
rightCoinsOpen: boolean
|
||||
rightCartOpen: boolean
|
||||
category: string
|
||||
stateConnection: string
|
||||
@@ -497,6 +498,7 @@ export interface IFunctionality {
|
||||
SHOW_ONLY_POLICY?: boolean
|
||||
SHOW_MESSAGES?: boolean
|
||||
SHOW_NOTIF?: boolean
|
||||
SHOW_COINS?: boolean
|
||||
BOOKING_EVENTS?: boolean
|
||||
ENABLE_REG_AYNI?: boolean
|
||||
ENABLE_REG_CNM?: boolean
|
||||
|
||||
@@ -36,9 +36,12 @@ export default defineComponent({
|
||||
const title = ref('')
|
||||
const notifdirtype = ref(1)
|
||||
const notifidtype = ref(1)
|
||||
const notifdirtypeTest = ref(1)
|
||||
const notifidtypeTest = ref(1)
|
||||
|
||||
const listnotif = ref(<any>[])
|
||||
const listnotiftype = ref(<any>[])
|
||||
const listnotiftypeTest = ref(<any>[])
|
||||
const { t } = useI18n();
|
||||
|
||||
const listnotifid = computed(() => {
|
||||
@@ -55,6 +58,20 @@ export default defineComponent({
|
||||
return []
|
||||
})
|
||||
|
||||
const listnotifidTest = computed(() => {
|
||||
if (notifdirtypeTest.value) {
|
||||
const mylist: any = shared_consts.TypeNotifs_Test.find((rec: any) => rec.value === notifdirtypeTest.value)
|
||||
if (mylist) {
|
||||
for (const rec of mylist.list) {
|
||||
rec.label = t(rec.labeltrans)
|
||||
}
|
||||
}
|
||||
|
||||
return mylist.list
|
||||
}
|
||||
return []
|
||||
})
|
||||
|
||||
const userStore = useUserStore()
|
||||
const notifStore = useNotifStore()
|
||||
|
||||
@@ -75,6 +92,11 @@ export default defineComponent({
|
||||
rec.label = t(rec.labeltrans)
|
||||
}
|
||||
|
||||
listnotiftypeTest.value = shared_consts.TypeNotifs_Test
|
||||
for (const rec of listnotiftypeTest.value) {
|
||||
rec.label = t(rec.labeltrans)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
function changeCol(newval: any) {
|
||||
@@ -120,6 +142,22 @@ export default defineComponent({
|
||||
}
|
||||
}
|
||||
|
||||
async function sendNotifToUserTest() {
|
||||
|
||||
if (!!myuser.value) {
|
||||
const notif: INotif = {
|
||||
typedir: notifdirtypeTest.value,
|
||||
typeid: notifidtypeTest.value,
|
||||
sender: userStore.my.username,
|
||||
dest: myuser.value.username,
|
||||
descr: mynotif.value,
|
||||
title: title.value,
|
||||
}
|
||||
await notifStore.SendNotifEvent(notif)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(mounted)
|
||||
|
||||
return {
|
||||
@@ -136,14 +174,19 @@ export default defineComponent({
|
||||
colVisib,
|
||||
exportListaEmail,
|
||||
sendNotifToUser,
|
||||
sendNotifToUserTest,
|
||||
risultato,
|
||||
mynotif,
|
||||
title,
|
||||
notifdirtype,
|
||||
notifidtype,
|
||||
notifdirtypeTest,
|
||||
notifidtypeTest,
|
||||
listnotif,
|
||||
listnotiftype,
|
||||
listnotiftypeTest,
|
||||
listnotifid,
|
||||
listnotifidTest,
|
||||
getMyUsername,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,6 +27,31 @@
|
||||
<q-btn class="centermydiv q-ma-sm" color="green" :label="`Invia Notifica a ` + myuser.username" @click="sendNotifToUser"></q-btn>
|
||||
</div>
|
||||
|
||||
<div
|
||||
v-if="myuser.username && tools.isManager()"
|
||||
class="q-ma-sm row bordo_stondato" style="min-width: 300px; ">
|
||||
|
||||
<div class="row">
|
||||
<q-select rounded outlined v-model="notifdirtypeTest" :options="listnotiftypeTest" label="Tipo" emit-value map-options>
|
||||
</q-select>
|
||||
|
||||
<q-select rounded outlined v-model="notifidtypeTest" :options="listnotifidTest" label="Notifica" emit-value map-options>
|
||||
</q-select>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<q-input
|
||||
v-model="title" label="Titolo TEST"
|
||||
style="width: 300px;"></q-input>
|
||||
<q-input
|
||||
v-model="mynotif" label="Notifica TEST da Inviare"
|
||||
input-class="myinput-area"
|
||||
style="width: 300px;"></q-input>
|
||||
</div>
|
||||
<br>
|
||||
<q-btn class="centermydiv q-ma-sm" color="green" :label="`Invia Notifica TEST a ` + myuser.username" @click="sendNotifToUserTest"></q-btn>
|
||||
</div>
|
||||
|
||||
|
||||
<!--<CCopyBtn title="Copia Dati" :texttocopy="risultato"></CCopyBtn>-->
|
||||
|
||||
|
||||
@@ -660,7 +660,7 @@ const msg_it = {
|
||||
titlegranted: 'Permesso Notifiche Abilitato!',
|
||||
statusnot: 'Stato Notifiche',
|
||||
titledenied: 'Permesso Notifiche Disabilitato!',
|
||||
title_subscribed: 'Sottoscrizione a {sitename}!',
|
||||
title_subscribed: '{sitename} abilitato ai messaggi push !',
|
||||
subscribed: 'Ora potrai ricevere i messaggi e le notifiche.',
|
||||
newVersionAvailable: 'Aggiorna',
|
||||
provinces: 'Province',
|
||||
@@ -780,7 +780,9 @@ const msg_it = {
|
||||
telegrammsg: 'Telegram',
|
||||
notif: 'Notifica',
|
||||
notifs: 'Notifiche',
|
||||
coins: 'Notifiche Transazioni',
|
||||
nonotif: 'Nessuna Nuova Notifica',
|
||||
nocoins: 'Nessuna Nuova Transazione',
|
||||
warn_province: 'nelle Province',
|
||||
warn_sector: 'in un Settore',
|
||||
warn_region: 'nelle Regioni',
|
||||
@@ -805,6 +807,8 @@ const msg_it = {
|
||||
circuits: 'Circuiti',
|
||||
circuits_descr: 'Avvisami:',
|
||||
booking: 'Prenotazioni',
|
||||
test: 'Test',
|
||||
test_descr: 'Test descr',
|
||||
},
|
||||
notifsid: {
|
||||
bacheca_new_good: 'Nuovo Bene',
|
||||
@@ -813,6 +817,7 @@ const msg_it = {
|
||||
friends_new: 'Nuova Richiesta di Amicizia',
|
||||
groups_new: 'Si creano Nuovi Gruppi',
|
||||
circuits_new: 'Si creano Nuovi Circuiti',
|
||||
test_new: 'Nuovo Test',
|
||||
},
|
||||
event: {
|
||||
_id: 'id',
|
||||
|
||||
@@ -26,7 +26,7 @@ axiosInstance.interceptors.response.use(
|
||||
// console.log('error', error)
|
||||
if (error.response) {
|
||||
if (process.env.DEBUGGING === '1') console.log('Status = ', error.response.status)
|
||||
console.log('Request Error: ', error.response)
|
||||
console.log('Request Error: ', error.response)
|
||||
if (error.response.status !== 0) {
|
||||
globalStore.setStateConnection('online')
|
||||
} else {
|
||||
@@ -149,11 +149,13 @@ async function Request(type: string, path: string, payload: any): Promise<Types.
|
||||
}
|
||||
|
||||
if (error.response) {
|
||||
let code = 0
|
||||
if (error.response.data && error.response.data.code) {
|
||||
code = error.response.data.code
|
||||
mycode = error.response.data.code
|
||||
userStore.setServerCode(mycode)
|
||||
}
|
||||
return Promise.reject(new Types.AxiosError(error.response.status, error.response.data, error.response.data.code))
|
||||
return Promise.reject(new Types.AxiosError(error.response.status, error.response.data, code))
|
||||
}
|
||||
return Promise.reject(new Types.AxiosError(0, null, mycode, error))
|
||||
}
|
||||
|
||||
@@ -3072,7 +3072,7 @@ export const tools = {
|
||||
},
|
||||
|
||||
SignIncheckErrors(mythisq: any, $router: Router, route: any, riscode: any, ispageLogin ?: boolean) {
|
||||
// console.log('SignIncheckErrors: ', riscode)
|
||||
console.log('SignIncheckErrors: ', riscode)
|
||||
const $q = useQuasar()
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
@@ -3435,11 +3435,13 @@ export const tools = {
|
||||
this.scrollToElement(element)
|
||||
},
|
||||
scrollToElement(el: any) {
|
||||
const target = getScrollTarget(el)
|
||||
const offset = el.offsetTop
|
||||
const duration = 500
|
||||
console.log('target', target, 'offset', offset, 'duration', duration)
|
||||
setScrollPosition(target, offset, duration)
|
||||
if (el) {
|
||||
const target = getScrollTarget(el)
|
||||
const offset = el.offsetTop
|
||||
const duration = 500
|
||||
console.log('target', target, 'offset', offset, 'duration', duration)
|
||||
setScrollPosition(target, offset, duration)
|
||||
}
|
||||
},
|
||||
|
||||
getCellForWhatsapp(numbercell: string) {
|
||||
@@ -4745,6 +4747,7 @@ export const tools = {
|
||||
// console.log('OUT', res)
|
||||
|
||||
if (res && res.user) {
|
||||
console.log('updateMyData')
|
||||
userStore.my = res.user
|
||||
|
||||
if (res.listcircuits) {
|
||||
@@ -6374,6 +6377,7 @@ export const tools = {
|
||||
roundDec2(mynum: number): number {
|
||||
return (Math.round(mynum * 100) / 100)
|
||||
},
|
||||
|
||||
// getLocale() {
|
||||
// if (navigator.languages && navigator.languages.length > 0) {
|
||||
// return navigator.languages[0]
|
||||
|
||||
@@ -20,7 +20,13 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
getters: {
|
||||
|
||||
getlasts_notifs: (mystate: INotifState) => (): INotif[] => {
|
||||
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => mystate.show_all ? true : !rec.read) : []
|
||||
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => (mystate.show_all ? true : !rec.read) && (rec.typedir !== shared_consts.TypeNotifs.TYPEDIR_CIRCUITS)) : []
|
||||
return (ctrec)
|
||||
|
||||
},
|
||||
|
||||
getlasts_coins: (mystate: INotifState) => (): INotif[] => {
|
||||
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => (mystate.show_all ? true : !rec.read) && (rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS)) : []
|
||||
return (ctrec)
|
||||
|
||||
},
|
||||
@@ -32,7 +38,12 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
},
|
||||
|
||||
getnumNotifUnread: (mystate: INotifState) => () => {
|
||||
const myarr = mystate.last_notifs.filter((notif) => !notif.read)
|
||||
const myarr = mystate.last_notifs.filter((notif) => !notif.read && (notif.typedir !== shared_consts.TypeNotifs.TYPEDIR_CIRCUITS))
|
||||
return (tools.isArray(myarr) ? myarr.length : 0)
|
||||
},
|
||||
|
||||
getnumCoinsUnread: (mystate: INotifState) => () => {
|
||||
const myarr = mystate.last_notifs.filter((notif) => !notif.read && (notif.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS))
|
||||
return (tools.isArray(myarr) ? myarr.length : 0)
|
||||
},
|
||||
|
||||
@@ -89,8 +100,8 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
}
|
||||
},
|
||||
|
||||
setAllRead(username: string) {
|
||||
return Api.SendReq(`/sendnotif/setall/${username}/${process.env.APP_ID}`, 'GET', null)
|
||||
setAllRead(username: string, qualinotif: number) {
|
||||
return Api.SendReq(`/sendnotif/setall/${username}/${qualinotif}/${process.env.APP_ID}`, 'GET', null)
|
||||
.then((res) => {
|
||||
// console.log('res', res)
|
||||
if (res) {
|
||||
@@ -124,12 +135,15 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
|
||||
},
|
||||
|
||||
deleteAll(username: string, id: string) {
|
||||
return Api.SendReq(`/sendnotif/delall/${username}/${process.env.APP_ID}`, 'GET', null)
|
||||
deleteAll(username: string, qualinotif: number) {
|
||||
return Api.SendReq(`/sendnotif/delall/${username}/${qualinotif}/${process.env.APP_ID}`, 'GET', null)
|
||||
.then((res) => {
|
||||
// console.log('res', res)
|
||||
if (res) {
|
||||
this.last_notifs = []
|
||||
if (qualinotif === shared_consts.QualiNotifs.CIRCUITS)
|
||||
this.last_notifs = this.last_notifs.filter((rec: INotif) => rec.typedir !== shared_consts.TypeNotifs.TYPEDIR_CIRCUITS)
|
||||
else if (qualinotif === shared_consts.QualiNotifs.OTHERS)
|
||||
this.last_notifs = this.last_notifs.filter((rec: INotif) => rec.typedir === shared_consts.TypeNotifs.TYPEDIR_CIRCUITS)
|
||||
this.updateArrNotif()
|
||||
}
|
||||
|
||||
@@ -146,7 +160,7 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
},
|
||||
|
||||
async updateNotifDataFromServer({ username, lastdataread }: {username: string, lastdataread: Date}) {
|
||||
// console.log('updateNotifDataFromServer', username, lastdataread)
|
||||
console.log('updateNotifDataFromServer', username, lastdataread)
|
||||
|
||||
return Api.SendReq(`/sendnotif/${username}/${lastdataread}/${process.env.APP_ID}`, 'GET', null)
|
||||
.then((res) => {
|
||||
@@ -157,6 +171,7 @@ export const useNotifStore = defineStore('NotifStore', {
|
||||
this.last_notifs = []
|
||||
}
|
||||
this.updateArrNotif()
|
||||
tools.updateMyData(res.data)
|
||||
return true
|
||||
})
|
||||
.catch((error) => {
|
||||
|
||||
@@ -310,14 +310,17 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
IsMyCircuitByUser(user: IUserFields): any[] {
|
||||
|
||||
if (!this.my.profile.mycircuits || !user.profile.mycircuits)
|
||||
if (!this.my.profile.mycircuits || (!user || !user.profile || !user.profile.mycircuits))
|
||||
return []
|
||||
return tools.getCommon([...this.my.profile.mycircuits], [...user.profile.mycircuits], 'circuitname')
|
||||
},
|
||||
|
||||
|
||||
getAccountByCircuitId(circuitId: string): any {
|
||||
return this.my.profile.useraccounts.find((rec: IAccount) => rec.circuitId === circuitId)
|
||||
if (this.my.profile.useraccounts) {
|
||||
return this.my.profile.useraccounts.find((rec: IAccount) => rec.circuitId === circuitId)
|
||||
}
|
||||
return null
|
||||
},
|
||||
|
||||
IsRefusedCircuitByName(circuitname: string): boolean {
|
||||
@@ -360,7 +363,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
},
|
||||
|
||||
isOldRegNotFinished(): boolean {
|
||||
return (!this.my.profile.teleg_id || this.my.profile.teleg_id <= 0) || !this.isUsernameTelegOk()
|
||||
return tools.isLogged() && ((!this.my.profile.teleg_id || this.my.profile.teleg_id <= 0) || !this.isUsernameTelegOk())
|
||||
// return this.my.verified_email! && this.my.profile.teleg_id! > 0 && this.my.verified_by_aportador!
|
||||
},
|
||||
|
||||
@@ -762,30 +765,6 @@ export const useUserStore = defineStore('UserStore', {
|
||||
console.log('LOGIN signin')
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
// console.log('MYLANG = ' + this.lang)
|
||||
|
||||
let sub = null
|
||||
|
||||
try {
|
||||
if (static_data.functionality.PWA) {
|
||||
if ('serviceWorker' in navigator) {
|
||||
console.log('serviceWorker')
|
||||
sub = await navigator.serviceWorker.ready
|
||||
.then((swreg) => {
|
||||
console.log('swreg')
|
||||
sub = swreg.pushManager.getSubscription()
|
||||
return sub
|
||||
})
|
||||
.catch((e) => {
|
||||
console.log(' ERROR ')
|
||||
sub = null
|
||||
})
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log('Err navigator.serviceWorker.ready ... GetSubscription:', e)
|
||||
}
|
||||
|
||||
const options = {
|
||||
title: tools.translate('notification.title_subscribed', [{
|
||||
strin: 'sitename',
|
||||
@@ -795,13 +774,10 @@ export const useUserStore = defineStore('UserStore', {
|
||||
openUrl: '/',
|
||||
}
|
||||
|
||||
console.log('2')
|
||||
|
||||
const usertosend = {
|
||||
username: authData.username.trim(),
|
||||
password: authData.password.trim(),
|
||||
lang: this.lang,
|
||||
subs: sub,
|
||||
options,
|
||||
}
|
||||
|
||||
@@ -813,7 +789,9 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
let myres: any
|
||||
|
||||
return Api.SendReq('/users/login', 'POST', usertosend, true)
|
||||
console.log('executing login...')
|
||||
|
||||
return await Api.SendReq('/users/login', 'POST', usertosend, true)
|
||||
.then((res) => {
|
||||
|
||||
myres = res
|
||||
|
||||
@@ -68,6 +68,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
leftDrawerOpen: false,
|
||||
rightDrawerOpen: false,
|
||||
rightNotifOpen: false,
|
||||
rightCoinsOpen: false,
|
||||
rightCartOpen: false,
|
||||
stateConnection: stateConnDefault,
|
||||
serverError: false,
|
||||
@@ -606,7 +607,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
return subscription
|
||||
} else {
|
||||
// Create a new subscription
|
||||
console.log('Create a new subscription')
|
||||
console.log('#### Create a new subscription !!!')
|
||||
const convertedVapidPublicKey = urlBase64ToUint8Array(mykey)
|
||||
return reg.pushManager.subscribe({
|
||||
userVisibleOnly: true,
|
||||
@@ -696,7 +697,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
for (const table of ApiTables.allTables()) {
|
||||
await globalroutines('clearalldata', table, null)
|
||||
}
|
||||
}catch (e) {
|
||||
} catch (e) {
|
||||
//
|
||||
}
|
||||
|
||||
@@ -704,20 +705,23 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
if ('serviceWorker' in navigator) {
|
||||
// REMOVE ALL SUBSCRIPTION
|
||||
console.log('REMOVE ALL SUBSCRIPTION...')
|
||||
await navigator.serviceWorker.ready.then((reg) => {
|
||||
console.log('... Ready')
|
||||
reg.pushManager.getSubscription().then((subscription) => {
|
||||
console.log(' Found Subscription...')
|
||||
if (subscription) {
|
||||
subscription.unsubscribe().then((successful) => {
|
||||
// You've successfully unsubscribed
|
||||
console.log('You\'ve successfully unsubscribed')
|
||||
}).catch((e) => {
|
||||
// Unsubscription failed
|
||||
})
|
||||
}
|
||||
navigator.serviceWorker.ready
|
||||
.then((reg) => {
|
||||
console.log('... Ready')
|
||||
reg.pushManager.getSubscription().then((subscription) => {
|
||||
console.log(' Found Subscription...')
|
||||
if (subscription) {
|
||||
subscription.unsubscribe().then((successful) => {
|
||||
// You've successfully unsubscribed
|
||||
console.log('You\'ve successfully unsubscribed')
|
||||
}).catch((e) => {
|
||||
// Unsubscription failed
|
||||
})
|
||||
}
|
||||
})
|
||||
}).catch((err) => {
|
||||
console.error('err ready service worker', err)
|
||||
})
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
@@ -818,7 +822,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
.then((res) => {
|
||||
this.serverError = false
|
||||
// if (tools.isDebug())
|
||||
// console.table(res)
|
||||
// console.table(res)
|
||||
return res.data
|
||||
})
|
||||
.catch((error) => {
|
||||
@@ -968,7 +972,14 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
},
|
||||
|
||||
isErroreDispositivoServer() {
|
||||
return this.serverMsgError.code === -2
|
||||
if (this.serverMsgError) {
|
||||
if (this.serverMsgError.code)
|
||||
return this.serverMsgError.code === -2
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
|
||||
return false
|
||||
},
|
||||
|
||||
async saveSubRec(mydata: any) {
|
||||
@@ -1645,7 +1656,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
|
||||
if (table === toolsext.TABMYGOODS) {
|
||||
obj['idSectorGood'] = []
|
||||
} else if ((table === toolsext.TABMYSKILLS) ) {
|
||||
} else if ((table === toolsext.TABMYSKILLS)) {
|
||||
obj['idSector'] = []
|
||||
}
|
||||
|
||||
@@ -1684,10 +1695,10 @@ export const useGlobalStore = defineStore('GlobalStore', {
|
||||
getServerHost() {
|
||||
|
||||
let myserv = ''
|
||||
myserv = window.location.host
|
||||
// myserv = window.location.host
|
||||
|
||||
if (process.env.DEBUGGING) {
|
||||
myserv = 'http://localhost:3000'; // 'http://192.168.1.54:3000'
|
||||
myserv = process.env.MONGODB_HOST! // 'http://192.168.1.54:3000'
|
||||
} else {
|
||||
myserv = process.env.MONGODB_HOST!
|
||||
}
|
||||
|
||||
@@ -1,146 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<title>
|
||||
Terra della Visione
|
||||
</title>
|
||||
<meta charset=utf-8>
|
||||
<meta name=description content="Terra della Visione">
|
||||
<meta name=format-detection content="telephone=no">
|
||||
<meta name=msapplication-tap-highlight content=no>
|
||||
<meta name=viewport content="user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1,width=device-width">
|
||||
|
||||
<div style="text-align: center">
|
||||
<h1>TERRA DELLA VISIONE</h1><br>
|
||||
|
||||
<h3><em>Sito in costruzione</em></h3>
|
||||
|
||||
<img src="logo.png" alt="logo terra della visione"><br>
|
||||
<br>
|
||||
|
||||
<a href="https://t.me/terradellavisione">Canale Telegram <strong>Terra Della Visione</strong></a><br><br>
|
||||
<a href="https://goo.gl/maps/Wx3STLXd5C64VG5A8">Posizione sulla Mappa di <strong>Terra Della Visione</strong></a><br>
|
||||
|
||||
|
||||
<br>
|
||||
|
||||
</div>
|
||||
<p>
|
||||
<!--
|
||||
<h2><strong>Magicamente Donna</strong></h2>:<br>
|
||||
Seminario Esperienziale di 2 giorni<br>
|
||||
|
||||
Figlia del Sole e della Luna è arrivato il tempo di riunirci nella Terra della Visione che ci accoglie con Amore a Noto Antica.
|
||||
Nei due giorni del seminario esploreremo la Madre Natura, che è parte di noi, ci inebrieremo dei suoi profumi, colori, della sua ricchezza che è la nostra
|
||||
ricchezza.<br>
|
||||
Vivremo insieme la Benedizione della Madre Luna e la Benedizione della Yoni, collegandoci a tutte le Donne del Pianeta Terra.
|
||||
Ci prepariamo ad accogliere l'estate e l' Archetipo della Madre con una meditAzione.<br>
|
||||
Insieme daremo forma a un Mandala creato con gli elementi della natura.<br>
|
||||
<br>
|
||||
Cammineremo nel silenzio e presenza nella Natura e sarà il cuore con il suo battito a guidarci.<br>
|
||||
Sarà un viaggio negli elementi, alla scoperta del nuovo che si manifesta nella Luce.<br>
|
||||
Faremo i viaggi nel Tao e nel Tantra Femminile per riscoprire sempre più la Magia che è parte di noi e della Vita Stessa.<br>
|
||||
<br>
|
||||
Le tue compagne di viaggio saranno :<br>
|
||||
Aurora: Donna che pratica la cura con l'arte, il tocco e il canto;<br>
|
||||
Chandra: Creatrice di oggetti sacri;<br>
|
||||
SashaShakti: Armonizzatrice del Sacro Femminino.<br>
|
||||
<br>
|
||||
<strong>📅 Quando</strong>:<br>
|
||||
Sabato 14 e Domenica 15 Maggio 2022<br>
|
||||
dalle 10.00 alle 19.00<br>
|
||||
<br>
|
||||
<strong>🏠 Dove:</strong><br>
|
||||
"Terra della Visione" a Noto Antica (Siracusa)<br>
|
||||
<a href="https://goo.gl/maps/Wx3STLXd5C64VG5A8">vedi Posizione</a><br>
|
||||
<br>
|
||||
<strong>🍽 Pasti:</strong><br>
|
||||
- sabato pranzo e cena al sacco (ognuno porta qualcosa e lo condividiamo)<br>
|
||||
- pranzo di Domenica - chi vuole su prenotazione (primo + insalata + fetta di torta, contributo 7€).<br>
|
||||
<br>
|
||||
<strong>Cosa portare:</strong><br>
|
||||
- stoviglie personali (piatto, forchetta, bicchiere o borraccia).<br>
|
||||
- Tappetino, cuscino e plaid.<br>
|
||||
<br>
|
||||
<strong>Possibilità di pernottamento</strong><br>
|
||||
- in Sala condivisa<br>
|
||||
- in propria tenda / camper<br>
|
||||
- in nostra tenda su letto con materasso.<br>
|
||||
<br>
|
||||
<strong>Contributo Seminario:</strong><br>
|
||||
- per 2 giorni: 40 €<br>
|
||||
- per 1 solo giorno 25 €<br>
|
||||
La Quota potrà essere versata direttamente la mattina del Seminario.<br>
|
||||
Per chi ha difficoltà, accogliamo altre proposte di scambio....<br>
|
||||
- massimo 20 partecipanti<br>
|
||||
<br>
|
||||
Per chi fosse interessata al Seminario per maggiori informazioni, telefonare a:<br>
|
||||
Aurora 351/1496717<br>
|
||||
Chandra 377/1781918<br>
|
||||
Sasha 335/5687365<br>
|
||||
<br>
|
||||
Per info organizzative scrivete a Surya:<br>
|
||||
Telegram: t.me/surya1977<br>
|
||||
351/6000345<br>
|
||||
<br>
|
||||
Per iscriversi compilare il <a href="https://forms.gle/rUurxeipnuPve2Sv7">Modulo d'iscrizione</a><br>
|
||||
<br>
|
||||
Vi manderemo un messaggio di conferma dell'iscrizione.<br>
|
||||
</p>
|
||||
-->
|
||||
|
||||
<h2><strong>"Sentire - Essere - Creare":</strong></h2>
|
||||
<p>
|
||||
<strong>Domenica 22/5/22 organizziamo la giornata</strong><br>
|
||||
<br>
|
||||
dove la respirazione, movimenti col corpo, le nostre mani e la musica ci aiutano ad entrare in un spazio di sentire ed introspezione.<br>
|
||||
<br>
|
||||
Tema centrale sarà "OLTRE Il MENTALE" (intuizione/ rinascita)<br>
|
||||
<br>
|
||||
<strong>👉 Programma</strong><br>
|
||||
9.30: accoglienza<br>
|
||||
10.00: yoga della verticalità *<br>
|
||||
11.00: cerchio di canto e percussione*<br>
|
||||
13.00 - 14.30: pausa pranzo<br>
|
||||
14.30: prendersi cura*<br>
|
||||
16.00: suoni per la salute<br>
|
||||
16.30 - 17.30: arte marziale (esercizi accessibili per tutti)<br>
|
||||
17.30 - 18.00: respirazione - EK - ONG - KAR<br>
|
||||
<br>
|
||||
📅 Quando:<br>
|
||||
Domenica 22 Maggio 2022<br>
|
||||
<br>
|
||||
🏠 Dove:<br>
|
||||
<strong>"Terra della Visione"</strong> a Noto Antica (Siracusa)<br>
|
||||
vedi Posizione: https://goo.gl/maps/Wx3STLXd5C64VG5A8<br>
|
||||
<br>
|
||||
Per chi vuole, c'è la possibilità di avere un accompagnamento personalizzato con le posizione delle mani durante prendersi cura<br>
|
||||
<br>
|
||||
<strong>Contributo</strong>:<br>
|
||||
- la giornata intera 20€<br>
|
||||
- cerchio di canto e percussione 10€<br>
|
||||
- solo pomeriggio 15 €<br>
|
||||
<br>
|
||||
<strong>Posti limitati</strong>:<br>
|
||||
chiediamo gentilmente di prenotare. Dopo l'iscrizione vi mandiamo tutte le informazioni pratiche.<br>
|
||||
<br>
|
||||
Le entrate saranno investite per dare ai bambini la possibilità di sviluppare e vivere le loro unicità.<br>
|
||||
<br>
|
||||
💨👣🌹<br>
|
||||
<br>
|
||||
* "Yoga" della verticalità sono esercizi molto facili, ispirati delle posture di Faraoni, che facilitano la flessibilità della schiena e una postura più
|
||||
dritta.<br>
|
||||
<br>
|
||||
* Cerchio: cantiamo e suoniamo maracas/tamburo/djembe per svegliare la forza "interiore" e la creatività<br>
|
||||
<br>
|
||||
* EK -ONG - KAR: ogni suono va con un certo tipo di inspirazione ed espirazione<br>
|
||||
<br>
|
||||
* prendersi cura: sdraiati ci si focalizza sulla respirazione, mettendo le mani su determinati punti del proprio corpo. Il tutto accompagnato da musica dal
|
||||
vivo su lo shanti, la tampura, e le campane tibetane.<br>
|
||||
<br>
|
||||
Per maggiori informazioni:<br>
|
||||
<strong>Els</strong>: 340/3918057<br>
|
||||
|
||||
</p>
|
||||
</body>
|
||||
</html>
|
||||
@@ -7,9 +7,15 @@
|
||||
|
||||
Occorre prima registrarsi alla App </h3>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-else-if="tools.isLogged()">
|
||||
<h3>Circuito non Esistente</h3>
|
||||
</div>
|
||||
<div v-else>
|
||||
<div v-if="!tools.isLogged()">
|
||||
<CCheckIfIsLogged></CCheckIfIsLogged>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
||||
|
||||
@@ -78,31 +78,37 @@ export default defineComponent({
|
||||
}
|
||||
|
||||
async function loadProfile() {
|
||||
// Carica il profilo di quest'utente
|
||||
if (username.value) {
|
||||
await userStore.loadUserProfile({ username: username.value, idnotif: idnotif.value }).then((ris) => {
|
||||
myuser.value = ris
|
||||
if (myuser.value) {
|
||||
filtroutente.value = [{ userId: myuser.value._id }]
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
console.log('loadProfile...', username.value)
|
||||
try {
|
||||
// Carica il profilo di quest'utente
|
||||
if (username.value) {
|
||||
await userStore.loadUserProfile({ username: username.value, idnotif: idnotif.value }).then((ris) => {
|
||||
console.log('loadUserProfile = ', ris)
|
||||
myuser.value = ris
|
||||
if (myuser.value) {
|
||||
filtroutente.value = [{ userId: myuser.value._id }]
|
||||
notifStore.setAsRead(idnotif.value)
|
||||
|
||||
try {
|
||||
listgroupsfiltered.value = globalStore.mygroups.filter((grp: IMyGroup) => myuser.value!.profile.mygroups.findIndex((rec: IMyGroup) => rec.groupname === grp.groupname) >= 0)
|
||||
} catch (e) {
|
||||
listgroupsfiltered.value = []
|
||||
}
|
||||
|
||||
try {
|
||||
listcircuitsfiltered.value = myuser.value.profile.mycircuits
|
||||
} catch (e) {
|
||||
listcircuitsfiltered.value = []
|
||||
}
|
||||
|
||||
try {
|
||||
listgroupsfiltered.value = globalStore.mygroups.filter((grp: IMyGroup) => myuser.value!.profile.mygroups.findIndex((rec: IMyGroup) => rec.groupname === grp.groupname) >= 0)
|
||||
} catch (e) {
|
||||
listgroupsfiltered.value = []
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
listcircuitsfiltered.value = myuser.value.profile.mycircuits
|
||||
} catch (e) {
|
||||
listcircuitsfiltered.value = []
|
||||
}
|
||||
|
||||
}
|
||||
})
|
||||
|
||||
}
|
||||
caricato.value = true
|
||||
}catch (e) {
|
||||
console.error('ERR loadProfile', e)
|
||||
}
|
||||
caricato.value = true
|
||||
}
|
||||
|
||||
watch(() => username.value, (to: any, from: any) => {
|
||||
|
||||
@@ -326,6 +326,7 @@
|
||||
</div>
|
||||
<div v-else-if="caricato">
|
||||
<h2>Utente {{ username }} non trovato</h2>
|
||||
({{filtroutente}})
|
||||
</div>
|
||||
</div>
|
||||
<div v-else>
|
||||
|
||||
Reference in New Issue
Block a user