|
|
@@ -283,6 +283,7 @@ define(['app/app'], function(app) {
|
|
|
$scope.unReadMessCount = $rootScope.unReadMessCount;
|
|
|
$scope.allReadMessCount = 0;
|
|
|
var getData = function () {
|
|
|
+ //获取所有消息数量
|
|
|
InternalMessage.getUrl({}, function(data) {
|
|
|
|
|
|
var url = data.url;
|
|
|
@@ -303,9 +304,10 @@ define(['app/app'], function(app) {
|
|
|
}).success(function (data) {
|
|
|
$scope.allReadMessCount = data.count;
|
|
|
}).error(function (err) {
|
|
|
- toaster.pop('error', err || '获取未读消息数量失败');
|
|
|
+ toaster.pop('error', err || '获取所有消息数量失败');
|
|
|
});
|
|
|
})
|
|
|
+ //获取所有消息
|
|
|
InternalMessage.getUrl({}, function(info) {
|
|
|
if (info) {
|
|
|
var url = info.url;
|
|
|
@@ -331,9 +333,10 @@ define(['app/app'], function(app) {
|
|
|
}).success(function (data) {
|
|
|
$scope.messageAllData = data;
|
|
|
$scope.messageCurrent = data.content;
|
|
|
-
|
|
|
+ //获取消息id,并以“,”分隔。以便批量设为已读
|
|
|
var mess = new Array();
|
|
|
var b = '';
|
|
|
+ //根据type跳转页面
|
|
|
angular.forEach($scope.messageCurrent, function (message) {
|
|
|
message.content = $sce.trustAsHtml(message.content);
|
|
|
if(message.type =="MALL跳转买家已报价页面"){
|
|
|
@@ -350,6 +353,7 @@ define(['app/app'], function(app) {
|
|
|
b += message.id +",";
|
|
|
}
|
|
|
})
|
|
|
+ //设置消息为已读
|
|
|
mess = b.substring(0, b.length - 1);
|
|
|
var param = {
|
|
|
'receiverUu': info.userUU,
|
|
|
@@ -369,9 +373,11 @@ define(['app/app'], function(app) {
|
|
|
}).error(function (err) {
|
|
|
toaster.pop('error', err || '获取未读消息数量失败');
|
|
|
})
|
|
|
+
|
|
|
if ($scope.tab == 'no') {
|
|
|
// $rootScope.unReadMessCount = data.totalElements;
|
|
|
} else {
|
|
|
+ //获取未读消息数量
|
|
|
var param = {
|
|
|
'receiverUu': info.userUU,
|
|
|
'receiverEnuu': info.enUU,
|
|
|
@@ -385,7 +391,7 @@ define(['app/app'], function(app) {
|
|
|
params: param
|
|
|
}).success(function (data) {
|
|
|
$rootScope.unReadMessCount = data.count;
|
|
|
-
|
|
|
+ $scope.unReadMessCount = $rootScope.unReadMessCount;
|
|
|
}).error(function (err) {
|
|
|
toaster.pop('error', err || '获取未读消息数量失败');
|
|
|
});
|
|
|
@@ -394,6 +400,10 @@ define(['app/app'], function(app) {
|
|
|
}, function(response) {
|
|
|
toaster.pop('error', '获取消息失败,请重新刷新界面,');
|
|
|
});
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
};
|
|
|
|
|
|
// 批量删除
|