Browse Source

修改账户安全提示框

yangc 7 years ago
parent
commit
ea949b97bf
1 changed files with 34 additions and 17 deletions
  1. 34 17
      src/main/webapp/resources/js/common/controllers/commonCtrls.js

+ 34 - 17
src/main/webapp/resources/js/common/controllers/commonCtrls.js

@@ -1752,26 +1752,43 @@ define([ 'app/app' ], function(app) {
 		};
 	}]);
 
-  /**
-   * 左侧导航栏控制器
-   */
-	app.controller('leftNavCtrl', ["$scope", "toaster", function($scope, toaster){
+	/**
+	 * 左侧导航栏控制器
+	 */
+	app.controller('leftNavCtrl', ["$scope", "toaster", '$modal', '$rootScope', function($scope, toaster, $modal, $rootScope){
+		//安全设置提醒框
+		$scope.openHomeCenterModel = function() {
+			var modalInstance = $modal.open({
+				animation: true,
+				templateUrl: $rootScope.rootPath + '/static/view/usercenter/modal/homeCenter_modal.html',
+				controller:'homeModalCtrl'
+			});
+			modalInstance.result.then(function(){
+			}, function(){
+			});
+		};
 		$scope.promptUpdate = function() {
-			console.info($scope.userInfo.pwdEnable);
-			if (!$scope.userInfo.pwdEnable) {
-        toaster.pop("info", "请修改登录密码");
-        return;
+			if (!$scope.userInfo.pwdEnable || !$scope.userInfo.userEmail || !$scope.userInfo.haveUserQuestion) {
+				$scope.openHomeCenterModel();
 			}
-      if (!$scope.userInfo.emailValidCode || $scope.userInfo.emailValidCode != 2) {
-        toaster.pop("info", "请绑定邮箱");
-        return;
-      }
-      if (!$scope.userInfo.haveUserQuestion) {
-        toaster.pop("info",  "请设置密保问题 ");
-        return;
-      }
+		};
+	}]);
+
+	app.controller('homeModalCtrl', ['$rootScope', '$scope',  '$modalInstance', 'toaster', '$http', 'ShippingAddress','$state', function($rootScope, $scope, $modalInstance, toaster, $http, ShippingAddress,$state){
+		$rootScope.$on('$stateChangeStart',
+			function(event, toState, toParams, fromState, fromParams){
+				$modalInstance.dismiss();
+			})
+		$scope.goLink = function(op) {
+			$state.go('vendor_account_management',{op:op});
+			$modalInstance.dismiss('cancel');
+		}
+
+		$scope.cancel = function () {
+			$modalInstance.dismiss('cancel');
 		}
-  }]);
+	}]);
+
 	var getOriginalData = function(data) {
 		var result = {};
 		if(data&&data.length) {