diff --git a/src/layout/components/userbar.vue b/src/layout/components/userbar.vue index 1df8ed6..284bcd7 100644 --- a/src/layout/components/userbar.vue +++ b/src/layout/components/userbar.vue @@ -21,7 +21,7 @@ - +
  • @@ -117,6 +117,7 @@ searchVisible: false, tasksVisible: false, msg: false, + msgLoading:false, msgList: [], unreadMsgNum:[] } @@ -214,7 +215,9 @@ message_id: em.id, is_read:true } + this.msgLoading = true; await this.$API.user.messages.read.post(params); + this.msgLoading = false; this.msgList.forEach(item => { if (item.id == em.id) { item.is_read = true; diff --git a/src/layout/index.vue b/src/layout/index.vue index bdcf784..e1dfebc 100644 --- a/src/layout/index.vue +++ b/src/layout/index.vue @@ -279,7 +279,10 @@ }, methods: { getWsResult(res){ - if(res.data.type == 21){ + if(res.data && res.data.type == 21){ + if(res.data.list_count_info && res.data.list_count_info.main_order_count.length>0){ + this.$store.commit("set_list_count_info", res.data.list_count_info.main_order_count); + } let apiMenu = tool.objCopy(tool.data.get("MENU")); apiMenu.forEach(item=>{ if(item.name == 'order'){ diff --git a/src/store/modules/msg.js b/src/store/modules/msg.js new file mode 100644 index 0000000..6c24d26 --- /dev/null +++ b/src/store/modules/msg.js @@ -0,0 +1,13 @@ +export default { + state: { + main_order_count:[] + }, + mutations: { + set_list_count_info(state, list){ + state.main_order_count = list; + }, + }, + actions: { + + } +} diff --git a/src/views/order/orderList/index.vue b/src/views/order/orderList/index.vue index 8567992..9e1e721 100644 --- a/src/views/order/orderList/index.vue +++ b/src/views/order/orderList/index.vue @@ -145,7 +145,7 @@ export default { params: {}, statusList:[], - countParams:{} + countParams:this.$store.state.msg.main_order_count } }, mounted() { @@ -158,7 +158,8 @@ export default { }, methods: { getWsResult(res){ - if(res.data.type == 21){ + if(res.data && res.data.type == 21){ + this.$store.commit('set_list_count_info',res.data.list_count_info.main_order_count); this.countParams = res.data.list_count_info.main_order_count; } },