setCtrl.js 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. angular.module('push')
  2. .controller('SetCtrl', function ($scope, ConfigService, UserService, $ionicHistory, $rootScope, UtilService, SqliteStorageService, IMChatService,CommonService) {
  3. if($scope.app){
  4. $scope.setStatusBar(1);
  5. }
  6. $scope.versionno = ConfigService.versionno;
  7. $scope.shouldShowDelete = false;
  8. $scope.shouldShowReorder = false;
  9. $scope.listCanSwipe = true;
  10. $scope.ishaspaypassword = UserService.ishaspaypassword;
  11. if ($rootScope.verno != $scope.versionno) {
  12. $scope.update = true;
  13. }
  14. $scope.islogin = ConfigService.islogin;
  15. if(!$scope.islogin){
  16. $scope.visitorShowLoginOut=false;
  17. }else{
  18. $scope.visitorShowLoginOut=true;
  19. }
  20. $scope.goNextPage = function () {
  21. /* $scope.islogin = ConfigService.islogin;
  22. if(!$scope.islogin){
  23. $scope.selCom.show();
  24. }else{
  25. $scope.go('editdata');
  26. }*/
  27. // UtilService.showMess("功能正在完善中,敬请期待!");
  28. if($scope.app){
  29. UtilService.showMess("功能正在完善中,敬请期待!");
  30. }else{
  31. CommonService.showMessage("功能正在完善中,敬请期待!",$scope);
  32. }
  33. };
  34. $scope.goUpdatePwd = function () {
  35. /*$scope.islogin = ConfigService.islogin;
  36. if(!$scope.islogin){
  37. $scope.selCom.show();
  38. }else{
  39. $scope.go('updatepwd');
  40. }*/
  41. if($scope.app){
  42. UtilService.showMess("功能正在完善中,敬请期待!");
  43. }else{
  44. CommonService.showMessage("功能正在完善中,敬请期待!",$scope);
  45. }
  46. };
  47. $scope.goPayMoneyPassword = function () {
  48. /* if (!ConfigService.islogin) {
  49. UtilService.showMess("请登录");
  50. return;
  51. }*/
  52. $scope.go('payPsMoneyPassword');
  53. };
  54. $scope.updateversion = function () {
  55. if (device.platform == "Android") {
  56. cordova.InAppBrowser.open("http://sj.qq.com/myapp/detail.htm?apkName=com.push.pushapp", '_system', 'location=yes');
  57. } else {
  58. cordova.InAppBrowser.open("https://itunes.apple.com/us/app/push科技/id1218178687?mt=8", '_system', 'location=yes');
  59. }
  60. };
  61. $scope.logout = function () {
  62. /* if($scope.app){
  63. if(ConfigService.isedit ==0){
  64. SqliteStorageService.dropAllTable();
  65. }else {
  66. var del_sql = "delete from userinfo";
  67. SqliteStorageService.deleteData(del_sql);
  68. }
  69. }*/
  70. ConfigService.islogin = false;
  71. ConfigService.ressynchroflg = true;
  72. UserService.user = {};
  73. UserService.id = "0";
  74. if($scope.app){
  75. IMChatService.disconnect();
  76. }
  77. //ConfigService.comefrom = "320412000";
  78. $ionicHistory.clearCache();
  79. localStorage.removeItem("mobile");
  80. localStorage.removeItem("password");
  81. $scope.go('tab.account');
  82. };
  83. });