chooseProvinceCtrl.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. angular.module('push')
  2. .controller('ChooseProvinceCtrl', function ($scope, AreaService, LocationService, ConfigService) {
  3. if($scope.app){
  4. $scope.setStatusBar(0);
  5. }
  6. $scope.cityflg = ConfigService.cityflg;
  7. $scope.locacity = ConfigService.location.city;
  8. $scope.provinceName = "";
  9. $scope.showLoadingToast();
  10. AreaService.getCityList(1,"").then(function (response) {
  11. $scope.provinceList = response.regionsList;
  12. $scope.hideLoadingToast();
  13. },function () {
  14. $scope.hideLoadingToast();
  15. });
  16. //清除输入框
  17. $scope.searchEmpty = function () {
  18. $scope.provinceName = "";
  19. };
  20. //选择省
  21. $scope.confirmProvince = function (province) {
  22. $scope.go('chooseCity',{provinceid:province.id});
  23. };
  24. $scope.RepeatCityFixed = function () {
  25. LocationService.getCurrentLocation().then(function () {
  26. $scope.locacity = ConfigService.location.city;
  27. },function () {
  28. })
  29. };
  30. $scope.choseCity = function () {
  31. AreaService.cityname = $scope.locacity;
  32. ConfigService.cityflg = 0;
  33. $scope.goback();
  34. }
  35. });