|
@@ -1,6 +1,6 @@
|
|
|
<template>
|
|
|
<span>
|
|
|
- <el-badge :value="total" class="notice__badge">
|
|
|
+ <el-badge :value="notice" class="notice__badge">
|
|
|
<i class="el-icon-message-solid notice__icon" @click="toNotice()"></i>
|
|
|
</el-badge>
|
|
|
</span>
|
|
@@ -8,14 +8,14 @@
|
|
|
|
|
|
<script>
|
|
|
import { mapState, createNamespacedHelpers } from 'vuex';
|
|
|
-const { mapActions } = createNamespacedHelpers('notice');
|
|
|
+const { mapActions } = createNamespacedHelpers('shopNotice');
|
|
|
export default {
|
|
|
name: 'notice',
|
|
|
props: {},
|
|
|
components: {},
|
|
|
- data: function() {
|
|
|
+ data: function () {
|
|
|
return {
|
|
|
- list: [],
|
|
|
+ notice: [],
|
|
|
total: 0,
|
|
|
};
|
|
|
},
|
|
@@ -29,15 +29,16 @@ export default {
|
|
|
this.channel();
|
|
|
},
|
|
|
methods: {
|
|
|
- ...mapActions(['notRead']),
|
|
|
+ ...mapActions(['cnr']),
|
|
|
toNotice() {
|
|
|
- this.$router.push('/system/notice/view');
|
|
|
+ this.$router.push({ path: `/selfShop/notice` });
|
|
|
},
|
|
|
async getNotRead() {
|
|
|
- const res = await this.notRead({ lab_id: this.user.lab_id });
|
|
|
+ const res = await this.cnr(this.user.shop._id);
|
|
|
if (this.$checkRes(res)) {
|
|
|
- this.$set(this, `list`, res.data);
|
|
|
- this.$set(this, `total`, res.data.length);
|
|
|
+ console.log(res.data);
|
|
|
+ this.$set(this, `notice`, res.data);
|
|
|
+ // this.$set(this, `total`, res.data.length);
|
|
|
}
|
|
|
},
|
|
|
channel() {
|