Showing
4 changed files
with
18 additions
and
16 deletions
@@ -133,7 +133,6 @@ export default { | @@ -133,7 +133,6 @@ export default { | ||
133 | this.fetchChannelList(); | 133 | this.fetchChannelList(); |
134 | } | 134 | } |
135 | this.init(); | 135 | this.init(); |
136 | - this.getAllInboxCatInfo(); | ||
137 | 136 | ||
138 | this.PAGE_URL = window.location.href; | 137 | this.PAGE_URL = window.location.href; |
139 | 138 | ||
@@ -152,7 +151,7 @@ export default { | @@ -152,7 +151,7 @@ export default { | ||
152 | this.refreshProductList(this.active); | 151 | this.refreshProductList(this.active); |
153 | }, | 152 | }, |
154 | methods: { | 153 | methods: { |
155 | - ...mapActions(['fetchChannelList','getAllInboxCatInfo']), | 154 | + ...mapActions(['fetchChannelList']), |
156 | ...mapActionsList(['fetchProductList']), | 155 | ...mapActionsList(['fetchProductList']), |
157 | init() { | 156 | init() { |
158 | this.$nextTick(() => { | 157 | this.$nextTick(() => { |
@@ -12,7 +12,7 @@ | @@ -12,7 +12,7 @@ | ||
12 | <script> | 12 | <script> |
13 | 13 | ||
14 | import { createNamespacedHelpers } from 'vuex'; | 14 | import { createNamespacedHelpers } from 'vuex'; |
15 | -const { mapState } = createNamespacedHelpers('home/channel'); | 15 | +const { mapState, mapActions } = createNamespacedHelpers('home/channel'); |
16 | import Widget from './widget'; | 16 | import Widget from './widget'; |
17 | 17 | ||
18 | export default { | 18 | export default { |
@@ -36,12 +36,16 @@ export default { | @@ -36,12 +36,16 @@ export default { | ||
36 | }, | 36 | }, |
37 | ...mapState(['showMsg']) | 37 | ...mapState(['showMsg']) |
38 | }, | 38 | }, |
39 | - watch: { | ||
40 | - 'showMsg':function(sss) { | ||
41 | - console.log(sss); | ||
42 | - } | 39 | + activated() { |
40 | + this.getAllInboxCatInfo(); | ||
43 | }, | 41 | }, |
42 | + // watch: { | ||
43 | + // 'showMsg':function(sss) { | ||
44 | + // console.log(sss); | ||
45 | + // } | ||
46 | + // }, | ||
44 | methods: { | 47 | methods: { |
48 | + ...mapActions(['getAllInboxCatInfo']), | ||
45 | onClick(index) { | 49 | onClick(index) { |
46 | this.$emit('click', index); | 50 | this.$emit('click', index); |
47 | } | 51 | } |
@@ -54,12 +54,11 @@ export default function() { | @@ -54,12 +54,11 @@ export default function() { | ||
54 | Vue.set(state.channelList, 'page', productlist.page); | 54 | Vue.set(state.channelList, 'page', productlist.page); |
55 | }, | 55 | }, |
56 | [Types.FETCH_NEWSACTIVE](state, { list }) { | 56 | [Types.FETCH_NEWSACTIVE](state, { list }) { |
57 | + state.showMsg = false; | ||
57 | list && list.map((item) => { | 58 | list && list.map((item) => { |
58 | - if (item.id === 6 && item.unReadCount > 0) { | 59 | + if (item.unReadCount > 0) { |
59 | state.showMsg = true; | 60 | state.showMsg = true; |
60 | - } else { | ||
61 | - state.showMsg = false; | ||
62 | - } | 61 | + } |
63 | }); | 62 | }); |
64 | }, | 63 | }, |
65 | }, | 64 | }, |
@@ -88,10 +87,10 @@ export default function() { | @@ -88,10 +87,10 @@ export default function() { | ||
88 | } | 87 | } |
89 | }, | 88 | }, |
90 | async getAllInboxCatInfo({ commit }) { | 89 | async getAllInboxCatInfo({ commit }) { |
91 | - const result = await this.$api.get('/api/ufo/home/getAllInboxCatInfo', {}); | 90 | + const result = await this.$api.get('/api/ufo/home/listInboxTypeInfo', {}); |
92 | 91 | ||
93 | if (result.code === 200) { | 92 | if (result.code === 200) { |
94 | - commit(Types.FETCH_NEWSACTIVE, { list: result.data.list }); | 93 | + commit(Types.FETCH_NEWSACTIVE, { list: result.data || [] }); |
95 | } | 94 | } |
96 | } | 95 | } |
97 | }, | 96 | }, |
@@ -132,10 +132,10 @@ module.exports = { | @@ -132,10 +132,10 @@ module.exports = { | ||
132 | api: 'ufo.user.getUserAliPayAccountInfo', | 132 | api: 'ufo.user.getUserAliPayAccountInfo', |
133 | param: {} | 133 | param: {} |
134 | }, | 134 | }, |
135 | - '/api/ufo/home/getAllInboxCatInfo': { | ||
136 | - // ufo: true, | 135 | + '/api/ufo/home/listInboxTypeInfo': { |
136 | + ufo: true, | ||
137 | auth: true, | 137 | auth: true, |
138 | - api: 'app.inbox.getAllInboxCatInfo', | 138 | + api: 'ufo.users.listInboxTypeInfo', |
139 | param: {} | 139 | param: {} |
140 | }, | 140 | }, |
141 | }; | 141 | }; |
-
Please register or login to post a comment