Bladeren bron

三元修改

miaofuhao 6 jaren geleden
bovenliggende
commit
1f89fa0682
3 gewijzigde bestanden met toevoegingen van 53 en 18 verwijderingen
  1. 4 3
      WeChat/content/company.html
  2. 34 3
      WeChat/index.html
  3. 15 12
      WeChat/login.html

+ 4 - 3
WeChat/content/company.html

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
-<html>
2
+<html style="height: 100%;">
3
 
3
 
4
 	<head>
4
 	<head>
5
 		<meta charset="utf-8">
5
 		<meta charset="utf-8">
11
 		<link rel="stylesheet" href="../css/iconfont.css" />
11
 		<link rel="stylesheet" href="../css/iconfont.css" />
12
 		<link rel="stylesheet" href="css/companyl.css" />
12
 		<link rel="stylesheet" href="css/companyl.css" />
13
 	</head>
13
 	</head>
14
-	<body>
14
+	<body style="height: 100%;">
15
 		<!--页面主内容区开始-->
15
 		<!--页面主内容区开始-->
16
 		<div class="mui-content">
16
 		<div class="mui-content">
17
 			<div class='Content'>
17
 			<div class='Content'>
101
 	<script src="../Script/Common/huayi.http.js"></script>
101
 	<script src="../Script/Common/huayi.http.js"></script>
102
 	<script src="js/company.js"></script>
102
 	<script src="js/company.js"></script>
103
 	<script>
103
 	<script>
104
+		var menucode = helper.request.queryString("menucode");
104
 		var turn=1;
105
 		var turn=1;
