|
|
@@ -713,13 +713,36 @@ define([ 'angularAMD', 'ui.router', 'ui-bootstrap', 'ngLocal', 'ngTable', 'commo
|
|
|
/**
|
|
|
* 卖家中心头部
|
|
|
*/
|
|
|
- app.controller('UserCenterHeaderCtrl', ['$scope', '$rootScope', 'BaseService', 'InternalMessage', function ($scope, $rootScope, BaseService, InternalMessage) {
|
|
|
+ app.controller('UserCenterHeaderCtrl', ['$scope', '$rootScope', 'BaseService', 'InternalMessage', '$http', function ($scope, $rootScope, BaseService, InternalMessage, $http) {
|
|
|
$scope.homeUrl = BaseService.getRootPath();
|
|
|
- InternalMessage.getUnread({isRead: 0}, function (data) {
|
|
|
- $rootScope.unReadMessCount = data.toRead;
|
|
|
- }, function (err) {
|
|
|
- toaster.pop('error', err || '获取未读消息数量失败');
|
|
|
- })
|
|
|
+ console.info($rootScope.userInfo);
|
|
|
+ InternalMessage.getUrl({}, function(data) {
|
|
|
+ var url = data.url;
|
|
|
+ if (url == "http://218.17.158.219:24000/message") {
|
|
|
+ url = 'http://192.168.253.6:24000/message';
|
|
|
+ }
|
|
|
+ var param = {
|
|
|
+ 'receiverUu': data.userUU,
|
|
|
+ 'receiverEnuu': data.enUU,
|
|
|
+ 'consumerApp': 'MALL',
|
|
|
+ 'isRead': 0
|
|
|
+ };
|
|
|
+ $http({
|
|
|
+ method: 'get',
|
|
|
+ dataType: 'json',
|
|
|
+ url: url + '/messages/count',
|
|
|
+ params: param
|
|
|
+ }).success(function (data) {
|
|
|
+ $rootScope.unReadMessCount = data.toRead;
|
|
|
+ }).error(function (response) {
|
|
|
+ toaster.pop('error', err || '获取未读消息数量失败');
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // InternalMessage.getUnread({isRead: 0}, function (data) {
|
|
|
+ // $rootScope.unReadMessCount = data.toRead;
|
|
|
+ // }, function (err) {
|
|
|
+ // toaster.pop('error', err || '获取未读消息数量失败');
|
|
|
+ // })
|
|
|
}]);
|
|
|
/**
|
|
|
* 采购单状态
|