add time_interval feature in notification

This commit is contained in:
weiweitoo
2018-07-26 10:58:56 +08:00
parent d9a818c05a
commit 74b84acf36
3 changed files with 86 additions and 4 deletions
+13 -3
View File
@@ -22,7 +22,7 @@
<el-button icon="el-icon-bell" circle></el-button>
</el-badge>
<el-dropdown-menu slot="dropdown" id="notification">
<span v-for="(item,index) in notification.message">
<div v-for="(item,index) in notification.message">
<a v-on:click.prevent='readNotification(item.id);navigateTo(item.link)'>
<el-dropdown-item>
<b v-if="item.is_read == 0">
@@ -31,9 +31,13 @@
<span v-else >
{{item.detail}}
</span>
<br/>
<span class="opacity80">
{{item.time_interval}}
</span>
</el-dropdown-item>
</a>
</span>
</div>
</el-dropdown-menu>
</el-dropdown>
@@ -119,6 +123,7 @@ export default {
this.loadingNotification=false;
this.notification = response.data;
this.bellBadge = this.notification.unread_message.length;
console.log(response.data);
}).catch((error) => {
console.log(error)
this.$router.push({
@@ -130,7 +135,6 @@ export default {
axios
.post('/api/notification/read-notification/'+notification_id)
.then((response) => {
console.log(1211);
this.getNotification();
}).catch((error) => {
console.log(error)
@@ -157,6 +161,12 @@ export default {
overflow-y: scroll;
overflow-x: hidden;
}
.el-dropdown-menu__item {
line-height: 26px;
}
.opacity80{
opacity: 0.8 ;
}
::-webkit-scrollbar {
width: 0px;
background: transparent; /* make scrollbar transparent */