|
|
@@ -559,18 +559,20 @@ define(['app/app'], function (app) {
|
|
|
}
|
|
|
}
|
|
|
//输入原密码后验证原密码是否正确
|
|
|
+ $scope.checkSuccess = false;
|
|
|
+ $scope.checkFailed = false;
|
|
|
$scope.checkPassword = function (password) {
|
|
|
- $scope.checking = true;
|
|
|
$scope.checkSuccess = false;
|
|
|
$scope.checkFailed = false;
|
|
|
- //判断点击的是否在小键盘区域
|
|
|
+ if(!password){
|
|
|
+ $scope.checkFailed = true;
|
|
|
+ $scope.checkSuccess = false;
|
|
|
+ }
|
|
|
User.checkPassword({password: password}, function () {
|
|
|
$scope.checkSuccess = true;
|
|
|
- $scope.checking = false;
|
|
|
$scope.checkFailed = false;
|
|
|
}, function () {
|
|
|
$scope.checkFailed = true;
|
|
|
- $scope.checking = false;
|
|
|
$scope.checkSuccess = false;
|
|
|
});
|
|
|
};
|
|
|
@@ -637,6 +639,17 @@ define(['app/app'], function (app) {
|
|
|
|
|
|
//修改密码
|
|
|
$scope.ok = function () {
|
|
|
+ //原密码校验
|
|
|
+ if(!$scope.checkSuccess){
|
|
|
+ $scope.checkPassword($scope.user.password);
|
|
|
+ }
|
|
|
+ //新密码校验
|
|
|
+ $scope.checkNewPassword($scope.user.newPassword);
|
|
|
+ //再次输入密码校验
|
|
|
+ $scope.checkNewPassword1();
|
|
|
+ if(!$scope.checkSuccess || !$scope.checkSuccess1 || !$scope.checkSuccess2){
|
|
|
+ return;
|
|
|
+ }
|
|
|
if ($scope.user.newPassword == $scope.user.password) {
|
|
|
toaster.pop('error', '错误', '新密码与原密码相同');
|
|
|
return;
|
|
|
@@ -663,10 +676,11 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess2 = false;
|
|
|
$scope.checkFailed2 = false;
|
|
|
window.location.href = "vendor#/account/management/sec";
|
|
|
+ window.location.reload();
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
- // $modalInstance.close();
|
|
|
+ $modalInstance.close();
|
|
|
});
|
|
|
} else {
|
|
|
toaster.pop('error', '错误', '重复密码不一致');
|
|
|
@@ -706,6 +720,10 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess = false;
|
|
|
});
|
|
|
};
|
|
|
+ //如果之前未绑定
|
|
|
+ if($scope.userInfo.userEmail==null?true:false){
|
|
|
+ $scope.checkSuccess = true;
|
|
|
+ }
|
|
|
|
|
|
//验证用户新输入的邮箱是否可用
|
|
|
$scope.checkSuccess1 = false;
|
|
|
@@ -773,7 +791,9 @@ define(['app/app'], function (app) {
|
|
|
//校验验证码
|
|
|
$scope.validCheckCode = function (checkCode) {
|
|
|
if(!checkCode){
|
|
|
- return;
|
|
|
+ $scope.checkSuccess2 = false;
|
|
|
+ $scope.checkFailed2 = true;
|
|
|
+ return false;
|
|
|
}
|
|
|
User.validCheckCode({checkCode: checkCode,newUserEmail:$scope.user.newUserEmail}, function (data) {
|
|
|
var status = data.status;
|
|
|
@@ -790,15 +810,31 @@ define(['app/app'], function (app) {
|
|
|
|
|
|
//修改邮箱地址
|
|
|
$scope.ok = function () {
|
|
|
- if ($scope.user.newUserEmail == $scope.user.userEmail) {
|
|
|
- toaster.pop('error', '错误', '新邮箱地址与旧邮箱地址相同');
|
|
|
+ //原邮箱校验
|
|
|
+ if($scope.userInfo.userEmail && !$scope.checkSuccess ){
|
|
|
+ $scope.checkUserEmail($scope.user.userEmail);
|
|
|
+ }
|
|
|
+ //新邮箱校验
|
|
|
+ if(!$scope.checkSuccess1){
|
|
|
+ $scope.emailEnable($scope.user.newUserEmail);
|
|
|
+ }
|
|
|
+ //验证码
|
|
|
+ $scope.validCheckCode($scope.checkCode);
|
|
|
+ if((!$scope.checkSuccess && $scope.userInfo.userEmail)|| !$scope.checkSuccess1 || !$scope.checkSuccess2){
|
|
|
return;
|
|
|
}
|
|
|
- User.updateUserEmail({
|
|
|
- userEmail: $scope.user.userEmail,
|
|
|
+ var param = {
|
|
|
newUserEmail: $scope.user.newUserEmail,
|
|
|
checkCode:$scope.checkCode
|
|
|
- }, {}, function () {
|
|
|
+ };
|
|
|
+ if ($scope.user.userEmail!=null && $scope.user.newUserEmail == $scope.user.userEmail) {
|
|
|
+ toaster.pop('error', '错误', '新邮箱地址与旧邮箱地址相同');
|
|
|
+ return;
|
|
|
+ }else{
|
|
|
+ param["userEmail"]=$scope.user.userEmail;
|
|
|
+ }
|
|
|
+
|
|
|
+ User.updateUserEmail(param, {}, function () {
|
|
|
toaster.pop('success', '成功', '修改邮箱成功。');
|
|
|
//修改userInfo里面的userEmail
|
|
|
$scope.userInfo.userEmail =$scope.user.newUserEmail.substr(
|
|
|
@@ -815,6 +851,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkFailed1 = false;
|
|
|
$scope.sendSuccess = false;
|
|
|
window.location.href = "vendor#/account/management/sec";
|
|
|
+ window.location.reload();
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
@@ -920,6 +957,8 @@ define(['app/app'], function (app) {
|
|
|
//校验验证码
|
|
|
$scope.validTelCheckCode = function (telCheckCode) {
|
|
|
if(!telCheckCode){
|
|
|
+ $scope.checkSuccess2 = false;
|
|
|
+ $scope.checkFailed2 = true;
|
|
|
return;
|
|
|
}
|
|
|
User.validTelCheckCode({telCheckCode: telCheckCode,newUserTel:$scope.user.newUserTel},
|
|
|
@@ -938,6 +977,19 @@ define(['app/app'], function (app) {
|
|
|
|
|
|
//修改手机
|
|
|
$scope.ok = function () {
|
|
|
+ //原手机校验
|
|
|
+ if(!$scope.checkSuccess){
|
|
|
+ $scope.checkUserTel($scope.user.userTel);
|
|
|
+ }
|
|
|
+ //新手机校验
|
|
|
+ if(!$scope.checkSuccess1){
|
|
|
+ $scope.telEnable($scope.user.newUserTel);
|
|
|
+ }
|
|
|
+ //验证码校验
|
|
|
+ $scope.validTelCheckCode($scope.checkCode);
|
|
|
+ if(!$scope.checkSuccess || !$scope.checkSuccess1 || !$scope.checkSuccess2){
|
|
|
+ return;
|
|
|
+ }
|
|
|
if ($scope.user.newUserTel == $scope.user.userTel) {
|
|
|
toaster.pop('error', '错误', '新手机号与旧手机号相同');
|
|
|
return;
|
|
|
@@ -962,6 +1014,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.codeSuccess = false;
|
|
|
$scope.validSuccess = false;
|
|
|
window.location.href = "vendor#/account/management/sec";
|
|
|
+ window.location.reload();
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
@@ -1059,8 +1112,9 @@ define(['app/app'], function (app) {
|
|
|
}
|
|
|
}
|
|
|
//验证是否设置密码
|
|
|
+ $scope.isNewSuccess = false;
|
|
|
+ $scope.isNewFailed = false;
|
|
|
$scope.checkHaveUserPay = function () {
|
|
|
- $scope.userPayHidden = false;
|
|
|
$scope.isNewSuccess = false;
|
|
|
$scope.isNewFailed = true;
|
|
|
User.checkHaveUserPay(function (data) {
|
|
|
@@ -1072,27 +1126,28 @@ define(['app/app'], function (app) {
|
|
|
$scope.newUserPayLabel = "密码";
|
|
|
$scope.isNewSuccess = true;
|
|
|
$scope.isNewFailed = false;
|
|
|
- $scope.checking = false;
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//校验原密码是否正确
|
|
|
+ $scope.checkFailed = false;
|
|
|
+ $scope.checkSuccess = false;
|
|
|
$scope.checkUserPay = function (userPay) {
|
|
|
if (userPay == null) {
|
|
|
$scope.checkFailed = true;
|
|
|
$scope.checkSuccess = false;
|
|
|
return;
|
|
|
}
|
|
|
- $scope.checkSuccess = false;
|
|
|
+ $scope.checkSuccess = false;
|
|
|
+ $scope.checkFailed = false;
|
|
|
+ User.checkUserPay({userPay: userPay}, function () {
|
|
|
$scope.checkFailed = false;
|
|
|
- User.checkUserPay({userPay: userPay}, function () {
|
|
|
- $scope.checkFailed = false;
|
|
|
- $scope.checkSuccess = true;
|
|
|
- }, function () {
|
|
|
- $scope.checkFailed = true;
|
|
|
- $scope.checkSuccess = false;
|
|
|
- });
|
|
|
+ $scope.checkSuccess = true;
|
|
|
+ }, function () {
|
|
|
+ $scope.checkFailed = true;
|
|
|
+ $scope.checkSuccess = false;
|
|
|
+ });
|
|
|
}
|
|
|
|
|
|
//输入新密码,进行校验
|
|
|
@@ -1104,24 +1159,24 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess1 = false;
|
|
|
return;
|
|
|
}
|
|
|
- //如果两者相同 则返回
|
|
|
- if ($scope.checking && ($scope.user.userPay
|
|
|
- == $scope.user.newUserPay)) {
|
|
|
- toaster.pop('error', '错误', '新密码与原密码相同');
|
|
|
- $scope.checkFailed1 = true;
|
|
|
- $scope.checkSuccess1 = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- //正则校验
|
|
|
- var reg = /^\d{6}$/;
|
|
|
- if (!reg.test(newUserPay)) {
|
|
|
- $scope.checkFailed1 = true;
|
|
|
- $scope.checkSuccess1 = false;
|
|
|
- return;
|
|
|
- }
|
|
|
- $scope.checkFailed1 = false;
|
|
|
- $scope.checkSuccess1 = true;
|
|
|
+ //如果两者相同 则返回
|
|
|
+ if ($scope.checking && ($scope.user.userPay
|
|
|
+ == $scope.user.newUserPay)) {
|
|
|
+ toaster.pop('error', '错误', '新密码与原密码相同');
|
|
|
+ $scope.checkFailed1 = true;
|
|
|
+ $scope.checkSuccess1 = false;
|
|
|
+ return;
|
|
|
}
|
|
|
+ //正则校验
|
|
|
+ var reg = /^\d{6}$/;
|
|
|
+ if (!reg.test(newUserPay)) {
|
|
|
+ $scope.checkFailed1 = true;
|
|
|
+ $scope.checkSuccess1 = false;
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ $scope.checkFailed1 = false;
|
|
|
+ $scope.checkSuccess1 = true;
|
|
|
+ }
|
|
|
|
|
|
|
|
|
//校验确认密码是否与新密码相同
|
|
|
@@ -1147,6 +1202,17 @@ define(['app/app'], function (app) {
|
|
|
|
|
|
//支付密码
|
|
|
$scope.ok = function () {
|
|
|
+ //原密码校验
|
|
|
+ if(!$scope.checkSuccess && $scope.userInfo.havePayPwd){
|
|
|
+ $scope.checkUserPay($scope.user.userPay);
|
|
|
+ }
|
|
|
+ //新密码校验
|
|
|
+ $scope.checkNewUserPay($scope.user.newUserPay);
|
|
|
+ //密码确认
|
|
|
+ $scope.checkNewUserPay1();
|
|
|
+ if((!$scope.checkSuccess && $scope.userInfo.havePayPwd) || !$scope.checkSuccess1 || !$scope.checkSuccess2){
|
|
|
+ return;
|
|
|
+ }
|
|
|
if ($scope.checking && ($scope.user.newUserPay
|
|
|
== $scope.user.userPay)) {
|
|
|
toaster.pop('error', '错误', '新密码与旧密码相同');
|
|
|
@@ -1167,6 +1233,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkFailed2 = false;
|
|
|
$scope.checking = true;
|
|
|
window.location.href = "vendor#/account/management/sec";
|
|
|
+ window.location.reload();
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
@@ -1307,6 +1374,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkFailed3_1 = false;
|
|
|
$scope.checkFailed1_1 = false;
|
|
|
window.location.href = "vendor#/account/management/sec";
|
|
|
+ window.location.reload();
|
|
|
$modalInstance.close();
|
|
|
}, function (response) {
|
|
|
toaster.pop('error', '错误', response.data);
|
|
|
@@ -1327,16 +1395,16 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess = false;
|
|
|
$scope.checkFailed = false;
|
|
|
$scope.checkUserName = function (userName) {
|
|
|
- if (userName == null) {
|
|
|
+ if (!userName) {
|
|
|
//toaster.pop('error', '请输入您的真实姓名');
|
|
|
$scope.checkSuccess = false;
|
|
|
$scope.checkFailed = true;
|
|
|
- return;
|
|
|
+ return false;
|
|
|
} else if (userName.length > 20) {
|
|
|
//toaster.pop('error', '请勿超过20个字符');
|
|
|
$scope.checkSuccess = false;
|
|
|
$scope.checkFailed_1 = true;
|
|
|
- return;
|
|
|
+ return false;
|
|
|
} else {
|
|
|
$scope.checkSuccess = true;
|
|
|
$scope.checkFailed = false;
|
|
|
@@ -1354,13 +1422,13 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess1 = false;
|
|
|
$scope.checkFailed1 = true;
|
|
|
$scope.checkFailed1_1 = false;
|
|
|
- return;
|
|
|
+ return false;
|
|
|
} else if (userIdcode.length != 18) {
|
|
|
//toaster.pop('error', '请输入18位的身份证号');
|
|
|
$scope.checkSuccess1 = false;
|
|
|
$scope.checkFailed1 = false;
|
|
|
$scope.checkFailed1_1 = true;
|
|
|
- return;
|
|
|
+ return false;
|
|
|
} else {
|
|
|
$scope.checkSuccess1 = true;
|
|
|
$scope.checkFailed1 = false;
|
|
|
@@ -1398,6 +1466,18 @@ define(['app/app'], function (app) {
|
|
|
};
|
|
|
//保存
|
|
|
$scope.ok = function () {
|
|
|
+ //姓名
|
|
|
+ $scope.checkUserName($scope.user.userName);
|
|
|
+ //身份证
|
|
|
+ $scope.checkUserIdcode($scope.user.userIdcode);
|
|
|
+ //身份证
|
|
|
+ if(!$scope.checkSuccess2){
|
|
|
+ toaster.pop('error', '错误', '请上传您的证件...');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ if(!$scope.checkSuccess || !$scope.checkSuccess1 || !$scope.checkSuccess2){
|
|
|
+ return;
|
|
|
+ }
|
|
|
User.updateRealAuth({userName:$scope.user.userName,userIdcode:$scope.user.userIdcode,idImgUrl:$scope.user.idImgUrl},{},function(){
|
|
|
toaster.pop('success', '成功', '身份信息提交成功。');
|
|
|
$modalInstance.close();
|
|
|
@@ -1407,6 +1487,7 @@ define(['app/app'], function (app) {
|
|
|
$scope.checkSuccess = false;
|
|
|
$scope.checkFailed = false;
|
|
|
window.location.href = "vendor#/account/management/sec";
|
|
|
+ window.location.reload();
|
|
|
$modalInstance.close();
|
|
|
}, function(response){
|
|
|
toaster.pop('error', '错误', response.data);
|