ソースを参照

新增企业账号绑定

xuchunyang 8 年 前
コミット
c7d0eda145
共有6 個のファイルを変更した207 個の追加34 個の削除を含む
  1. 7 9
      cmp-portal/cmp-mailOk.html
  2. 12 23
      cmp-portal/cmp-setBind.html
  3. 31 0
      cmp-portal/js/cmp-mailOK.js
  4. 124 0
      cmp-portal/js/cmp-setBind.js
  5. 32 1
      cmp-portal/js/cmp-setPwd.js
  6. 1 1
      cmp-portal/js/cmp-settled-log.js

+ 7 - 9
cmp-portal/cmp-mailOk.html

@ -9,12 +9,8 @@
9 9
<link type="text/css" rel="stylesheet" href="css/common.css">
10 10
<link type="text/css" rel="stylesheet" href="css/cmpindex.css">
11 11
<script type="text/javascript" src="js/public/jquery-1.11.1.js"></script>
12
<script type="text/javascript"src="js/public/jquery.cookie.js"></script>
13
<script type="text/javascript" src="js/public/common.js"></script>
14 12
</head>
15

16 13
<body class="covbodyBg">
17

18 14
<div class="containerCon">
19 15
	<div class="headlogo signLogo"></div>
20 16
</div>
@ -24,17 +20,19 @@
24 20
		<div class="covFrmblock">
25 21
			<form class="cmpAllFrm">
26 22
				<ul class="cmpAllUl cmpCoverUl">
27
					<li class="successImg" style="margin-top:40px;"></li>
23
					<li class="successImg" style="margin-top:40px;" id="successImg"></li>
28 24
					<li class="importBlock">
29
						<p class="importTip">恭喜您,您的企业邮箱绑定成功!</p>
30
						<p class="smalltip alignCenter">您可以使用该邮箱登录您的企业账户了。</p>
25
						<p class="importTip" id="importTip"></p>
26
						<p class="smalltip alignCenter" id="alignCenter"></p>
31 27
					</li>
32 28
				</ul>
33 29
			</form>
34 30
		</div>
35 31
	</div>
36 32
</div>
37

38

33
<script type="text/javascript" src="js/public/jquery.cookie.js"></script>
34
<script type="text/javascript" src="js/public/jquery.similar.msgbox.js"></script>
35
<script type="text/javascript" src="js/public/common.js"></script>
36
<script type="text/javascript" src="js/cmp-mailOK.js"></script>
39 37
</body>
40 38
</html>

+ 12 - 23
cmp-portal/cmp-setBind.html

@ -9,33 +9,31 @@
9 9
<link type="text/css" rel="stylesheet" href="css/common.css">
10 10
<link type="text/css" rel="stylesheet" href="css/cmpindex.css">
11 11
<script type="text/javascript" src="js/public/jquery-1.11.1.js"></script>
12
<script type="text/javascript"src="js/public/jquery.cookie.js"></script>
13
<script type="text/javascript" src="js/public/common.js"></script>
14 12
</head>
15 13
<body>
16 14
<!--绑定邮箱model-->
17 15
<div class="blackcover">
18 16
	<div class="modelContain">
19 17
		<form name="cmpAllFrm">
20
			<ul class="cmpAllUl cmpBindul">
18
			<ul class="cmpAllUl cmpBindul" id="emailone">
21 19
				<li class="importBlock"><p class="importTip">验证企业邮箱,完成账号绑定</p></li>
22 20
				<li>
23
    				<input type="email" class="frmtype frmtypeW" placeholder="请输入您的企业邮箱" />
21
    				<input type="email" class="frmtype frmtypeW" placeholder="请输入您的企业邮箱"  id="companyEmail"/>
24 22
    				<div class="frmmsg msgBind1"><span></span></div>
25 23
				</li>
26 24
				<li class="alignCenter">
27
					<button type="button" class="frmtype btnModel headRadius save-block">发送验证邮件</button>
25
					<button type="button" class="frmtype btnModel headRadius save-block" disabled id="saveSubmit">发送验证邮件</button>
28 26
				</li>
29 27
			</ul>
30
			<ul class="cmpAllUl cmpBindul">
28
			<ul class="cmpAllUl cmpBindul displayNone" id="emailtwo">
31 29
				<li class="importBlock">
32 30
					<p class="importTip">验证邮件已发送至:<br />
33
						<span class="cmpColor">lixiaoyuan@ekexiu.com</span>
31
						<span class="cmpColor" id="emailShow"></span>
34 32
					</p>
35 33
					<p class="smalltip alignCenter">请您在10分钟内登录您的企业邮箱,接收邮件,<br />点击链接后即可完成绑定。</p>
36 34
				</li>
37 35
				<li class="alignCenter">
38
					<button type="button" class="frmtype btnModel headRadius save-block">登录邮箱</button>
