home.js 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. (function (app) {
  2. app.controller('homeCtrl', ["$scope", "$state", "msg", "$ionicPopover"
  3. , function ($scope, $state, msg, $ionicPopover) {
  4. $scope.type = 1;//tab切换
  5. $scope.changetype = function (type) {
  6. $scope.type = type;
  7. }
  8. $ionicPopover.fromTemplateUrl('my-popover.html', {
  9. scope: $scope
  10. }).then(function (popover) {
  11. $scope.popover = popover;
  12. });
  13. $scope.openPopover = function ($event) {
  14. $scope.popover.show($event);
  15. };
  16. $scope.closePopover = function () {
  17. $scope.popover.hide();
  18. };
  19. $scope.$on('$ionicView.beforeEnter', function () {
  20. });
  21. $scope.todetail = function () {
  22. $state.go('app.home_userdetail');
  23. }
  24. }]);
  25. app.controller('userDetailCtrl', ["$scope", "$state", "msg", "$ionicTabsDelegate"
  26. , function ($scope, $state, msg, $ionicTabsDelegate) {
  27. $scope.type = 1;//tab切换
  28. $scope.tosupport = false;
  29. $scope.support = function ($event) {
  30. $event.stopPropagation();
  31. $scope.tosupport = true;
  32. }
  33. $scope.cancelsupport = function () {
  34. $scope.tosupport = false;
  35. }
  36. $scope.changetype = function (type) {
  37. $scope.type = type;
  38. }
  39. $scope.index = 0;
  40. $scope.changeindex = function (index) {
  41. $scope.index = index;
  42. }
  43. $scope.$on('$ionicView.beforeEnter', function () {
  44. $ionicTabsDelegate.showBar(false);
  45. });
  46. $scope.$on('$ionicView.leave', function () {
  47. $ionicTabsDelegate.showBar(true);
  48. });
  49. }]);
  50. app.controller('searchCtrl', ["$scope", "$state", "msg", "$ionicTabsDelegate", "$ionicNavBarDelegate"
  51. , function ($scope, $state, msg, $ionicTabsDelegate, $ionicNavBarDelegate) {
  52. $scope.index = 0;
  53. $scope.index1 = 0;
  54. $scope.vm = {
  55. keywords : ""
  56. }
  57. $scope.ismore = true;
  58. $scope.selectHot = function (index) {
  59. $scope.index = index;
  60. }
  61. $scope.selectHistory = function (index) {
  62. $scope.index1 = index;
  63. }
  64. $scope.showmore = function () {
  65. $scope.ismore = true;
  66. }
  67. $scope.keychange = function () {
  68. $scope.ismore = false;
  69. }
  70. $scope.type = 1;
  71. $scope.changetype = function (type) {
  72. $scope.type = type;
  73. }
  74. $scope.$on('$ionicView.beforeEnter', function () {
  75. $ionicTabsDelegate.showBar(false);
  76. $ionicNavBarDelegate.showBackButton(false);
  77. });
  78. $scope.$on('$ionicView.leave', function () {
  79. $ionicTabsDelegate.showBar(true);
  80. });
  81. }]);
  82. })(angular.module('app.controllers'));