|
@@ -36,6 +36,10 @@
|
|
|
:to="{name: 'UserPanel.Notice.List'}">
|
|
:to="{name: 'UserPanel.Notice.List'}">
|
|
|
<q-icon name="notifications_none" />
|
|
<q-icon name="notifications_none" />
|
|
|
پیام ها
|
|
پیام ها
|
|
|
|
|
+ <q-badge v-if="myNotSeenNotificationsCount !== 0"
|
|
|
|
|
+ color="warning">
|
|
|
|
|
+ {{ myNotSeenNotificationsCount }}
|
|
|
|
|
+ </q-badge>
|
|
|
</q-btn>
|
|
</q-btn>
|
|
|
<q-btn flat>
|
|
<q-btn flat>
|
|
|
<svg id="_000000ff"
|
|
<svg id="_000000ff"
|
|
@@ -85,6 +89,7 @@
|
|
|
<script>
|
|
<script>
|
|
|
import { mapMutations } from 'vuex'
|
|
import { mapMutations } from 'vuex'
|
|
|
import { User } from 'src/models/User.js'
|
|
import { User } from 'src/models/User.js'
|
|
|
|
|
+import { APIGateway } from 'src/api/APIGateway.js'
|
|
|
|
|
|
|
|
export default {
|
|
export default {
|
|
|
name: 'UserPanelHeader',
|
|
name: 'UserPanelHeader',
|
|
@@ -126,6 +131,14 @@ export default {
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
computed: {
|
|
computed: {
|
|
|
|
|
+ myNotSeenNotificationsCount: {
|
|
|
|
|
+ get () {
|
|
|
|
|
+ return this.$store.getters['Auth/myNotSeenNotificationsCount']
|
|
|
|
|
+ },
|
|
|
|
|
+ set (newValue) {
|
|
|
|
|
+ return this.$store.commit('Auth/updateMyNotSeenNotificationsCount', newValue)
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
isAdminPage () {
|
|
isAdminPage () {
|
|
|
return this.$route.name && this.$route.name.includes('Admin.')
|
|
return this.$route.name && this.$route.name.includes('Admin.')
|
|
|
},
|
|
},
|
|
@@ -140,6 +153,12 @@ export default {
|
|
|
this.loadAuthData()
|
|
this.loadAuthData()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ getMyNotSeenNotificationsCount () {
|
|
|
|
|
+ APIGateway.noticeReceiver.myNotSeenNotificationsCount()
|
|
|
|
|
+ .then((count) => {
|
|
|
|
|
+ this.myNotSeenNotificationsCount = count
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
loadAuthData () {
|
|
loadAuthData () {
|
|
|
this.user = this.$store.getters['Auth/user']
|
|
this.user = this.$store.getters['Auth/user']
|
|
|
},
|
|
},
|