36
					<button type="button" class="frmtype btnModel headRadius save-block" id="emailGo">登录邮箱</button>
39 37
				</li>
40 38
			</ul>
41 39
		</form>
@ -67,10 +65,10 @@
67 65
				        		<li>
68 66
				        			<div class="col-w-9 bindFont">
69 67
				        				<em></em>
70
				        				您已绑定邮箱 <span class="cmpColor">lixiao****@ekexiu.com</span>
68
				        				您已绑定邮箱 <span class="cmpColor" id="orgEmail"></span>
71 69
				        			</div>
72 70
				        			<div class="col-w-3">
73
				        				<button type="button" class="frmtype btnModel headRadius" id="bindEmailbtn">更换</button>
71
				        				<button type="button" class="frmtype btnModel headRadius bindEmailbtn" >更换</button>
74 72
				        			</div>
75 73
				        		</li>
76 74
				        	</ul>
@ -82,22 +80,13 @@
82 80
        </div>
83 81
	</div>
84 82
</div>
85

86

87

88 83
<!--底部-->
89 84
<footer>
90 85
	<script type="text/javascript" src="js/public/cmpFooter.js"></script>
91 86
</footer>
92
<script type="text/javascript">
93
	$("#bindEmailbtn").click(function(){
94
		modelOpen();
95
	})
96
	$(".modelClosebtn").click(function(){
97
		modelClose();
98
	})
99
100
</script>
101

87
<script type="text/javascript"src="js/public/jquery.cookie.js"></script>
88
<script type="text/javascript" src="js/public/jquery.similar.msgbox.js"></script>
89
<script type="text/javascript" src="js/public/common.js"></script>
90
<script type="text/javascript" src="js/cmp-setBind.js"></script>
102 91
</body>
103 92
</html>

+ 31 - 0
cmp-portal/js/cmp-mailOK.js

@ -0,0 +1,31 @@
1
//账号绑定成功
2
$(function() {
3
	var sc = GetQueryString("sc");
4
	var emaild = GetQueryString("emaild");
5
	activationFun();
6

7
	function activationFun() {
8
		$.ajax("/ajax/bindOrgMail/" + sc, {
9
			type: "GET",
10
			dataType: 'json',
11
			async: false,
12
			success: function($data) {
13
				console.log($data)
14
				if($data.success){
15
					$("#importTip").text("恭喜您,您的企业邮箱绑定成功!");
16
					$("#successImg").removeClass("failImg").addClass("successImg");
17
					$("#alignCenter").text("您可以使用该邮箱登录您的企业账户了。");
18
					var emaild = $data.data;
19
					$.cookie('orgEmail', emaild, {path: "/"});
20
				}else if($data.code == -1){
21
					$("#importTip").text("很抱歉,当前的链接已失效");
22
					$("#successImg").addClass("failImg").removeClass("successImg");
23
					$("#alignCenter").text("小提醒:邮件内的链接有效时长为10分钟。");
24
				}
25
			},
26
			error: function() {
27
				$.MsgBox.Alert('提示', '服务器请求失败')
28
			},
29
		});
30
	}
31
})

+ 124 - 0
cmp-portal/js/cmp-setBind.js

