miaofuhao 11 months ago
parent
commit
45d6a0230c

+ 4 - 31
双汇APP-h5/Common/js/setting_manage.js

@@ -22,9 +22,7 @@ mui.init({
22 22
 		}
23 23
 	},
24 24
 	beforeback: function() {
25
-		var list = plus.webview.currentWebview().opener();
26
-		//refresh是A页面自定义事件
27
-		mui.fire(list, 'refreshPer');
25
+		console.log("返回上一页")
28 26
 		//返回true,继续页面关闭逻辑
29 27
 		return true;
30 28
 	}
@@ -162,24 +160,11 @@ function Ajax() {
162 160
 $('.tabalList').on('tap', '.xg_manage', function() {
163 161
 	var id = $(this).attr('data-index');
164 162
 	var name = $(this).attr('data-name');
163
+	var targetUrl = 'xg_manage.html?name=' + encodeURIComponent(name) + '&id=' + encodeURIComponent(id);
165 164
 	mui.openWindow({
166
-		id: 'xg_manage',
167
-		url: 'xg_manage.html',
165
+		id:'xg_manage',
166
+		url: targetUrl,
168 167
 		createNew: true,
169
-		show: {
170
-			aniShow: 'pop-in'
171
-		},
172
-		styles: {
173
-			popGesture: 'hide'
174
-		},
175
-		waiting: {
176
-			autoShow: true
177
-		},
178
-		extras: {
179
-			name: name,
180
-			nameid: id,
181
-			token: localStorage.getItem('token')
182
-		}
183 168
 	});
184 169
 })
185 170
 $('.tjyh').on('tap', function() {
@@ -187,17 +172,5 @@ $('.tjyh').on('tap', function() {
187 172
 		id: 'tj_manage',
188 173
 		url: 'tj_manage.html',
189 174
 		createNew: true,
190
-		show: {
191
-			aniShow: 'pop-in'
192
-		},
193
-		styles: {
194
-			popGesture: 'hide'
195
-		},
196
-		waiting: {
197
-			autoShow: false
198
-		},
199
-		extras: {
200
-			token: localStorage.getItem('token')
201
-		}
202 175
 	});
203 176
 })

+ 12 - 10
双汇APP-h5/Common/js/tj_manage.js

@@ -1,8 +1,5 @@
1 1
 mui.init({
2 2
 	beforeback: function() {
3
-		var list = plus.webview.currentWebview().opener();
4
-		//refresh是A页面自定义事件
5
-		mui.fire(list, 'refresh');
6 3
 		//返回true,继续页面关闭逻辑
7 4
 		return true;
8 5
 	}
@@ -10,9 +7,8 @@ mui.init({
10 7
 
11 8
 //初始化单页的区域滚动
12 9
 mui('.mui-scroll-wrapper').scroll();
13
-mui.plusReady(function() {
14
-
15
-	//	产品代码
10
+window.onload = function () {
11
+	//	部门数据
16 12
 	var Product = [];
17 13
 	$.ajax({
18 14
 		type: "get",
@@ -76,7 +72,7 @@ mui.plusReady(function() {
76 72
 			var F_Product = doc.getElementById('F_ProductType');
77 73
 			showUserPickerButton2.addEventListener('tap', function(event) {
78 74
 				userPicker2.show(function(items) {
79
-
75
+	
80 76
 					if (items[2].text == undefined) {
81 77
 						if (items[1].text == undefined) {
82 78
 							F_Product.value = items[0].text;
@@ -105,7 +101,8 @@ mui.plusReady(function() {
105 101
 			}, false);
106 102
 		})
107 103
 	})(mui, document);
108
-})
104
+}
105
+
109 106
 $('#xgPassword').on('tap', function() {
110 107
 
111 108
 	//	alert($('.F_UserName').val());
@@ -138,9 +135,14 @@ $('#xgPassword').on('tap', function() {
138 135
 				if (data.state == "success") {
139 136
 
140 137
 					mui.alert('账号' + data.data.F_UserCode + '--密码' + data.data.F_Password, '添加成功',
138
+						
141 139
 						function() {
142
-							var wobj = plus.webview.getWebviewById("Setting_manage");
143
-							wobj.reload(true);
140
+							mui.openWindow({
141
+								id: 'Setting_manage',
142
+								url: 'Setting_manage.html',
143
+								createNew: true,
144
+							});
145
+							
144 146
 						});
145 147
 
146 148
 				} else {

+ 22 - 14
双汇APP-h5/Common/js/xg_manage.js

@@ -1,8 +1,6 @@
1 1
 mui.init({
2 2
 	beforeback: function() {    
3
-		var list = plus.webview.currentWebview().opener();    
4
-		//refresh是A页面自定义事件
5
-		mui.fire(list, 'refresh');
3
+		
6 4
 		//返回true,继续页面关闭逻辑
7 5
 		return true;
8 6
 	}
@@ -11,11 +9,12 @@ var F_RoleId = localStorage.getItem('F_RoleId');
11 9
 var F_UserCode = localStorage.getItem('F_UserCode');
12 10
 //初始化单页的区域滚动
13 11
 mui('.mui-scroll-wrapper').scroll();
14
-mui.plusReady(function() {
15
-	
16
-	var wv = plus.webview.currentWebview();
17
-	var nameid = wv.nameid;
18
-	var name = wv.name;
12
+
13
+window.onload = function () {
14
+	// 获取传递的参数
15
+	var name = getQueryString('name');
16
+	var nameid = getQueryString('id');
17
+	console.log(name,nameid)
19 18
 	// 角色
20 19
 	var roleList = []
21 20
 	$.ajax({
@@ -74,7 +73,7 @@ mui.plusReady(function() {
74 73
 		error: function(xhr, type, errorThrown) {
75 74
 			//异常处理;
76 75
 		}
77
-
76
+	
78 77
 	});
79 78
 	//	产品代码
80 79
 	var Product = [];
@@ -142,7 +141,9 @@ mui.plusReady(function() {
142 141
 			}, false);
143 142
 		})
144 143
 	})(mui, document);
145
-})
144
+}
145
+
146
+
146 147
 $('#deteBtn').on('tap', function() {
147 148
 	var btnArray = ['否', '是'];
148 149
 	var zhxx=$('.rolname').val();
@@ -159,8 +160,12 @@ $('#deteBtn').on('tap', function() {
159 160
 				},
160 161
 				success: function(data) {
161 162
 					if(data.state == "success") {
162
-						var wobj = plus.webview.getWebviewById("Setting_manage");
163
-						wobj.reload(true);
163
+						mui.openWindow({
164
+							id: 'Setting_manage',
165
+							url: 'Setting_manage.html',
166
+							createNew: true,
167
+						});
168
+						
164 169
 					} else {
165 170
 						mui.toast(data.message);
166 171
 					}
@@ -200,8 +205,11 @@ $('#xgPassword').on('tap', function() {
200 205
 						if(data.state == "success") {
201 206
 							mui.toast('修改成功!');
202 207
 							setTimeout(function () {
203
-								var wobj = plus.webview.getWebviewById("Setting_manage");
204
-								wobj.reload(true);
208
+								mui.openWindow({
209
+									id: 'Setting_manage',
210
+									url: 'Setting_manage.html',
211
+									createNew: true,
212
+								});
205 213
 							},1500)
206 214
 						} else {
207 215
 							mui.toast(data.message);

+ 1 - 0
双汇APP-h5/Common/xg_manage.html

@@ -98,4 +98,5 @@
98 98
 	<script src="../js/mui.view.js "></script>
99 99
 	<script src="../js/app.js"></script>
100 100
 	<script src="js/xg_manage.js"></script>
101
+	<script src="../js/utils/index.js"></script>
101 102
 </html>

+ 18 - 2
双汇APP-h5/Setting-1.html

@@ -8,6 +8,7 @@
8 8
 		<meta name="apple-mobile-web-app-capable" content="yes">
9 9
 		<meta name="apple-mobile-web-app-status-bar-style" content="black">
10 10
 		<link rel="stylesheet" href="css/mui.min.css">
11
+		<link rel="stylesheet" href="./css/iconfont.css" />
11 12
 		<link rel="stylesheet" href="css/setting.css" />
12 13
 	</head>
13 14
 
@@ -17,7 +18,7 @@
17 18
 			<div class="mui-view">
18 19
 				<div class="mui-navbar" style="display: none;">
19 20
 				</div>
20
-				<div class="mui-pages" style="top: 0;">啊啊啊
21
+				<div class="mui-pages" style="top: 0;">
21 22
 				</div>
22 23
 			</div>
23 24
 		</div>
@@ -77,7 +78,21 @@
77 78
 			<input type="hidden" id="Vb" />
78 79
 			<!--页面主内容区结束-->
79 80
 		</div>
80
-
81
+		<nav class="mui-bar mui-bar-tab">
82
+		
83
+			<a class="mui-tab-item" href="personal.html" index="0">
84
+				<span class="mui-icon iconfont icon-gongzuojiaoban"></span>
85
+				<span class="mui-tab-label">我的任务</span>
86
+			</a>
87
+			<a class="mui-tab-item" href="tab-phone.html" index="1">
88
+				<span class="mui-icon iconfont icon-tongxunlu"></span>
89
+				<span class="mui-tab-label">通讯录</span>
90
+			</a>
91
+			<a class="mui-tab-item mui-active" href="Setting-1.html" index="2">
92
+				<span class="mui-icon iconfont icon-yonghu"></span>
93
+				<span class="mui-tab-label">我的</span>
94
+			</a>
95
+		</nav>
81 96
 		<!--常见问题-->
82 97
 	</body>
83 98
 	<script src="js/mui.min.js "></script>
@@ -85,5 +100,6 @@
85 100
 	<script src="js/jquery-1.8.js"></script>
86 101
 	<script src="js/huayi.config.js"></script>
87 102
 	<script src="js/mui.view.js "></script>
103
+	<script src="js/utils/menu.js"></script>
88 104
 	<script src="js/setting.js"></script>
89 105
 </html>

+ 7 - 95
双汇APP-h5/js/personal.js

@@ -1,21 +1,15 @@
1 1
 mui.init();
2 2
 
3 3
 var token = localStorage.getItem("token"); //获取本地存储
4
-mui.plusReady(function() {
5
-	console.log(1)
4
+window.onload = function () {
6 5
 	ajaxRefresh();
7
-	
8
-	setTimeout(function() {
9
-		clienGet();
10
-		upData(); //监测版本号更新APP indexOutTime
11
-	},huayi.config.indexOutTime);
12 6
 	setInterval(function() {ajaxRefresh()},60*1000);
13
-	setInterval(function() {clienGet()},huayi.config.indextime); 
14
-})
7
+}
15 8
 
16 9
 window.addEventListener('refreshPer', function(e) { //点返回按钮时执行刷新
17 10
 	ajaxRefresh();
18 11
 });
12
+
19 13
 //权限判断
20 14
 $.ajax({
21 15
 	data: {
@@ -188,6 +182,7 @@ function ajaxRefresh() {
188 182
 	});
189 183
 }
190 184
 
185
+
191 186
 //一级查看-待处理列表
192 187
 $(".work-list").on('tap', function() {
193 188
 	var index = $(this).attr('index');
@@ -244,93 +239,10 @@ $(".work-CJ").on('tap', function() {
244 239
 		}
245 240
 	});
246 241
 })
247
-function  clienGet() {
248
-	var pinf = plus.push.getClientInfo();
249
-	var cid = pinf.clientid;//客户端标识   
250
-	if (plus.device.model.indexOf('iPhone') > -1) {
251
-		var apptype=2;
252
-	}else{
253
-		var apptype=1;
254
-	}
255
-	$.ajax({
256
-		type: "get",
257
-		url: huayi.config.callcenter_url + 'PushMessage/PutAppClientIdAsync',
258
-		async: false,
259
-		data: {
260
-			apptype:apptype,
261
-			clientid: cid,
262
-			token:localStorage.getItem("token")
263
-		},
264
-		dataType: 'json', 
265
-		success: function(res) {
266
-			if(res.state.toLowerCase() === "success") {
267
-			}				
268
-		}
269
-	});	
270
-}
271 242
 
272
-function upData() {
273
-	// 版本更新
274
-	var Code_;
275
-	var NewCode_;
276
-	plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
277
-		console.log("当前应用版本:" + wgtinfo.version + "---" + plus.runtime.version);
278
-		localStorage.setItem("Code", wgtinfo.version) //缓存保存版本号;
279
-		Code_ = localStorage.getItem("Code");
280
-		$('.update').text(Code_);
281
-	});	
282
-	if (plus.device.model.indexOf('iPhone') > -1) {
283
-		typeUp=1;
284
-	}else{
285
-		typeUp=0; 
286
-	}
287
-	//检查更新
288
-	var server = huayi.config.callcenter_url + "ApplicationsVersion/GetAndroid"; //获取升级描述文件服务器地址	
289
-	mui.ajax(server, {
290
-		data: {
291
-			type:typeUp,
292
-			isNew: true, 
293
-			token: token
294
-		},
295
-		dataType: 'json', //服务器返回json格式数据
296
-		type: 'post', //HTTP请求类型
297
-		timeout: 10000, //超时时间设置为10秒;
298
-		headers: {
299
-			'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
300
-		},
301
-		success: function(data) { 
302
-			if (data.state == "success") {
303
-				NewCode_ = data.data.F_VersionCode;
304
-				localStorage.setItem("Code", NewCode_);//缓存保存版本号;
305
-				if(NewCode_&&Code_){
306
-					if (Code_ != NewCode_) {
307
-						var Codes = localStorage.setItem("Code", NewCode_);
308
-						console.log(Codes);
309
-						plus.nativeUI.confirm("发现新版本", function(event) {
310
-							var tapIndex = event.index; 
311
-							if (tapIndex == 0) { 
312
-								if (typeUp==1) {
313
-									plus.runtime.openURL(data.data.F_Url);
314
-								}else{
315
-									plus.runtime.openURL(data.data.FileUrl[0].F_Url);
316
-								}
317
-							} else {
318
-								mui.toast("取消更新");
319
-							}
320
-						}, "提示", ["立即更新", "取消"])
321
-					}
322
-				}
323
-				
324 243
 
325
-			} else {
326
-				mui.toast(data.message);
327 244
 
328
-			}
329 245
 
330
-		},
331
-		error: function(data) {
332
-			//异常处理;
333
-			console.log(data.message);
334
-		}
335
-	})
336
-}
246
+
247
+
248
+

+ 2 - 92
双汇APP-h5/js/setting.js

@@ -45,90 +45,8 @@ function adminTx() {
45 45
 
46 46
 
47 47
 //		//检测网络连接
48
-mui.plusReady(function() {
48
+window.onload = function () {
49 49
 	adminTx();
50
-	var Code_;
51
-	var NewCode_;
52
-	var server = huayi.config.callcenter_url + "ApplicationsVersion/GetAndroid?"; //获取升级描述文件服务器地址
53
-	document.addEventListener("netchange", wainshow, false);
54
-	plus.runtime.getProperty(plus.runtime.appid, function(wgtinfo) {
55
-		//				$("#Vb").text(wgtinfo.version);
56
-		//			 var 
57
-		//							$('.update').text(Code_);
58
-		console.log("当前应用版本:" + wgtinfo.version + "---" + plus.runtime.version);
59
-		localStorage.setItem("Code", wgtinfo.version) //缓存保存版本号;
60
-		Code_ = localStorage.getItem("Code");
61
-		$('.update').text(Code_);
62
-
63
-		//			Gx();
64
-	});
65
-	//检查更新
66
-	document.getElementById("update").addEventListener('tap', function() {
67
-		if (plus.device.model.indexOf('iPhone') > -1) {
68
-			typeUp=1;
69
-		}else{
70
-			typeUp=0; 
71
-		}
72
-		var server = huayi.config.callcenter_url + "ApplicationsVersion/GetAndroid?"; //获取升级描述文件服务器地址
73
-		mui.ajax(server, {
74
-			data: {
75
-				type:typeUp,
76
-				isNew: true,
77
-				token: a
78
-			},
79
-			dataType: 'json', //服务器返回json格式数据
80
-			type: 'post', //HTTP请求类型
81
-			timeout: 10000, //超时时间设置为10秒;
82
-			headers: {
83
-				'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
84
-			},
85
-			success: function(data) {
86
-				if(data.state == "success") {
87
-					NewCode_ = data.data.F_VersionCode;
88
-					
89
-					localStorage.setItem("Code", NewCode_); //缓存保存版本号;
90
-					if(Code_ != NewCode_) {
91
-						var Codes = localStorage.setItem("Code", NewCode_);
92
-						console.log(Codes);
93
-						plus.nativeUI.confirm("发现新版本", function(event) {
94
-							var tapIndex = event.index;
95
-							if(tapIndex == 0) {
96
-								if (typeUp==1) {
97
-									plus.runtime.openURL(data.data.F_Url);
98
-								}else{
99
-									plus.runtime.openURL(data.data.FileUrl[0].F_Url);
100
-								}
101
-							} else {
102
-								mui.toast("取消更新");
103
-							}
104
-						}, "提示", ["立即更新", "取消", ])
105
-					}
106
-
107
-				} else {
108
-					mui.toast(data.message);
109
-
110
-				}
111
-
112
-			},
113
-			error: function(data) {
114
-				//异常处理;
115
-				console.log(data.message);
116
-			}
117
-		})
118
-	});
119
-	var backcount = 0;
120
-	mui.back = function() {
121
-		if(mui.os.ios) return;
122
-		if(backcount > 0) {
123
-			if(window.plus) plus.runtime.quit();
124
-			return;
125
-		};
126
-		mui.toast('再按一次退出应用');
127
-		backcount++;
128
-		setTimeout(function() {
129
-			backcount = 0;
130
-		}, 2000);
131
-	};
132 50
 	//用户管理
133 51
 	$("#management").on('tap', function() {
134 52
 		mui.openWindow({
@@ -156,16 +74,8 @@ mui.plusReady(function() {
156 74
 			
157 75
 		});
158 76
 	})
159
-
160
-});
161
-//检测网络连接
162
-function wainshow() {
163
-	if(plus.networkinfo.getCurrentType() == plus.networkinfo.CONNECTION_NONE) {
164
-		mui.toast("网络异常,请检查网络设置!");
165
-	} else {
166
-		mui.toast("网络连接");
167
-	}
168 77
 }
78
+
169 79
 //常见问题
170 80
 document.getElementById('Question').addEventListener('tap', function() {
171 81
 	

+ 8 - 0
双汇APP-h5/js/utils/index.js

@@ -0,0 +1,8 @@
1
+function getQueryString(name) {
2
+	var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');
3
+	var r = window.location.search.substr(1).match(reg);
4
+	if (r != null) {
5
+		return decodeURIComponent(r[2]);
6
+	}
7
+	return null;
8
+}

+ 19 - 0
双汇APP-h5/js/utils/menu.js

@@ -0,0 +1,19 @@
1
+//一级查看-待处理列表
2
+$(".mui-tab-item").on('tap', function() {
3
+	var url = $(this).attr('href');
4
+	var index = $(this).attr('index');
5
+	mui.openWindow({
6
+		id: url,
7
+		url: url,
8
+		createNew: true,
9
+		show: {
10
+			autoShow: false
11
+		},
12
+		waiting: {
13
+			autoShow: true //自动显示等待框,默认为true
14
+		},
15
+		extras: {
16
+			index: index,
17
+		}
18
+	});
19
+})

+ 20 - 0
双汇APP-h5/personal.html

@@ -11,6 +11,9 @@
11 11
 		<link rel="stylesheet" href="css/iconfont.css" />
12 12
 		<link rel="stylesheet" href="css/personal.css" />
13 13
 		<style>
14
+			.mui-content {
15
+			    touch - action: none;
16
+			}
14 17
 			#Report {
15 18
 				width: 110px;
16 19
 				margin: 0 auto;
@@ -369,9 +372,26 @@
369 372
 			</div>
370 373
 
371 374
 		</div>
375
+		<nav class="mui-bar mui-bar-tab">
376
+		
377
+			<a class="mui-tab-item mui-active" href="personal.html" index="0">
378
+				<span class="mui-icon iconfont icon-gongzuojiaoban"></span>
379
+				<span class="mui-tab-label">我的任务</span>
380
+			</a>
381
+			<a class="mui-tab-item" href="tab-phone.html" index="1">
382
+				<span class="mui-icon iconfont icon-tongxunlu"></span>
383
+				<span class="mui-tab-label">通讯录</span>
384
+			</a>
385
+			<a class="mui-tab-item" href="Setting-1.html" index="2">
386
+				<span class="mui-icon iconfont icon-yonghu"></span>
387
+				<span class="mui-tab-label">我的</span>
388
+			</a>
389
+		</nav>
372 390
 	</body>
373 391
 	<script src="js/mui.min.js "></script>
374 392
 	<script src="js/zepto.js"></script>
375 393
 	<script src="js/huayi.config.js"></script>
394
+	<script src="js/utils/menu.js"></script>
376 395
 	<script src="js/personal.js"></script>
396
+	
377 397
 </html>

+ 16 - 0
双汇APP-h5/tab-phone.html

@@ -70,11 +70,27 @@
70 70
 			
71 71
 			<!--右上角弹出菜单-->
72 72
 		</div>
73
+		<nav class="mui-bar mui-bar-tab">
74
+		
75
+			<a class="mui-tab-item" href="personal.html" index="0">
76
+				<span class="mui-icon iconfont icon-gongzuojiaoban"></span>
77
+				<span class="mui-tab-label">我的任务</span>
78
+			</a>
79
+			<a class="mui-tab-item mui-active" href="tab-phone.html" index="1">
80
+				<span class="mui-icon iconfont icon-tongxunlu"></span>
81
+				<span class="mui-tab-label">通讯录</span>
82
+			</a>
83
+			<a class="mui-tab-item" href="Setting-1.html" index="2">
84
+				<span class="mui-icon iconfont icon-yonghu"></span>
85
+				<span class="mui-tab-label">我的</span>
86
+			</a>
87
+		</nav>
73 88
 		<input hidden="hidden" type="text" id='DWResult' class="ui-alert type_con" data-index="" readonly="readonly" />
74 89
 		<script src="./js/mui.min.js"></script>
75 90
 		<script src="./js/zepto.js"></script>
76 91
 		<script src="./js/huayi.config.js"></script>
77 92
 		<script src="./js/huayi.http.js"></script>
93
+		<script src="js/utils/menu.js"></script>
78 94
 		<script src="js/tab.js"></script>
79 95
 	</body>
80 96