|
|
@@ -56,6 +56,12 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
url: "/bind_business",
|
|
|
templateUrl: "static/tpl/serve/self/bind_enterprise.html",
|
|
|
controller: 'EditUserCtrl'
|
|
|
+ }).state('question.detail1.1', {
|
|
|
+ url : "/detail1.1",
|
|
|
+ templateUrl : "static/tpl/serve/question/1.1.html"
|
|
|
+ }).state('question.detail1.2', {
|
|
|
+ url : "/detail1.2",
|
|
|
+ templateUrl : "static/tpl/serve/question/1.2.html"
|
|
|
}).state('contact', {
|
|
|
url : "/contact",
|
|
|
templateUrl : "static/tpl/serve/contact.html",
|
|
|
@@ -85,19 +91,36 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
}).state('self', {
|
|
|
url : "/self",
|
|
|
templateUrl : "static/tpl/serve/self.html"
|
|
|
- }).state('self.forget_pwd1', { // #/self/forget_pwd1
|
|
|
+ }).state('self.forget_pwd1', {
|
|
|
url : "/forget_pwd1",
|
|
|
templateUrl : "static/tpl/serve/self/forget_pwd1.html",
|
|
|
controller: 'ForgetPwd1Ctrl'
|
|
|
+ }).state('self.forget_pwd4', {
|
|
|
+ url : "/forget_pwd4/:userUu/:checkCode",
|
|
|
+ templateUrl : "static/tpl/serve/self/forget_pwd4.html",
|
|
|
+ controller: 'ForgetPwd4Ctrl'
|
|
|
}).state('self.forget_pwd2', {
|
|
|
url : "/forget_pwd2/:uu/:checkcode",
|
|
|
templateUrl : "static/tpl/serve/self/forget_pwd2.html",
|
|
|
controller: 'ForgetPwd2Ctrl'
|
|
|
- }).state('self.registerSearch', {
|
|
|
- url : "/registerSearch",
|
|
|
- templateUrl : "static/tpl/serve/self/registerSearch.html"
|
|
|
+ }).state('self.modify_pwd',{
|
|
|
+ url:"/modify_pwd/:id",
|
|
|
+ templateUrl:"static/tpl/serve/self/modify_pwd.html",
|
|
|
+ controller: 'ModifyPwdCtrl'
|
|
|
+ }).state('self.find_account',{
|
|
|
+ url:"/find_account",
|
|
|
+ templateUrl:"static/tpl/serve/self/find_account.html",
|
|
|
+ controller:"Find_AccountCtrl"
|
|
|
+ }).state('self.account_excetion',{
|
|
|
+ url:"/account_excetion",
|
|
|
+ templateUrl:"static/tpl/serve/self/account_excetion.html"
|
|
|
+ }).state('self.schedule_search',{
|
|
|
+ url:"/schedule_search",
|
|
|
+ templateUrl:"static/tpl/serve/self/schedule_search.html",
|
|
|
+ controller:'Schedule_SearchCtrl'
|
|
|
});
|
|
|
}]);
|
|
|
+
|
|
|
app.controller('MyCtrl', ['$scope', '$rootScope', function($scope, $rootScope) {
|
|
|
$rootScope.$on('$locationChangeSuccess', function(evt, newUrl) {
|
|
|
var routeState = newUrl.substr(newUrl.indexOf('#/') + 2);
|
|
|
@@ -135,11 +158,68 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
$scope.slides = data;
|
|
|
});
|
|
|
}]);
|
|
|
- app.controller('ForgetPwd1Ctrl', ['$scope', 'toaster', 'Password', function($scope, toaster, Password){
|
|
|
+ app.controller('ModifyPwdCtrl', ['$scope', '$stateParams','Guide', function($scope, $stateParams,Guide){
|
|
|
+ Guide.get($stateParams.id).then(function(data){
|
|
|
+ $scope.slides = data;
|
|
|
+ });
|
|
|
+ }]);
|
|
|
+ /*
|
|
|
+ * 忘记密码
|
|
|
+ */
|
|
|
+ app.controller('ForgetPwd1Ctrl', ['$scope', '$modal','toaster', 'Password','Sendmsg', function($scope,$modal,toaster, Password,Sendmsg){
|
|
|
$scope.loading = false;
|
|
|
- $scope.getUserInfo = function(){
|
|
|
+ $scope.btnState = false;
|
|
|
+ $scope.clicks = 0;
|
|
|
+ var storage = window.localStorage;
|
|
|
+ //邮箱定时器
|
|
|
+ var setTimeDown = function(value) {
|
|
|
+ if(value > 0) {
|
|
|
+ $scope.mailState = true;
|
|
|
+ setTimeout(function() {
|
|
|
+ $scope.$apply(function(){
|
|
|
+ storage.setItem("mailTimes",$scope.mailTimes);
|
|
|
+ $scope.mailTimes --;
|
|
|
+ value --;
|
|
|
+ setTimeDown (value);
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ }else{
|
|
|
+ $scope.mailState = false;
|
|
|
+ $scope.sendSuccess = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ //手机验证码定时器
|
|
|
+ var setBtnTimeDown = function(value) {
|
|
|
+ if(value > 0) {
|
|
|
+ $scope.btnState = true;
|
|
|
+ setTimeout(function() {
|
|
|
+ $scope.$apply(function(){
|
|
|
+ storage.setItem("btnTimes",$scope.btnTimes);
|
|
|
+ $scope.btnTimes --;
|
|
|
+ value --;
|
|
|
+ setBtnTimeDown (value);
|
|
|
+ });
|
|
|
+ }, 1000);
|
|
|
+ }else{
|
|
|
+ $scope.btnState = false;
|
|
|
+ }
|
|
|
+ };
|
|
|
+ if(storage.btnTimes > 1){
|
|
|
+ $scope.btnTimes = storage.btnTimes;
|
|
|
+ setBtnTimeDown(storage.btnTimes)
|
|
|
+ }else{
|
|
|
+ storage.removeItem("btnTimes");
|
|
|
+ }
|
|
|
+ if(storage.mailTimes > 1){
|
|
|
+ $scope.mailTimes = storage.mailTimes;
|
|
|
+ setTimeDown(storage.mailTimes)
|
|
|
+ }else{
|
|
|
+ storage.removeItem("mailTimes");
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.getUserInfo = function(userName){
|
|
|
$scope.loading = true;
|
|
|
- Password.getUserInfo($scope.userName).then(function(data){
|
|
|
+ Password.getUserInfo(userName).then(function(data){
|
|
|
$scope.userInfo = data;
|
|
|
$scope.userInfoError = false;
|
|
|
$scope.loading = false;
|
|
|
@@ -150,21 +230,13 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
});
|
|
|
};
|
|
|
|
|
|
- var setTimeDown = function(value) {
|
|
|
- if(value > 0) {
|
|
|
- setTimeout(function() {
|
|
|
- value --;
|
|
|
- setTimeDown(value);
|
|
|
- }, 1000);
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
$scope.sendEmail = function(type){
|
|
|
$scope.loading = true;
|
|
|
Password.sendEmail($scope.userInfo.userUU, type).then(function(data){
|
|
|
+ $scope.mailTimes = 60;
|
|
|
$scope.sendSuccess = true;
|
|
|
- $scope.waitingTime = 60;
|
|
|
- setTimeDown($scope.waitingTime);
|
|
|
+ storage.setItem("sendSuccess",$scope.sendSuccess);
|
|
|
+ setTimeDown($scope.mailTimes);
|
|
|
$scope.loading = false;
|
|
|
}, function(data) {
|
|
|
$scope.sendFaild = true;
|
|
|
@@ -172,7 +244,100 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
});
|
|
|
};
|
|
|
|
|
|
+ $scope.chooseMethod = function(){
|
|
|
+ $modal.open({
|
|
|
+ templateUrl: 'static/tpl/serve/self/chooseForgetMethod.html',
|
|
|
+ controller: 'ChooseForgetCtrl',
|
|
|
+ size: 'sm',
|
|
|
+ }).result.then(function(chooseMethed){
|
|
|
+ if(chooseMethed == "chooseMail"){
|
|
|
+ $scope.chooseMail = chooseMethed;
|
|
|
+ $scope.choosePhone = false;
|
|
|
+ }else{
|
|
|
+ $scope.choosePhone = chooseMethed;
|
|
|
+ $scope.chooseMail = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.checkPhoneCode = function(phoneCode){
|
|
|
+ $scope.msgInfoError = false;
|
|
|
+ Sendmsg.checkPhoneCode(phoneCode,$scope.userUu).then(function(data){
|
|
|
+ $scope.result = data.result;
|
|
|
+ $scope.userUu = data.userUu;
|
|
|
+ $scope.checkCode = data.checkCode;
|
|
|
+ if($scope.result){
|
|
|
+ $scope.msgInfoError2 = false;
|
|
|
+ }else{
|
|
|
+ $scope.msgInfoError2 = data;
|
|
|
+ }
|
|
|
+ },function(data){
|
|
|
+ $scope.msgInfoError2 = data;
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.modifyPwd = function(userUu,checkCode){
|
|
|
+ $scope.resetSuccess = true;
|
|
|
+ setTimeout(function() {//延迟3秒执行
|
|
|
+ window.location.href = "http://localhost:8080/platform-b2b/serve#/self/forget_pwd4/"+userUu+"/"+checkCode;
|
|
|
+ }, 3000);
|
|
|
+ }
|
|
|
+
|
|
|
+ $scope.getPhoneCode = function(userPhone){
|
|
|
+ var timeInfo = 10;
|
|
|
+ $scope.clicks ++;
|
|
|
+ $scope.timeInfo = timeInfo;
|
|
|
+ if($scope.clicks >= 5){
|
|
|
+ $scope.loading = true;
|
|
|
+ $scope.msgInfoSuccess = false;
|
|
|
+ $scope.msgInfoError = false;
|
|
|
+ setTimeout(function() {//延迟5秒执行
|
|
|
+ window.location.href = "http://localhost:8080/platform-b2b/serve";
|
|
|
+ }, 5000);
|
|
|
+ }else{
|
|
|
+ $scope.loading = false;
|
|
|
+ Sendmsg.sendMsgInfos(userPhone).then(function(data){
|
|
|
+ $scope.msgInfoSuccess = true;
|
|
|
+ $scope.sendMsg = data;
|
|
|
+ $scope.userUu = data.userUu;
|
|
|
+ $scope.btnTimes = 60;
|
|
|
+ setBtnTimeDown($scope.btnTimes);
|
|
|
+ $scope.msgInfoError = false;
|
|
|
+ },function(data){
|
|
|
+ $scope.msgInfoError = data;
|
|
|
+ $scope.sendMsg = false;
|
|
|
+ $scope.msgInfoSuccess = false;
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }]);
|
|
|
+ /*
|
|
|
+ * 手机验证码修改密码
|
|
|
+ */
|
|
|
+ app.controller('ForgetPwd4Ctrl',['$scope', 'toaster', '$stateParams', 'Password',function($scope, toaster, $stateParams, Password){
|
|
|
+ $scope.uu = $stateParams.userUu;
|
|
|
+ $scope.checking = true;
|
|
|
+ $scope.all = {};
|
|
|
+ $scope.checkCode = $stateParams.checkCode;
|
|
|
+ $scope.resetPwd = function(){
|
|
|
+ $scope.loading = true;
|
|
|
+ Password.resetPwd($scope.uu, $scope.all.password,$scope.checkCode).then(function(data){
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.resetSuccess = true;
|
|
|
+ $scope.resetError = false;
|
|
|
+ setTimeout(function() {//延迟3秒执行
|
|
|
+ window.location.href = "http://www.ubtob.com";
|
|
|
+ }, 2000);
|
|
|
+ }, function(data){
|
|
|
+ $scope.loading = false;
|
|
|
+ $scope.resetSuccess = false;
|
|
|
+ $scope.resetError = true;
|
|
|
+ });
|
|
|
+ };
|
|
|
}]);
|
|
|
+ /*
|
|
|
+ * 邮箱修改密码
|
|
|
+ */
|
|
|
app.controller('ForgetPwd2Ctrl', ['$scope', 'toaster', '$stateParams', 'Password', function($scope, toaster, $stateParams, Password){
|
|
|
$scope.uu = $stateParams.uu;
|
|
|
$scope.checkcode = $stateParams.checkcode;
|
|
|
@@ -193,8 +358,6 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
|
|
|
$scope.reset = function(){
|
|
|
$scope.loading = true;
|
|
|
- console.log($scope);
|
|
|
- console.log($scope.password);
|
|
|
Password.reset($scope.uu, $scope.all.password, $scope.newCheckcode).then(function(data){
|
|
|
$scope.loading = false;
|
|
|
$scope.resetSuccess = true;
|
|
|
@@ -451,6 +614,152 @@ define([ 'toaster', 'ngTable', 'common/services', 'ui.router', 'ui.bootstrap', '
|
|
|
}
|
|
|
}]);
|
|
|
|
|
|
+ /*
|
|
|
+ * 选择找回密码方式
|
|
|
+ */
|
|
|
+ app.controller('ChooseForgetCtrl',['$scope','$modalInstance',function($scope,$modalInstance){
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.close();
|
|
|
+ };
|
|
|
+ $scope.login = function(chooseMethod) {
|
|
|
+ $modalInstance.close(chooseMethod);
|
|
|
+ };
|
|
|
+ }])
|
|
|
+ /*
|
|
|
+ * 查找企业注册进度
|
|
|
+ */
|
|
|
+ app.controller('Schedule_SearchCtrl',['$scope','$modal','toaster','$stateParams','Password',function($scope,$modal,toaster, $stateParams, Password){
|
|
|
+ $scope.searchrResult = false;
|
|
|
+ $scope.getEnterpriseInfos = function(){
|
|
|
+ $scope.loading = true;
|
|
|
+ Password.getEnterpriseInfos($scope.userTel).then(function(data){
|
|
|
+ if(data!=null && data.length>1){
|
|
|
+ $modal.open({
|
|
|
+ templateUrl: 'static/tpl/serve/self/chooseEnterprises.html',
|
|
|
+ controller: 'ChooseEnterpriseCtrl',
|
|
|
+ size: 'sm',
|
|
|
+ resolve: {
|
|
|
+ enterprises: function() {
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).result.then(function(enterprise){
|
|
|
+ var enterpriseJson=JSON.parse(enterprise)
|
|
|
+ $scope.enterpriseInfos = enterpriseJson;
|
|
|
+ if($scope.enterpriseInfos.status == "" ||$scope.enterpriseInfos.register == ""){
|
|
|
+ $scope.enStatus = true;
|
|
|
+ }else{
|
|
|
+ $scope.enStatus = false;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ $scope.enterpriseInfos = data[0];
|
|
|
+ if($scope.enterpriseInfos.status == ""){
|
|
|
+ $scope.enStatus = true;
|
|
|
+ }else{
|
|
|
+ $scope.enStatus = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $scope.enterpriseInfoError = false;
|
|
|
+ $scope.searchrResult = true;
|
|
|
+ }, function(data) {
|
|
|
+ $scope.enterpriseInfoError = data;
|
|
|
+ $scope.enterpriseInfo = false;
|
|
|
+ $scope.loading = false;
|
|
|
+ });
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+
|
|
|
+ /*
|
|
|
+ * 选择企业
|
|
|
+ */
|
|
|
+ app.controller('ChooseEnterpriseCtrl', ['$scope', '$modalInstance', 'enterprises', function($scope, $modalInstance, enterprises){
|
|
|
+ $scope.choose = enterprises[enterprises.length -1].enUu;
|
|
|
+ angular.forEach(enterprises, function(e){
|
|
|
+ if(e.isLast)
|
|
|
+ $scope.choose = e.uu;
|
|
|
+ });
|
|
|
+ $scope.enterprises = enterprises;
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.close();
|
|
|
+ };
|
|
|
+ $scope.login = function(choose) {
|
|
|
+ $modalInstance.close(choose);
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+ /*
|
|
|
+ * 选择用户
|
|
|
+ */
|
|
|
+ app.controller('ChooseUsersCtrl', ['$scope', '$modalInstance', 'users', function($scope, $modalInstance, users){
|
|
|
+ $scope.choose = users[users.length -1].userUu;
|
|
|
+ angular.forEach(users, function(u){
|
|
|
+ if(u.isLast)
|
|
|
+ $scope.choose = u.userUu;
|
|
|
+ });
|
|
|
+ $scope.users = users;
|
|
|
+ $scope.cancel = function() {
|
|
|
+ $modalInstance.close();
|
|
|
+ };
|
|
|
+ $scope.login = function(choose) {
|
|
|
+ $modalInstance.close(choose);
|
|
|
+ };
|
|
|
+ }]);
|
|
|
+ /*
|
|
|
+ * 找回账号
|
|
|
+ */
|
|
|
+ app.controller('Find_AccountCtrl',['$scope','$modal','toaster','$stateParams','Password',function($scope, $modal,toaster, $stateParams, Password){
|
|
|
+ $scope.searchrResult = false;
|
|
|
+ $scope.sendEmail = function(type){
|
|
|
+ $scope.loading = true;
|
|
|
+ Password.sendEmail($scope.enterpriseInfo.userUu, type).then(function(data){
|
|
|
+ $scope.sendSuccess = true;
|
|
|
+ $scope.waitingTime = 60;
|
|
|
+ setTimeDown($scope.waitingTime);
|
|
|
+ $scope.loading = false;
|
|
|
+ }, function(data) {
|
|
|
+ $scope.sendFaild = true;
|
|
|
+ $scope.loading = false;
|
|
|
+ });
|
|
|
+ };
|
|
|
+
|
|
|
+ $scope.getEnterpriseInfo = function(){
|
|
|
+ $scope.loading = true;
|
|
|
+ Password.getEnterpriseInfo($scope.bussinessCode).then(function(data){
|
|
|
+ if(data.length>1){
|
|
|
+ $modal.open({
|
|
|
+ templateUrl: 'static/tpl/serve/self/chooseUserInfo.html',
|
|
|
+ controller: 'ChooseUsersCtrl',
|
|
|
+ size: 'sm',
|
|
|
+ resolve: {
|
|
|
+ users: function() {
|
|
|
+ return data;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }).result.then(function(enUser){
|
|
|
+ var enUserJson=JSON.parse(enUser)
|
|
|
+ $scope.enUser = enUserJson;
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ $scope.enUser = data[0];
|
|
|
+ }
|
|
|
+ $scope.enterpriseInfoError = false;
|
|
|
+ $scope.searchrResult = true;
|
|
|
+ }, function(data) {
|
|
|
+ $scope.enterpriseInfoError = data;
|
|
|
+ $scope.enterpriseInfo = false;
|
|
|
+ $scope.loading = false;
|
|
|
+ });
|
|
|
+ };
|
|
|
+ }])
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 用户存在提示显示输入框
|
|
|
+ */
|
|
|
+ app.directive('ngDisplay',['$parse',function($parse){
|
|
|
+ return {
|
|
|
+
|
|
|
+ }
|
|
|
+ }])
|
|
|
/**
|
|
|
* 搜索框,回车触发
|
|
|
*/
|