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

+ 34 - 3
WeChat/index.html

@@ -19,7 +19,9 @@
19 19
 			//var openid = 'oXF5e1mWpX5DajW5_yjNLPKb8ThE';
20 20
 			var code = helper.request.queryString("code");
21 21
 			var menucode = helper.request.queryString("menucode");
22
+			var typeUser = helper.cookies.get("typeUser");
22 23
 			if(!openid) {
24
+				
23 25
 				$.ajax({
24 26
 					type: "get",
25 27
 					url: huayi.config.callcenter_url + 'WxLogin/GetOpenId',
@@ -29,14 +31,18 @@
29 31
 					dataType: 'json',
30 32
 					success: function(result) {
31 33
 						if(result.state.toLowerCase() == "success") {
34
+							
32 35
 							var openid=result.data.openid;
33 36
 							window.location.replace("login.html?menuCode="+menucode+'&openid='+openid);
34 37
 						}
35 38
 					}
36 39
 				});
37 40
 			}else {
38
-				gourl();
39
-				
41
+				if (typeUser=="5") {
42
+					gourl();
43
+				} else if(typeUser=="1"){
44
+					gourlStaff();
45
+				}
40 46
 			}
41 47
 			function gourl(){
42 48
 				switch(menucode) {
@@ -44,7 +50,7 @@
44 50
 						window.location.replace("content/AddInvoice.html");
45 51
 						break; //我要开票
46 52
 					case "WDGS":
47
-						window.location.replace("content/company.html");
53
+						window.location.replace("content/company.html?menucode=WDGS");
48 54
 						break; //我的公司
49 55
 					case "WDCW":
50 56
 						window.location.replace("content/finance.html");
@@ -63,6 +69,31 @@
63 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 97
 		</script>
67 98
 	</body>
68 99
 

+ 15 - 12
WeChat/login.html

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