zhengkaixin 2 years ago
parent
commit
b2fb0b9113
2 changed files with 56 additions and 1 deletions
  1. 7 0
      src/apis/Common/notice.js
  2. 49 1
      src/views/Master/Home.vue

+ 7 - 0
src/apis/Common/notice.js

@@ -1,6 +1,13 @@
 import request from '@/utils/request'
 import Qs from 'qs';
 
+export function checkPageList(data) {
+	return request({
+		url: '/mobile/doc/checkPageList' ,
+		data: Qs.stringify(data),
+		method: 'post',
+	})
+}
 //获取通知列表
 export function getNoticeList(params) {
 	return request({

+ 49 - 1
src/views/Master/Home.vue

@@ -32,12 +32,16 @@
 				<div class="vongi-index">
 					<ul class="mui-table-view mui-grid-view mui-grid-9 vongi-grid-head">
 						<li v-for="(item,index) in common_menu_list" :class="'mui-table-view-cell mui-media mui-col-xs-3 '+(item.iconRoute?'':'kfz')">
+							<span class="mui-badge mui-badge-danger" style="    z-index: 999;" v-show="badgeObj[item.iconRoute]" >{{badgeObj[item.iconRoute]}}</span>
+							
 							<a v-if="item.iconUrl" @click="goto(item.iconUrl)">
 								<img :src="requirePic(item.iconCommonPic)" />
+								
 								<div class="mui-media-body" v-text="item.iconName"></div>
 							</a>
 							<router-link v-else :to="{name:item.iconRoute,query:item.iconParam}">
 								<img :src="requirePic(item.iconCommonPic)" />
+							
 								<div class="mui-media-body" v-text="item.iconName"></div>
 							</router-link>
 						</li>
@@ -45,6 +49,8 @@
 				</div>
 				<ul class="mui-table-view mui-grid-view mui-grid-9">
 					<li v-for="(item,index) in menu_list" :class="'mui-table-view-cell mui-media mui-col-xs-3 '+(item.iconRoute?'':'kfz')">
+						<span class="mui-badge mui-badge-danger" style="    z-index: 999;" v-show="badgeObj[item.iconRoute]" >{{badgeObj[item.iconRoute]}}</span>
+						
 						<a v-if="item.iconUrl" @click="goto(item.iconUrl)">
 							<img :src="requirePic(item.iconPic)" />
 							<div class="mui-media-body" v-text="item.iconName"></div>
@@ -183,6 +189,7 @@
 		},
 		data() {
 			return {
+				badgeObj:{},
 				isLoading: false,
 
 				roleList: [],
@@ -313,12 +320,53 @@
 			},
 			//预读取通知消息
 			prefetchNotice() {
+				
+				
+				var list=this.common_menu_list;
+				var sz=[]
+				for(var i in list){
+					var  obj=list[i];
+					if("OaDocumentVerifyList"==obj.iconRoute){
+						sz.push(obj)
+					}
+				}
+				var list=this.menu_list;
+				
+				for(var i in list){
+					var  obj=list[i];
+					if("OaDocumentVerifyList"==obj.iconRoute){
+						sz.push(obj)
+					}
+				}
+				if(sz.length>0){
+					API_Notice.checkPageList({
+						pageIndex: 1,
+						pageSize: 1,
+						totalPage: 1,
+						type: 0,
+					}).then(response => {
+						this.isLoading = false;
+						// response.totalPage;
+						if( response.totalPage){
+							
+							this.badgeObj["OaDocumentVerifyList"]=response.recordsTotal
+							this.$forceUpdate()
+						}
+					
+					}).catch(error => {
+						this.isLoading = false;
+						mui.toast(error);
+					})
+				}
+				// if(OaDocumentVerifyList){
+					
+				// }
 				//this.isLoading = true;
 				API_Notice.prefetch().then(response => {
 					this.isLoading = false;
 
 					this.set_wd_message_num(response);
-
+						
 					this.getLastNotice();
 				}).catch(error => {
 					this.isLoading = false;