chooseCityCtrl.js 870 B

12345678910111213141516171819202122232425262728293031
  1. angular.module('push')
  2. .controller('ChooseCityCtrl', function ($scope, AreaService, $stateParams, ConfigService) {
  3. if($scope.app){
  4. $scope.setStatusBar(0);
  5. }
  6. $scope.cityName = "";
  7. $scope.showLoadingToast();
  8. AreaService.getCityList(2,$stateParams.provinceid).then(function (response) {
  9. $scope.cityList = response.regionsList;
  10. $scope.hideLoadingToast();
  11. },function () {
  12. $scope.hideLoadingToast();
  13. });
  14. //清除输入框
  15. $scope.searchEmpty = function () {
  16. $scope.cityName = "";
  17. };
  18. $scope.confirmCity = function (city) {
  19. AreaService.cityid = city.id;
  20. AreaService.cityname = city.areaname;
  21. if(ConfigService.cityflg == 1){
  22. $scope.go('tab.home');
  23. }else if(ConfigService.cityflg == 2){
  24. $scope.backViews(-2);
  25. }
  26. ConfigService.cityflg = 0;
  27. }
  28. });