Browse Source

注册页面

git-svn-id: svn+ssh://10.10.101.21/source/platform/platform-b2b@355 f3bf4e98-0cf0-11e4-a00c-a99a8b9d557d
suntg 11 years ago
parent
commit
917a130654
1 changed files with 47 additions and 1 deletions
  1. 47 1
      src/main/webapp/resources/js/register/registerApp.js

+ 47 - 1
src/main/webapp/resources/js/register/registerApp.js

@@ -13,7 +13,7 @@ define([ 'toaster', 'services' ,'ui.router', 'file-upload', 'file-upload-shim'],
 			url: '/step2',
       		templateUrl: 'static/tpl/register/step2.html'
     	}).state('step3', {
-			url: '/step3',
+			url: '/step3/:uu/:checkcode',
       		templateUrl: 'static/tpl/register/step3.html'
     	});
 	});
@@ -160,5 +160,51 @@ define([ 'toaster', 'services' ,'ui.router', 'file-upload', 'file-upload-shim'],
 			return url ;
 		};
 	});
+	
+	app.controller('Step3Ctrl', function($scope, $http, $location, $upload, toaster, $stateParams) {
+		$scope.uu = $stateParams.uu;
+		$scope.checkcode = $stateParams.checkcode;
+		$scope.activateResult = false;
+		$scope.activateSuccess = false;
+		$scope.activateSendAgain = false;
+		
+		setTimeout(function() {//延迟5秒执行
+			$http.post('signin/activate?uu=' + $scope.uu + '&checkcode=' + $scope.checkcode)
+			.success(function(data){
+				$scope.checkResult = '成功';
+				$scope.activateResult = true;
+				$scope.activateSuccess = true;
+			}).error(function(data){
+				$scope.checkResult = '失败,原因 - '+ data.result ;
+				$scope.activateResult = true;
+				if(data.result == '验证码错误,激活失败') {
+					$scope.activateSendAgain = true;
+				}
+			});
+		}, 5000);
+		
+		$scope.setAdminPassword = function(enuu, psd) {
+			$scope.loadingShow = true;
+			$http.post('signin/setAdminPassword?enuu=' + enuu + '&password=' + psd).success(function(data){
+				$scope.loadingShow = false;
+				$scope.setSuccess = true;
+			}).error(function(data) {
+				$scope.loadingShow = false;
+				$scope.setFaild = true;
+			});
+		};
+		
+		$scope.sendEmailAgain = function(enuu){
+			$scope.loadingShow = true;
+			$http.get('signin/setEmailAgain?enuu=' + enuu).success(function(data){//发送失败
+				$scope.loadingShow = false;
+				$scope.emailDisabled = true;
+				$scope.sendSuccess = true;
+			}).error(function(data){//发送成功
+				$scope.loadingShow = false;
+				$scope.sendFaild = true;
+			});
+		};
+	});
 	return app;
 });