fix Saldo when press refuse coins.

fix Risolvere problema del ritardo quando si fa il primo login...
This commit is contained in:
Paolo Arena
2022-09-16 17:39:28 +02:00
parent a194acfc69
commit 78a79e1ad5
53 changed files with 3779 additions and 3498 deletions

View File

@@ -29,6 +29,11 @@ export default defineComponent({
required: false,
default: true,
},
noButtAdd: {
type: Boolean,
required: false,
default: false,
},
ind: {
type: Number,
required: false,

View File

@@ -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"

View File

@@ -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"

View File

@@ -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,

View File

@@ -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>

View File

@@ -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,
}
},
})

View File

@@ -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">

View File

@@ -0,0 +1,4 @@
.myflex{
display: flex;
flex: 1;
}

View 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,
}
},
})

View 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>

View File

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

View File

@@ -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() {

View File

@@ -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"

View File

@@ -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
})

View File

@@ -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,

View File

@@ -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>

View File

@@ -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'