fix bug list circuits and transactionsenabled

This commit is contained in:
Paolo Arena
2022-09-24 20:21:29 +02:00
parent bc2080c42c
commit 201d148e31
29 changed files with 299 additions and 332 deletions

View File

@@ -87,32 +87,42 @@ export default defineComponent({
*/
watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => {
if (value === tools.FILTER_MYREC) {
if (props.table === toolsext.TABMYGROUPS) {
filtercustom.value = [{
'admins': {
$elemMatch: { username: { $eq: userStore.my.username } }
},
}]
} else if (props.table === toolsext.TABCIRCUITS) {
filtercustom.value = [{
'admins': {
$elemMatch: { username: { $eq: userStore.my.username } }
},
}]
} else {
filtercustom.value = [{ userId: userStore.my._id }]
}
function updatefilter(value: any) {
if (value === tools.FILTER_MYREC) {
if (props.table === toolsext.TABMYGROUPS) {
filtercustom.value = [{
'admins': {
$elemMatch: { username: { $eq: userStore.my.username } }
},
}]
} else if (props.table === toolsext.TABCIRCUITS) {
filtercustom.value = [{
'admins': {
$elemMatch: { username: { $eq: userStore.my.username } }
},
}]
} else if (value === tools.FILTER_MYFOLLOW) {
if (props.table === toolsext.TABMYGROUPS) {
}
} else {
filtercustom.value = []
filtercustom.value = [{ userId: userStore.my._id }]
}
} else if (value === tools.FILTER_MYFOLLOW) {
if (props.table === toolsext.TABMYGROUPS) {
}
} else {
filtercustom.value = []
}
}
watch(() => filtercustom.value, (value: any, oldval: any) => {
updatefilter(myrecfiltertoggle.value)
})
watch(() => myrecfiltertoggle.value, (value: any, oldval: any) => {
updatefilter(value)
},
)

View File

@@ -1,10 +1,9 @@
import { defineComponent, ref, computed, PropType, toRef, onMounted, onBeforeUnmount } from 'vue'
import { useUserStore } from '@store/UserStore'
import { useRouter } from 'vue-router'
import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { tools } from '@store/Modules/tools'
import { LandingFooter, Logo } from '@components'
import { IMyPage } from 'model'
export default defineComponent({
@@ -13,116 +12,23 @@ export default defineComponent({
props: {},
setup() {
const { t } = useI18n();
const $router = useRouter()
const visibile = ref(false)
const cardvisible = ref('hidden')
const displaycard = ref('block')
const firstClassSection = ref('fade homep-cover-img animate-fade homep-cover-img-1')
const polling: any = ref()
const slide = ref('first')
const animare = ref(0)
const rec = ref<IMyPage | null>(null)
function initprompt() {
window.addEventListener('beforeinstallprompt', (event) => {
// console.log('******************************** beforeinstallprompt fired')
event.preventDefault()
// console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ')
// #Todo++ IMPOSTA DEFERRED PROMPT
return false
})
}
const globalStore = useGlobalStore()
function created() {
initprompt()
animare.value = process.env.DEV ? 0 : 8000
}
async function created() {
onMounted(() => {
let primo = true
const mytime = 10000
polling.value = setInterval(() => {
firstClassSection.value = `landing_background fade homep-cover-img ${primo ? 'homep-cover-img-2' : 'homep-cover-img-1'}`
primo = !primo
rec.value = await globalStore.loadPage('/sostieni_il_progetto')
// console.log('this.firstClassSection', this.firstClassSection)
}, mytime)
})
function appname() {
return t('msg.myAppName')
}
onBeforeUnmount(() => {
console.log('beforeDestroy')
clearInterval(polling.value)
})
function meta() {
return {
keywords: { name: 'keywords', content: 'Quasar website' },
// meta tags
meta: {
mykey: { name: 'mykey', content: 'Key 1' },
description: { name: 'description', content: 'Page 1' },
keywords: { name: 'keywords', content: 'Quasar website' },
equiv: { 'http-equiv': 'Content-Type', content: 'text/html; charset=UTF-8' },
},
}
}
function mystilecard() {
return {
visibility: cardvisible.value,
display: displaycard.value,
}
}
function getPermission() {
return Notification.permission
}
function NotServiceWorker() {
return (!('serviceWorker' in navigator))
}
function PagLogin() {
$router.replace('/signin')
}
function PagReg() {
$router.replace('/signup')
}
function openCreatePostModal() {
console.log('APERTO ! openCreatePostModal')
visibile.value = !visibile.value
if (visibile.value) {
displaycard.value = 'block'
cardvisible.value = 'visible'
} else {
displaycard.value = 'block'
cardvisible.value = 'hidden'
}
}
created()
return {
t,
appname,
meta,
mystilecard,
getPermission,
NotServiceWorker,
PagLogin,
PagReg,
openCreatePostModal,
slide,
tools,
animare,
rec,
}
},
})

View File

@@ -1,21 +1,7 @@
<template>
<q-page class="text-black">
<div class="landing">
<section class="bg-white">
<div class=" row justify-between items-start q-col-gutter-sm">
<div class="col-12">
<div class="feature-item" style="margin-top: 0px !important;">
<div class="text-big" style="margin: 0px !important; padding: 2px !important;" v-html="t('homepage.freesostieni.title')"></div>
<p class="feat-descr" v-html="t('homepage.freesostieni.descr')"></p></div>
</div>
</div>
</section>
<LandingFooter></LandingFooter>
</div>
</q-page>
<div v-if="rec" class="landing">
<p class="feat-descr" v-html="rec.content"></p>
</div>
</template>
<script lang="ts" src="./CFundRaising.ts">

View File

@@ -1039,11 +1039,6 @@ export default defineComponent({
refresh()
})*/
watch(() => props.filtercustom, (newval, oldval) => {
// console.log('myfiltercustom change')
// refresh()
})
function isFacilitatore() {
return userStore.isFacilitatore
}

View File

@@ -12,6 +12,10 @@
<q-item-label><strong>{{ circuit.name }}</strong> <span v-if="circuit.subname"> ({{ circuit.subname }})</span>
</q-item-label>
<q-item-label v-if="circuit.longdescr" caption lines="3"><em>{{ circuit.longdescr }}</em></q-item-label>
<q-item-label v-if="!circuit.transactionsEnabled" caption lines="1">
<q-icon name="fas fa-lock">
</q-icon></q-item-label>
<q-item-label lines="1">
<CSaldo
:account="account"

View File

@@ -18,6 +18,7 @@
</q-item-label>
<q-item-label v-if="myrec.subname" lines="1" class="text_title">
<span>{{ myrec.subname }}</span>
<span v-if="!myrec.transactionsEnabled"><q-icon name="fas fa-lock"></q-icon></span>
</q-item-label>
<q-item-label lines="3" v-if="myrec.longdescr">{{ myrec.longdescr }}<br>
</q-item-label>

View File

@@ -84,7 +84,6 @@ export default defineComponent({
}
function mounted() {
initprompt()
let primo = true
const mytime = 10000
@@ -131,17 +130,6 @@ export default defineComponent({
}
}
function initprompt() {
window.addEventListener('beforeinstallprompt', function (event) {
// console.log('******************************** beforeinstallprompt fired')
event.preventDefault()
// console.log('§§§§§§§§§§§§§§§§§§§§ IMPOSTA DEFERRED PROMPT !!!!!!!!!!!!!!!!! ')
// #Todo++ IMPOSTA DEFERRED PROMPT
return false
})
}
function getPermission() {
return Notification.permission
}

View File

@@ -5,11 +5,13 @@ import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { tools } from '@store/Modules/tools'
import { LandingFooter, Logo } from '@components'
import { CFundRaising } from '@/components/CFundRaising'
import { CShowContentPage } from '@/components/CShowContentPage'
export default defineComponent({
name: 'CPresentazione',
components: {Logo, LandingFooter},
components: {Logo, LandingFooter, CFundRaising, CShowContentPage},
props: {},
setup() {
const { t } = useI18n();

View File

@@ -278,14 +278,14 @@
aria-hidden="true"
class="q-icon fas fa-street-view"> </i><h4>
{{ t('homepage.freeliving.title') }}</h4>
<p class="feat-descr" v-html="t('homepage.freeliving.descr')"></p></div>
<p class="feat-descr"><CShowContentPage path="/gruppi_territoriali_testo"></CShowContentPage></p></div>
</div>
<div class="col-12 col-sm-5">
<div class="feature-item"><i
aria-hidden="true"
class="q-icon fas fa-universal-access"> </i><h4>
{{ t('homepage.coin.title') }}</h4>
<p class="feat-descr" v-html="t('homepage.coin.descr')"></p></div>
<p class="feat-descr"><CShowContentPage path="/creditoris"></CShowContentPage></p></div>
</div>
</div>
</section>
@@ -299,11 +299,8 @@
<p class="feat-descr" v-html="t('homepage.freecollabora.descr')"></p></div>
</div>
<div class="col-12 col-sm-5">
<CFundRaising></CFundRaising>
<div class="feature-item" style="margin-top: 0px !important;">
<div class="text-big" style="margin: 0px !important; padding: 2px !important;" v-html="t('homepage.freesostieni.title')"></div>
<p class="feat-descr" v-html="t('homepage.freesostieni.descr')"></p>
</div>
</div>
<div class="col-12 col-sm-5">
<div class="feature-item"><i

View File

@@ -0,0 +1,38 @@
import { defineComponent, ref, computed, PropType, toRef, onMounted, onBeforeUnmount } from 'vue'
import { useGlobalStore } from '@store/globalStore'
import { useI18n } from '@/boot/i18n'
import { tools } from '@store/Modules/tools'
import { LandingFooter, Logo } from '@components'
import { IMyPage } from 'model'
export default defineComponent({
name: 'CShowContentPage',
components: {Logo, LandingFooter},
props: {
path: {
type: String,
required: true,
},
},
setup(props) {
const { t } = useI18n();
const rec = ref<IMyPage | null>(null)
const globalStore = useGlobalStore()
async function created() {
rec.value = await globalStore.loadPage(props.path)
}
created()
return {
t,
tools,
rec,
}
},
})

View File

@@ -0,0 +1,12 @@
<template>
<div v-if="rec">
<div v-html="rec.content"></div>
</div>
</template>
<script lang="ts" src="./CShowContentPage.ts">
</script>
<style lang="scss" scoped>
@import './CShowContentPage.scss';
</style>

View File

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

View File

@@ -64,3 +64,4 @@ export * from './CNotifSettings'
export * from './CSendCoins'
export * from './CCurrencyValue'
export * from './CNotifAtTop'
export * from './CShowContentPage'