Authored by Tao

modify news tips

... ... @@ -133,7 +133,6 @@ export default {
this.fetchChannelList();
}
this.init();
this.getAllInboxCatInfo();
this.PAGE_URL = window.location.href;
... ... @@ -152,7 +151,7 @@ export default {
this.refreshProductList(this.active);
},
methods: {
...mapActions(['fetchChannelList','getAllInboxCatInfo']),
...mapActions(['fetchChannelList']),
...mapActionsList(['fetchProductList']),
init() {
this.$nextTick(() => {
... ...
... ... @@ -12,7 +12,7 @@
<script>
import { createNamespacedHelpers } from 'vuex';
const { mapState } = createNamespacedHelpers('home/channel');
const { mapState, mapActions } = createNamespacedHelpers('home/channel');
import Widget from './widget';
export default {
... ... @@ -36,12 +36,16 @@ export default {
},
...mapState(['showMsg'])
},
watch: {
'showMsg':function(sss) {
console.log(sss);
}
activated() {
this.getAllInboxCatInfo();
},
// watch: {
// 'showMsg':function(sss) {
// console.log(sss);
// }
// },
methods: {
...mapActions(['getAllInboxCatInfo']),
onClick(index) {
this.$emit('click', index);
}
... ...
... ... @@ -54,12 +54,11 @@ export default function() {
Vue.set(state.channelList, 'page', productlist.page);
},
[Types.FETCH_NEWSACTIVE](state, { list }) {
state.showMsg = false;
list && list.map((item) => {
if (item.id === 6 && item.unReadCount > 0) {
if (item.unReadCount > 0) {
state.showMsg = true;
} else {
state.showMsg = false;
}
}
});
},
},
... ... @@ -88,10 +87,10 @@ export default function() {
}
},
async getAllInboxCatInfo({ commit }) {
const result = await this.$api.get('/api/ufo/home/getAllInboxCatInfo', {});
const result = await this.$api.get('/api/ufo/home/listInboxTypeInfo', {});
if (result.code === 200) {
commit(Types.FETCH_NEWSACTIVE, { list: result.data.list });
commit(Types.FETCH_NEWSACTIVE, { list: result.data || [] });
}
}
},
... ...
... ... @@ -132,10 +132,10 @@ module.exports = {
api: 'ufo.user.getUserAliPayAccountInfo',
param: {}
},
'/api/ufo/home/getAllInboxCatInfo': {
// ufo: true,
'/api/ufo/home/listInboxTypeInfo': {
ufo: true,
auth: true,
api: 'app.inbox.getAllInboxCatInfo',
api: 'ufo.users.listInboxTypeInfo',
param: {}
},
};
... ...