angular.module('push') .controller('updatePsdCtrl', function ($scope, LoginService, UtilService, UserService, ConfigService, $ionicHistory, $timeout, SqliteStorageService, $ionicPopup, CommonService, $state) { $scope.password = { phone: UserService.user.mobile, userPassword: UserService.user.password, oldpassword: '', password1: '', password2: '' }; $scope.defaultLan = UserService.defaultLan; $scope.updatePsd = function (password) { LoginService.updatePsd(password).then(function (response) { if (response.code == 3350) { if (response.message == "输入的原密码与用户密码不一致") { $ionicPopup.alert({ title: '提示', template: '您输入的旧密码不正确' }) return; } sessionStorage.password = response.data.password; UserService.user.password = response.data.password; $ionicPopup.alert({ title: '提示', template: '修改成功!' }) $scope.go('tab.account'); } else { $ionicPopup.alert({ title: '提示', template: '修改失败' }) return; } }, function () { $scope.hideLoadingToast(); }); } $scope.show_psd=false; $scope.show_psd1=false; $scope.show_psd2=false; $scope.showPassword = function () { $scope.show_psd = !$scope.show_psd; //$scope.show_psd = false; }; $scope.showPassword1 = function () { $scope.show_psd1 = !$scope.show_psd1; //$scope.show_psd = false; }; $scope.showPassword2 = function () { $scope.show_psd2 = !$scope.show_psd2; //$scope.show_psd = false; }; });