|
@@ -1,6 +1,6 @@
|
|
(function (app) {
|
|
(function (app) {
|
|
- app.controller('homeCtrl', ["$scope", "$ionicTabsDelegate", "$http", 'config', "$state", "msg", "$ionicPopover", "homeService", "$ionicPopup", "$timeout", "$ionicSideMenuDelegate"
|
|
|
|
- , function ($scope,$ionicTabsDelegate, $http, config, $state, msg, $ionicPopover, homeService, $ionicPopup, $timeout, $ionicSideMenuDelegate) {
|
|
|
|
|
|
+ app.controller('homeCtrl', ["$scope", "$ionicTabsDelegate", "$http", 'config', "$state", "msg", "$ionicPopover", "homeService", "$ionicPopup", "$timeout", "$ionicSideMenuDelegate", "$rootScope"
|
|
|
|
+ , function ($scope, $ionicTabsDelegate, $http, config, $state, msg, $ionicPopover, homeService, $ionicPopup, $timeout, $ionicSideMenuDelegate, $rootScope) {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$scope.$on('$ionicView.beforeEnter', function () {
|
|
$ionicTabsDelegate.showBar(true);
|
|
$ionicTabsDelegate.showBar(true);
|
|
$scope.load(true);
|
|
$scope.load(true);
|
|
@@ -16,6 +16,11 @@
|
|
|
|
|
|
});
|
|
});
|
|
});
|
|
});
|
|
|
|
+ $rootScope.$on('msg-new', function (event, msg) {
|
|
|
|
+ //收到新消息
|
|
|
|
+ alert('收到新消息,改变样式');
|
|
|
|
+ $scope.showMessage = 1;
|
|
|
|
+ })
|
|
$scope.type = 'hot';//tab切换
|
|
$scope.type = 'hot';//tab切换
|
|
|
|
|
|
//$scope.chosedIndex = 0;
|
|
//$scope.chosedIndex = 0;
|
|
@@ -97,6 +102,7 @@
|
|
users: [],
|
|
users: [],
|
|
dreams:[]
|
|
dreams:[]
|
|
};
|
|
};
|
|
|
|
+
|
|
$scope.next = function (type) {
|
|
$scope.next = function (type) {
|
|
//type:1 前一个,type:2 后一个
|
|
//type:1 前一个,type:2 后一个
|
|
if($scope.index.users.length>0){
|
|
if($scope.index.users.length>0){
|