浏览代码

修改咨询谢绝

xuchunyang 8 年之前
父节点
当前提交
f1cdf719dc
共有 3 个文件被更改,包括 105 次插入8 次删除
  1. 5 5
      cmp-portal/cmp-settled-reback.html
  2. 96 0
      cmp-portal/js/cmp-settled-reback.js
  3. 4 3
      js/consultSure.js

+ 5 - 5
cmp-portal/cmp-settled-reback.html

@ -9,10 +9,7 @@
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>
17 14
<!--头部-->
18 15
<header>
@ -68,11 +65,14 @@
68 65
	</div>
69 66
</div>
70 67

71

72 68
<!--底部-->
73 69
<footer>
74 70
	<script type="text/javascript" src="js/public/cmpFooter.js"></script>
75 71
</footer>
76

72
<script type="text/javascript"src="js/public/jquery.cookie.js"></script>
73
<script type="text/javascript" src="js/public/jquery.similar.msgbox.js"></script>
74
<script type="text/javascript" src="js/public/ajaxfileupload.js"></script>
75
<script type="text/javascript" src="js/public/common.js"></script>
76
<script type="text/javascript" src="js/cmp-settled-reback.js"></script>
77 77
</body>
78 78
</html>

+ 96 - 0
cmp-portal/js/cmp-settled-reback.js

@ -0,0 +1,96 @@
1
//找回企业账号
2
$(function() {
3

4
	var companyNameVal, companyEmailVal;
5
	var setpass = false;
6
	var setemail = false;
7

8
	/*校验登录按钮显示状态*/
9
	$('#cmpCoverUl').on('keyup', ".companyEmail,#companyPasw", function() {
10
		if($(".companyEmail").val() == "" || $("#companyPasw").val() == "") {
11
			$("#loginSubmit").attr("disabled", true);
12
		} else {
13
			$("#loginSubmit").attr("disabled", false);
14
		}
15
	});
16

17
	/*校验企业邮箱*/
18
	$('.companyEmail').on('blur', function() {
19
		checkEmail();
20
	});
21

22
	/*校验登录密码*/
23
	$('#companyPasw').on('blur', function() {
24
		checkPasw();
25
	});
26

27
	/*注册提交*/
28
	$('#loginSubmit').on('click', function() {
29
		mailRegistration();
30
	});
31

32
	function checkEmail() {
33
		companyEmailVal = $(".companyEmail").val();
34
		var gunf = /^([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+@([a-zA-Z0-9]+[_|\_|\.]?)*[a-zA-Z0-9]+\.[a-zA-Z]{2,3}$/;
35
		if(gunf.test(companyEmailVal.trim())) {
36
			$.ajax("/ajax/isRegOrg", {
37
				data:{"email":companyEmailVal},
38
				type: "GET",
39
				dataType: 'json',
40
				async: false,
41
				success: function($data) {
42
					console.log($data);
43
					if($data.success && $data.data) {
44
						$(".msgLog1 span").text("该企业账号不存在,请检查后重试");
45
					} else {
46
						$(".msgLog1 span").text("");
47
						setemail = true;
48
					}
49
				},
50
				error: function() {
51
					$.MsgBox.Alert('提示', '服务器请求失败')
52
				},
53
			});
54
		} else {
55
			$(".msgLog1 span").text("请输入正确是邮箱地址");
56
		}
57
	}
58

59
	function checkPasw() {
60
		companyPaswVal = $("#companyPasw").val();
61
		if(companyPaswVal.length < 6) {
62
			$(".msgLog2 span").text("密码由6-24个字符组成,区分大小写");
63
		} else {
64
			$(".msgLog2 span").text("");
65
			setpass = true;
66
		}
67
	}
68

69
	function mailRegistration() {
70
		if(setpass && setemail) {
71
			$.ajax("/ajax/orgLogin", {
72
				data: {
73
					"lk": companyEmailVal,
74
					"pw": companyPaswVal
75
				},
76
				type: "POST",
77
				dataType: 'json',
78
				async: false,
79
				success: function($data) {
80
					console.log($data)
81
					if($data.success && $data.data!==null) {
82
						location.href = "cmp-workspaces.html";
83
					} else if($data.success && $data.data == null){
84
						$(".msgLog2 span").text("登录账号与密码不匹配");
85
					}
86
				},
87
				error: function() {
88
					$.MsgBox.Alert('提示', '服务器请求失败');
89
				}
90
			});
91
		} else {
92
			checkEmail();
93
			checkPasw();
94
		}
95
	}
96
})

+ 4 - 3
js/consultSure.js

@ -3,6 +3,7 @@ $(function() {
3 3
	var consultId = GetQueryString('consultId');
4 4
	var sendId = $.cookie("userid");
5 5
	var professorId = "professorId";
6
	var newtemp;
6 7
	consucentfun(consultId);
7 8

8 9
	/*点击确认接受咨询*/
@ -196,10 +197,10 @@ function submtbut(consultId, sendId, newtemp) {
196 197
		traditional: true, //传数组必须加这个
197 198
		success: function(data) {
198 199
			if(data.success) {
199
				$.MsgBox.Confirm('提示', "已谢绝对方的咨询——您可以再看看其他需求。", function() {
200
					$("#mb_btn_no").hide();
200
				$.MsgBox.Alert('提示', "已谢绝对方的咨询——您可以再看看其他需求。");
201
				setInterval (function(){
201 202
					window.location.href = "index.html";
202
				});
203
				},1000);
203 204
			}
204 205
		},
205 206
		error: function() {