Переглянути джерело

消息去掉未读数量接口

hangb 7 роки тому
батько
коміт
78739d7922

+ 16 - 16
src/main/webapp/resources/js/admin/app.js

@@ -979,8 +979,7 @@
 
          $scope.newsTableParams = new ngTableParams({
              page : 1,
-             count : 5,
-			 type : '确认收款,付款申请,财务结算'
+             count : 5
          }, {
              total : 0,
              getData : function ($defer, params) {
@@ -989,6 +988,7 @@
                  adminNews.getNewsList(param, function (data) {
                      params.total(data.totalElements);
                      $defer.resolve(data.content);
+                     $scope.totalElements = data.totalElements
                      data.content.forEach(function (item) {
                      	if (item.type == "APPLY_PAID_TYPE" || item.type == "CONFIRM_PAID_TYPE" || item.type == "FINANCIAL_SETTLEMENT_TYPE"){
 							var _arr = item.content.split(' ')[1];
@@ -1010,14 +1010,14 @@
              }
          });
 
-         /**
-          * 获取未读消息数量
-          */
-         adminNews.unreadCount({}, function(data){
-             $scope.unreadCount = data.count;
-         }, function(res){
-             toaster.pop('error', '系统错误', '获取未读消息数量失败' + res.data);
-         });
+         // /**
+         //  * 获取未读消息数量
+         //  */
+         // adminNews.unreadCount({}, function(data){
+         //     $scope.unreadCount = data.count;
+         // }, function(res){
+         //     toaster.pop('error', '系统错误', '获取未读消息数量失败' + res.data);
+         // });
 
          /**
           * 跳转消息详情页
@@ -1033,12 +1033,12 @@
              if (data.type == "FINANCIAL_SETTLEMENT_TYPE") {
                  window.location.href = 'admin#/check/settlement'
              }
-             adminNews.read({messageId: data.id}, null, function () {
-                 adminNews.unreadCount({}, function(data){
-                     $scope.unreadCount = data.count;
-                 }, function(res){
-                     toaster.pop('error', '系统错误', '获取未读消息数量失败' + res.data);
-                 });
+             adminNews.read({messageId: data.id, type: data.type}, null, function () {
+                 // adminNews.unreadCount({}, function(data){
+                 //     $scope.unreadCount = data.count;
+                 // }, function(res){
+                 //     toaster.pop('error', '系统错误', '获取未读消息数量失败' + res.data);
+                 // });
              }, function(res){
                  toaster.pop('error' + res.data);
              });

+ 1 - 1
src/main/webapp/resources/view/admin/news.html

@@ -120,7 +120,7 @@
     }
 </style>
 <div id="msg" ng-controller="adminNewsCtrl">
-	<span class="message" ng-click="lookNews()">待处理 <i class="fa fa-angle-double-down angle-hover-up"></i><span class="red-dot" ng-bind="unreadCount">99</span></span>
+	<span class="message" ng-click="lookNews()">待处理 <i class="fa fa-angle-double-down angle-hover-up"></i><span class="red-dot" ng-bind="totalElements || '0'">99</span></span>
 	<div class="msg-show" ng-show="newShow">
 		<table ng-table="newsTableParams">
 			<thead>