105
 		$("#quit").click(function() {
106
 		$("#quit").click(function() {
106
 			//点击图片后发送跳转到指定页面的事件。
107
 			//点击图片后发送跳转到指定页面的事件。
108
 			mui.confirm('确定返回?', '提示', btnArray, function(f) {
109
 			mui.confirm('确定返回?', '提示', btnArray, function(f) {
109
 				if(f.index == 1) {
110
 				if(f.index == 1) {
110
 					helper.cookies.set("openid", "", -1);
111
 					helper.cookies.set("openid", "", -1);
111
-					window.location.href = "../login.html";
112
+					window.location.href = "../index.html?menucode="+menucode;
112
 				} else {
113
 				} else {
113
 					mui.toast("取消");
114
 					mui.toast("取消");
114
 				}
115
 				}

+ 34 - 3
WeChat/index.html

19
 			//var openid = 'oXF5e1mWpX5DajW5_yjNLPKb8ThE';
19
 			//var openid = 'oXF5e1mWpX5DajW5_yjNLPKb8ThE';
20
 			var code = helper.request.queryString("code");
20
 			var code = helper.request.queryString("code");
21
 			var menucode = helper.request.queryString("menucode");
21
 			var menucode = helper.request.queryString("menucode");
22
+			var typeUser = helper.cookies.get("typeUser");
22
 			if(!openid) {
23
 			if(!openid) {
24
+				
23
 				$.ajax({
25
 				$.ajax({
24
 					type: "get",
26
 					type: "get",
25
 					url: huayi.config.callcenter_url + 'WxLogin/GetOpenId',
27
 					url: huayi.config.callcenter_url + 'WxLogin/GetOpenId',
29
 					dataType: 'json',
31
 					dataType: 'json',
30
 					success: function(result) {
32
 					success: function(result) {
31
 						if(result.state.toLowerCase() == "success") {
33
 						if(result.state.toLowerCase() == "success") {
34
+							
32
 							var openid=result.data.openid;
35
 							var openid=result.data.openid;
33
 							window.location.replace("login.html?menuCode="+menucode+'&openid='+openid);
36
 							window.location.replace("login.html?menuCode="+menucode+'&openid='+openid);
34
 						}
37
 						}
35
 					}
38
 					}
36
 				});
39
 				});
37
 			}else {
40
 			}else {
38
-				gourl();
39
-				
41
+				if (typeUser=="5") {
42
+					gourl();
43
+				} else if(typeUser=="1"){
44
+					gourlStaff();
45
+				}
40
 			}
46
 			}
41
 			function gourl(){
47
 			function gourl(){
42
 				switch(menucode) {
48
 				switch(menucode) {
44
 						window.location.replace("content/AddInvoice.html");
50
 						window.location.replace("content/AddInvoice.html");
45
 						break; //我要开票
51
 						break; //我要开票
46
 					case "WDGS":
52
 					case "WDGS":
47
-						window.location.replace("content/company.html");
53
+						window.location.replace("content/company.html?menucode=WDGS");
48
 						break; //我的公司
54
 						break; //我的公司
49
 					case "WDCW":
55
 					case "WDCW":
50
 						window.location.replace("content/finance.html");
56
 						window.location.replace("content/finance.html");
63
 						break;
69
 						break;
64
 				}
70
 				}
65
 			}
71
 			}
72
+			function gourlStaff() {
73
+				switch(menucode) {
74
+					case "WYKP":
75
+						window.location.replace("content/AddInvoice.html");
76
+						break; //我要开票
77
+					case "WDGS":
78
+						window.location.replace("content/company.html?menucode=WDGS");
79
+						break; //我的公司
80
+					case "WDCW":
81
+						window.location.replace("content/personal.html");
82
+						break; //我的财务
83
+					case "XXCL":
84
+						window.location.replace("content/personal.html");
85
+						break; //首页
86
+					case "FWJL":
87
+						window.location.replace("content/invoiceList.html");
88
+						break; //服务记录
89
+					case "GDLB":
90
+						window.location.replace("content/orderList.html");
91
+						break; //工单列表
92
+					default:
93
+						window.location.replace("error.html");
94
+						break;
95
+				}
96
+			}
66
 		</script>
97
 		</script>
67
 	</body>
98
 	</body>
68
 
99
 

+ 15 - 12
WeChat/login.html

1
 <!DOCTYPE html>
1
 <!DOCTYPE html>
2
-<html class="ui-page-login">
2
+<html class="ui-page-login" style="height: 100%">
3
 	<head>
3
 	<head>
4
 		<meta charset="utf-8">
4
 		<meta charset="utf-8">
5
 		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
5
 		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
11
 		<script src="Script/Common/huayi.http.js"></script>
11
 		<script src="Script/Common/huayi.http.js"></script>
12
 		<script src="Script/Common/huayi.config.js"></script>
12
 		<script src="Script/Common/huayi.config.js"></script>
13
 	</head>
13
 	</head>
14
-	<body>
14
+	<body  style="height: 100%">
15
 		<div class="mui-content">
15
 		<div class="mui-content">
16
 			<form id='login-form' class="mui-input-group">
16
 			<form id='login-form' class="mui-input-group">
17
 				<!--logo-->
17
 				<!--logo-->
38
 			</div>
38
 			</div>
39
 		</div>
39
 		</div>
40
 		<script src="js/mui.min.js"></script>
40
 		<script src="js/mui.min.js"></script>
41
-		
42
 		<script>
41
 		<script>
43
 			//var openid = helper.cookies.get("openid");
42
 			//var openid = helper.cookies.get("openid");
44
 			var menucode = helper.request.queryString("menuCode");
43
 			var menucode = helper.request.queryString("menuCode");
45
 			var code = helper.request.queryString("code");
44
 			var code = helper.request.queryString("code");
46
 			var openid = helper.request.queryString("openid");
45
 			var openid = helper.request.queryString("openid");
46
+			//var openid = "oXF5e1mWpX5DajW5_yjNLPKb8ThE";
47
 			var typeUser = helper.cookies.get("typeUser");
47
 			var typeUser = helper.cookies.get("typeUser");
48
 			if (typeUser) {
48
 			if (typeUser) {
49
 				typeUser = helper.cookies.get("typeUser");
49
 				typeUser = helper.cookies.get("typeUser");
50
 			} else{
50
 			} else{
51
 				typeUser=5;
51
 				typeUser=5;
52
 			}
52
 			}
53
-			
53
+			if (typeUser==1) {
54
+				$(".staff").hide();
55
+				$(".company").show();
56
+			} else if(typeUser==5){
57
+				$(".staff").show();
58
+				$(".company").hide();
59
+			}
54
 			//登陆验证
60
 			//登陆验证
55
 			$(".staff").on('tap', function() {
61
 			$(".staff").on('tap', function() {
56
 				$(this).hide();
62
 				$(this).hide();
71
 					mui.alert("密码不能为空")
77
 					mui.alert("密码不能为空")
72
 					return;
78
 					return;
73
 				}
79
 				}
74
-				debugger
75
 				login();
80
 				login();
76
 			})
81
 			})
77
 			function login () {
82
 			function login () {
89
 						//openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
94
 						//openid: 'oXF5e1mWpX5DajW5_yjNLPKb8ThE', //微信openid 测试用
90
 					},
95
 					},
91
 					success: function(data) {
96
 					success: function(data) {
92
-						debugger
93
 						if(data.state == "success") {
97
 						if(data.state == "success") {
94
 							var UserWord=$("#password").val();
98
 							var UserWord=$("#password").val();
95
 							helper.cookies.set("typeUser", typeUser, 7);
99
 							helper.cookies.set("typeUser", typeUser, 7);
96
 							helper.cookies.set("UserWord", UserWord, 7);
100
 							helper.cookies.set("UserWord", UserWord, 7);
101
+							debugger
97
 							if (openid) {
102
 							if (openid) {
98
 								helper.cookies.set("openid", openid, 7);
103
 								helper.cookies.set("openid", openid, 7);
104
+								debugger
99
 								if (typeUser=="5") {
105
 								if (typeUser=="5") {
100
 									gourl();
106
 									gourl();
101
 								} else if(typeUser=="1"){
107
 								} else if(typeUser=="1"){
102
 									gourlStaff();
108
 									gourlStaff();
103
 								}
109
 								}
104
-							}else{
105
-								helper.cookies.set("openid", openid, 7);
106
-								window.location.href = "content/company.html";
107
 							}
110
 							}
108
 						}
111
 						}
109
-					}
112
+					} 
110
 				})
113
 				})
111
 			}
114
 			}
112
 			function gourl() {
115
 			function gourl() {
115
 						window.location.replace("content/AddInvoice.html");
118
 						window.location.replace("content/AddInvoice.html");
116
 						break; //我要开票
119
 						break; //我要开票
117
 					case "WDGS":
120
 					case "WDGS":
118
-						window.location.replace("content/company.html");
121
+						window.location.replace("content/company.html?menucode=WDGS");
119
 						break; //我的公司
122
 						break; //我的公司
120
 					case "WDCW":
123
 					case "WDCW":
121
 						window.location.replace("content/finance.html");
124
 						window.location.replace("content/finance.html");
140
 						window.location.replace("content/AddInvoice.html");
143
 						window.location.replace("content/AddInvoice.html");
141
 						break; //我要开票
144
 						break; //我要开票
142
 					case "WDGS":
145
 					case "WDGS":
143
-						window.location.replace("content/personal.html");
146
+						window.location.replace("content/company.html?menucode=WDGS");
144
 						break; //我的公司
147
 						break; //我的公司
145
 					case "WDCW":
148
 					case "WDCW":
146
 						window.location.replace("content/personal.html");
149
 						window.location.replace("content/personal.html");