@ -0,0 +1,124 @@
1
//账号绑定
2
$(function() {
3
	var emailCookieshow;
4
	var orgid = $.cookie('orgId');
5
	var orgEmail = $.cookie('orgEmail');
6
	var setemail = false;
7
	$(".bindEmailbtn").click(function() {
8
		modelOpen();
9
	})
10
	$(".modelClosebtn").click(function() {
11
		modelClose();
12
	})
13

14
	/*回填cookie邮件*/
15
	emailhome(orgEmail);
16
	$("#orgEmail").text(emailCookieshow);
17

18
	/*校验邮箱按钮显示状态*/
19
	$('#companyEmail').on('keyup', function() {
20
		if($(this).val() == "") {
21
			$("#saveSubmit").attr("disabled", true);
22
		} else {
23
			$("#saveSubmit").attr("disabled", false);
24
		}
25
	});
26

27
	/*校验企业邮箱*/
28
	$('#companyEmail').on('blur', function() {
29
		checkEmail();
30
	}); 
31

32
	/*发送验证邮件*/
33
	$('#saveSubmit').on('click', function() {
34
		reqBindOrgMail();
35
	});
36

37
	function emailhome(emailset) {
38
		var emailq = emailset.replace(/@.*/, "");
39
		var emailh = emailset.replace(emailq, "");
40
		if(emailq.length >= 6) {
41
			emailCookieshow = emailq.substring(emailq.length - 4, 0) + "****" + emailh;
42
		}
43
		if(emailq.length == 5) {
44
			emailCookieshow = emailq.substring(emailq.length - 3, 0) + "***" + emailh;
45
		}
46
		if(emailq.length == 4) {
47
			emailCookieshow = emailq.substring(emailq.length - 2, 0) + "**" + emailh;
48
		}
49
		if(emailq.length == 3) {
50
			emailCookieshow = emailq.substring(emailq.length - 1, 0) + "*" + emailh;
51
		}
52
		if(emailq.length < 3) {
53
			emailCookieshow = emailq + emailh;
54
		}
55
		return emailCookieshow;
56
	}
57

58
	function checkEmail() {
59
		companyEmailVal = $("#companyEmail").val();
60
		var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
61
		if(gunf.test(companyEmailVal.trim())) {
62
			$.ajax("/ajax/isRegOrg", {
63
				data: {
64
					"email": companyEmailVal
65
				},
66
				type: "GET",
67
				dataType: 'json',
68
				async: false,
69
				success: function($data) {
70
					console.log($data)
71
					if($data.data == false) {
72
						$(".msgBind1 span").text("该邮箱已绑定,请使用其他邮箱");
73
					} else {
74
						$(".msgBind1 span").text("");
75
						setemail = true;
76
					}
77
				},
78
				error: function() {
79
					$.MsgBox.Alert('提示', '服务器请求失败')
80
				},
81
			});
82
		} else {
83
			$(".msgBind1 span").text("请输入正确是邮箱地址");
84
		}
85
	}
86

87
	function reqBindOrgMail() {
88
		if(setemail) {
89
			$.ajax("/ajax/reqBindOrgMail", {
90
				data: {
91
					"id": orgid,
92
					"mail": companyEmailVal
93
				},
94
				type: "GET",
95
				dataType: 'json',
96
				async: false,
97
				success: function($data) {
98
					console.log($data)
99
					if($data.data) {
100
						$("#emailone").addClass("displayNone");
101
						$("#emailtwo").removeClass("displayNone");
102
						$("#emailShow").text(companyEmailVal);
103
						$("#emailGo").on("click", function() {
104
							var url = companyEmailVal.split('@')[1];
105
							for(var j in hash) {
106
								$(this).attr("href", hash[url]);
107
								window.open(hash[url]);
108
								location.reload(true);
109
							}
110
						});
111
					} else {
112
						$.MsgBox.Alert('提示', '发送邮箱验证失败')
113
					}
114
				},
115
				error: function() {
116
					$.MsgBox.Alert('提示', '服务器请求失败')
117
				},
118
			});
119
		}else{
120
			checkEmail();
121
		}
122
	}
123

124
})

+ 32 - 1
cmp-portal/js/cmp-setPwd.js

@ -1,6 +1,8 @@
1 1
//密码修改
2 2
$(function() {
3
	
3 4
	var oldPwdVal, newPwdVal, newPwdOkVal;
5
	var orgid = $.cookie('orgId');
4 6
	var setoldpwd = false;
5 7
	var setnewpwd = false;
6 8
	var setnewpwd2 = false;
@ -31,7 +33,7 @@ $(function() {
31 33

32 34
	/*注册提交*/
33 35
	$('#newpwdSubmit').on('click', function() {
34
		
36
		newpwdSubmitFun();
35 37
	});
36 38

37 39
	function checkOldPwd() {
@ -66,4 +68,33 @@ $(function() {
66 68
		}
67 69
	}
68 70
	
71
	function newpwdSubmitFun() {
72
		if(setoldpwd && setnewpwd && setnewpwd){
73
			$.ajax("/ajax/cpOrg", {
74
				data: {
75
					"id": orgid,
76
					"onw": oldPwdVal,
77
					"npw": newPwdOkVal
78
				},
79
				type: "POST",
80
				dataType: 'json',
81
				async: false,
82
				success: function($data) {
83
					console.log($data)
84
					if($data.data) {
85
						$.MsgBox.Alert('提示', '密码修改成功!');
86
						$("#cmpAllUl input").val("");
87
						$("#newpwdSubmit").attr("disabled", true);
88
					}else{
89
						$.MsgBox.Alert('提示', '请输入正确的当前密码');
90
					}
91
				},
92
				error: function() {
93
					$.MsgBox.Alert('提示', '服务器请求失败');
94
				}
95
			});	
96
		}
97
	}
98

99
	
69 100
})

+ 1 - 1
cmp-portal/js/cmp-settled-log.js

@ -81,7 +81,7 @@ $(function() {
81 81
					if($data.success && $data.data!==null) {
82 82
						location.href = "cmp-workspaces.html";
83 83
					} else if($data.success && $data.data == null){
84
						$.MsgBox.Alert('提示', '登录账号与密码不匹配');
84
						$(".msgLog2 span").text("登录账号与密码不匹配");
85 85
					}
86 86
				},
87 87
				error: function() {