added logic for notification

This commit is contained in:
Kostya
2023-12-20 17:29:02 +03:00
parent 33d40cc65a
commit 613ea20bb7
2 changed files with 18 additions and 12 deletions

View File

@@ -1,11 +1,9 @@
<template>
<transition name="fade">
<div class="notification" v-if="isAnimationOn">
<div class="notification__content">
<h3>Анимации выключены</h3>
</div>
<div class="notification" v-if="notification">
<div class="notification__content">
<h3>Успешное пополнение</h3>
</div>
</transition>
</div>
</template>
<script>
@@ -13,18 +11,18 @@ import '@/assets/css/ComponentsStyles/notification.css'
export default {
props: {
isAnimationOn: Boolean
notification: Boolean
},
emits: ['animationchange'],
emits: ['notificationremove'],
methods: {
NotificationsTimer() {
setTimeout(() => {
this.$emit('animationchange', false)
this.$emit('notificationremove')
}, 4000)
}
},
watch: {
isAnimationOn(newVal, oldVal) {
notification(newVal, oldVal) {
if (newVal !== oldVal) {
this.NotificationsTimer()
}

View File

@@ -49,7 +49,8 @@
</div>
</div>
</section>
<payments-modal v-if="openModal" @notifacetionmoney="notification = true" @closemodal="openModal = false" :payments="payments"></payments-modal>
<payments-modal v-if="openModal" @notifacetionmoney="NotificationMethod" @closemodal="openModal = false" :payments="payments"></payments-modal>
<notiicationwindow-component @notificationremove="NotificationMethod" :notification="notification"></notiicationwindow-component>
</div>
</template>
@@ -59,12 +60,14 @@ import ChatComponent from "@/components/ChatComponent.vue";
import HeaderComponent from "@/components/HeaderComponent.vue";
import PaymentsModal from "@/components/PaymentsModal.vue";
import ProfilemobilePage from "@/pages/adaptive-pages/ProfilemobilePage.vue";
import NotiicationwindowComponent from "@/components/NotiicationwindowComponent.vue";
import { GetCookie } from "@/assets/js/storage/CookieStorage";
import '@/assets/css/PagesStyles/profile.css'
import {GetCurrentMoney} from "@/assets/js/rest/RestMethods";
export default {
components: {ProfilemobilePage, HeaderComponent, AsideBarComponent, ChatComponent, PaymentsModal },
components: {ProfilemobilePage, HeaderComponent, AsideBarComponent, ChatComponent, PaymentsModal, NotiicationwindowComponent },
data() {
return {
username: 'Artemka',
@@ -77,6 +80,7 @@ export default {
arrayHistory: [],
}
},
emits: ['notificationremove'],
mounted() {
this.checkWindowSize()
@@ -108,6 +112,10 @@ export default {
this.openModal = true
this.payments = false
},
NotificationMethod() {
this.notification = !this.notification
this.openModal = false
}
// formatNumber(number) {
// return number < 10 ? `0${number}` : number;
// },