miaofuhao 11 mēneši atpakaļ
vecāks
revīzija
0f0951f28e

+ 29 - 32
双汇APP-h5/Common/Setting-Bm.html

@@ -110,38 +110,35 @@
110 110
 	<script src="../js/huayi.config.js"></script>
111 111
 	<script>
112 112
 		mui.init();
113
-		mui.plusReady(function() {
114
-			var wv = plus.webview.currentWebview();
115
-			var token = wv.token;
116
-			var id = wv.name;
117
-			mui.ajax(huayi.config.callcenter_url + "Article/GetInfoByTitle", {
118
-				data: {
119
-					title: $('.mui-title').text(),
120
-					token: localStorage.getItem('token')
121
-				},
122
-				dataType: 'json', //服务器返回json格式数据
123
-				type: 'get', //HTTP请求类型
124
-				timeout: 10000, //超时时间设置为10秒;
125
-				headers: {
126
-					'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
127
-				},
128
-				success: function(data) {
129
-					if(data.state == "success") {
130
-						$('.mui-title').text(data.data.F_Title);
131
-						$('.content').text(data.data.F_Content);
132
-
133
-					} else {
134
-						mui.toast("数据获取失败。");
135
-					}
136
-
137
-				},
138
-				error: function(xhr, type, errorThrown) {
139
-					//异常处理;
140
-
141
-				}
142
-			})
143
-
144
-		});
113
+		window.onload = function () {
114
+			// mui.ajax(huayi.config.callcenter_url + "Article/GetInfoByTitle", {
115
+			// 	data: {
116
+			// 		title: $('.mui-title').text(),
117
+			// 		token: localStorage.getItem('token')
118
+			// 	},
119
+			// 	dataType: 'json', //服务器返回json格式数据
120
+			// 	type: 'get', //HTTP请求类型
121
+			// 	timeout: 10000, //超时时间设置为10秒;
122
+			// 	headers: {
123
+			// 		'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
124
+			// 	},
125
+			// 	success: function(data) {
126
+			// 		if(data.state == "success") {
127
+			// 			$('.mui-title').text(data.data.F_Title);
128
+			// 			$('.content').text(data.data.F_Content);
129
+			
130
+			// 		} else {
131
+			// 			mui.toast("数据获取失败。");
132
+			// 		}
133
+			
134
+			// 	},
135
+			// 	error: function(xhr, type, errorThrown) {
136
+			// 		//异常处理;
137
+			
138
+			// 	}
139
+			// })
140
+		}
141
+		mui.plusReady(function() {});
145 142
 	</script>
146 143
 
147 144
 </html>

+ 30 - 29
双汇APP-h5/Common/Setting-SZ.html

@@ -58,36 +58,37 @@
58 58
 	<script src="../js/huayi.config.js"></script>
59 59
 	<script>
60 60
 		mui.init();
61
+		window.onload = function () {
62
+			
63
+			// mui.ajax(huayi.config.callcenter_url + "Article/GetInfoByTitle", {
64
+			// 	data: {
65
+			// 		title: $('.mui-title').text(),
66
+			// 		token: localStorage.getItem('token')
67
+			// 	},
68
+			// 	dataType: 'json', //服务器返回json格式数据
69
+			// 	type: 'get', //HTTP请求类型
70
+			// 	timeout: 10000, //超时时间设置为10秒;
71
+			// 	headers: {
72
+			// 		'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
73
+			// 	},
74
+			// 	success: function(data) {
75
+			// 		if(data.state == "success") {
76
+			// 			$('.mui-title').text(data.data.F_Title);
77
+			// 			$('.content').text(data.data.F_Content);
78
+			
79
+			// 		} else {
80
+			// 			mui.toast("数据获取失败。");
81
+			// 		}
82
+			
83
+			// 	},
84
+			// 	error: function(xhr, type, errorThrown) {
85
+			// 		//异常处理;
86
+			
87
+			// 	}
88
+			// })
89
+		}
61 90
 		mui.plusReady(function() {
62
-			var wv = plus.webview.currentWebview();
63
-			var token = wv.token;
64
-			var id = wv.name;
65
-			mui.ajax(huayi.config.callcenter_url + "Article/GetInfoByTitle", {
66
-				data: {
67
-					title: $('.mui-title').text(),
68
-					token: localStorage.getItem('token')
69
-				},
70
-				dataType: 'json', //服务器返回json格式数据
71
-				type: 'get', //HTTP请求类型
72
-				timeout: 10000, //超时时间设置为10秒;
73
-				headers: {
74
-					'Content-Type': 'application/x-www-form-urlencoded; charset=utf-8'
75
-				},
76
-				success: function(data) {
77
-					if(data.state == "success") {
78
-						$('.mui-title').text(data.data.F_Title);
79
-						$('.content').text(data.data.F_Content);
80
-
81
-					} else {
82
-						mui.toast("数据获取失败。");
83
-					}
84
-
85
-				},
86
-				error: function(xhr, type, errorThrown) {
87
-					//异常处理;
88
-
89
-				}
90
-			})
91
+			
91 92
 
92 93
 		});
93 94
 	</script>

+ 6 - 12
双汇APP-h5/Common/js/Work-list.js

@@ -1,19 +1,15 @@
1 1
 window.onload = function() {
2 2
 
3
-	mui.plusReady(function() {
4 3
 		//var isdeal=helper.request.queryString("isdeal");
5 4
 		var token = localStorage.getItem("token");
6 5
 		var F_RoleId = localStorage.getItem("F_RoleId");
7 6
 		var page = 1; //页数
8 7
 		var pageSize = 10; //每页显示条目
9 8
 		var total; //数据总条数
10
-		var wv = plus.webview.currentWebview();
11
-		var starttime = wv.starttime;;
12
-		var endtime = wv.endtime;;
9
+		var starttime = getQueryString('starttime');
10
+		var endtime = getQueryString('endtime');
13 11
 		var keyw="";
14
-		plus.nativeUI.closeWaiting();
15
-		//显示当前页面
16
-		mui.currentWebview.show();
12
+		
17 13
 		Ajax();
18 14
 		$('.go_search').on('input focus', function() {
19 15
 			keyw = $(this).val();
@@ -31,9 +27,7 @@ window.onload = function() {
31 27
 				}
32 28
 			},
33 29
 			beforeback: function() {
34
-			    var list = plus.webview.currentWebview().opener();    
35
-			    //refresh是A页面自定义事件
36
-			    mui.fire(list, 'refreshPer');
30
+			    
37 31
 			    //返回true,继续页面关闭逻辑
38 32
 			    return true;
39 33
 			}
@@ -185,8 +179,8 @@ window.onload = function() {
185 179
 		$(".exportBtn").on("tap",function (){
186 180
 			var url = huayi.config.callcenter_url + "WorkorderApp/GetList?token=" + token+"&isdc=1";
187 181
 			url+="&starttime=" + starttime + "&endtime=" + endtime
188
-			plus.runtime.openURL(url);
182
+			window.open(url, '_blank');
189 183
 		})
190 184
 
191
-	});
185
+	
192 186
 }

+ 13 - 32
双汇APP-h5/Common/js/repositoryList.js

@@ -1,19 +1,13 @@
1
-mui.plusReady(function() {
1
+window.onload = function () {
2 2
 	//var isdeal=helper.request.queryString("isdeal");
3 3
 	var token = localStorage.getItem("token");
4 4
 	var F_RoleId = localStorage.getItem("F_RoleId");
5 5
 	var page = 1; //页数
6 6
 	var pageSize = 10; //每页显示条目
7 7
 	var total; //数据总条数
8
-	var wv = plus.webview.currentWebview();
9
-	var starttime = wv.starttime;;
10
-	var endtime = wv.endtime;;
11 8
 	var keyw = "";
12 9
 	var pull=false;
13
-	plus.nativeUI.closeWaiting();
14
-	//显示当前页面
15
-	mui.currentWebview.show();
16
-
10
+	
17 11
 	Ajax();
18 12
 	$('.go_search').on('input focus', function() {
19 13
 		keyw = $(this).val();
@@ -33,14 +27,12 @@ mui.plusReady(function() {
33 27
 			}
34 28
 		},
35 29
 		beforeback: function() {
36
-			var list = plus.webview.currentWebview().opener();
37
-			//refresh是A页面自定义事件
38
-			mui.fire(list, 'refreshPer');
30
+			
39 31
 			//返回true,继续页面关闭逻辑
40 32
 			return true;
41 33
 		}
42 34
 	});
43
-
35
+	
44 36
 	function pullupRefresh() {
45 37
 		
46 38
 		setTimeout(function() {
@@ -50,7 +42,7 @@ mui.plusReady(function() {
50 42
 			
51 43
 		}, 1000);
52 44
 	}
53
-
45
+	
54 46
 	function Ajax() {		
55 47
 		if ($("#repositoryResult").attr("data-index")!="") {
56 48
 			//alert($("#repositoryResult").attr("data-index"))
@@ -101,23 +93,12 @@ mui.plusReady(function() {
101 93
 	}
102 94
 	$('#order_list').on('tap', '.order', function() {
103 95
 		var id = $(this).attr('data-index');
96
+		var targetUrl = 'repositorydetail.html?id=' + encodeURIComponent(id);
104 97
 		mui.openWindow({
105 98
 			id: 'repositorydetail',
106
-			url: 'repositorydetail.html',
99
+			url: targetUrl,
107 100
 			createNew: true,
108
-			show: {
109
-				aniShow: 'pop-in'
110
-			},
111
-			styles: {
112
-				popGesture: 'hide'
113
-			},
114
-			waiting: {
115
-				autoShow: true
116
-			},
117
-			extras: {
118
-				name: id,
119
-				token: token
120
-			}
101
+			
121 102
 		});
122 103
 	})
123 104
 	//知识库分类
@@ -135,7 +116,7 @@ mui.plusReady(function() {
135 116
 		}
136 117
 	});
137 118
 	(function($, doc) {
138
-
119
+	
139 120
 		//交办单位
140 121
 		var repositoryPickers = new $.PopPicker({
141 122
 			layer: 2
@@ -144,7 +125,7 @@ mui.plusReady(function() {
144 125
 		var repository = doc.getElementById('repository');
145 126
 		var repositoryResults = doc.getElementById('repositoryResult');
146 127
 		repository.addEventListener('tap', function(event) {
147
-
128
+	
148 129
 			repositoryPickers.show(function(items) {
149 130
 				console.log(items[1].id)
150 131
 				repositoryResults.value = items[1].text;
@@ -154,7 +135,7 @@ mui.plusReady(function() {
154 135
 				//return false;
155 136
 			});
156 137
 		}, false);
157
-
158
-
138
+	
139
+	
159 140
 	})(mui, document);
160
-});
141
+}

+ 45 - 52
双汇APP-h5/Common/js/serch.js

@@ -1,6 +1,5 @@
1 1
 mui.init({})
2
-mui.plusReady(function() {
3
-	
2
+window.onload = function () {
4 3
 	//搜索
5 4
 	$('.submit').on('tap', function() {
6 5
 		var start_data=$("#start_data").val(),end_data=$("#end_data").val(),
@@ -8,66 +7,60 @@ mui.plusReady(function() {
8 7
 		nowData=helper.DateFormat.getNowDate();
9 8
 		starttime = start_data == '' ? preData : start_data;
10 9
 		endtime = end_data =='' ? nowData : end_data;
10
+		
11 11
 		if ((start_data=="" && end_data=="")||(start_data!="" && end_data!="")) {
12
+			var targetUrl = 'listExport.html?starttime=' + encodeURIComponent(starttime) + '&endtime=' + encodeURIComponent(endtime);
12 13
 			mui.openWindow({
13 14
 				id:"listExport",
14
-				url:"listExport.html",
15
+				url:targetUrl,
15 16
 				createNew:true, 
16
-				show: {
17
-					autoShow: false
18
-				},
19
-				waiting: {
20
-					autoShow: true //自动显示等待框,默认为true
21
-				},
22
-				extras: {
23
-					starttime: starttime,
24
-					endtime: endtime
25
-				}
17
+				
26 18
 			})
27 19
 		}else{
28 20
 			alert("请选择正确的时间格式")
29 21
 		}
30
-
31
-	});
32 22
 	
33
-})
34
-(function($) {
35
-	$.init();
36
-	var result = $('#start_data')[0];
37
-	var btns = $('.btn');
38
-	btns.each(function(i, btn) {
39
-		btn.addEventListener('tap', function() {
40
-			
41
-			var optionsJson = this.getAttribute('data-options') || '{}';
42
-			var options = JSON.parse(optionsJson);
43
-			var myDate = new Date();
44
-			options.endYear = myDate.getFullYear()+3
45
-			var id = this.getAttribute('id');
46
-			var picker = new $.DtPicker(options);
47
-			picker.show(function(rs) {
48
-				result.value = rs.text;
49
-				picker.dispose();
50
-			});
51
-		}, false);
52
-	});
53
-	var result1 = $('#end_data')[0];
54
-	var btns1 = $('.btn1');
55
-	btns1.each(function(i, btn) {
56
-		btn.addEventListener('tap', function() {
57
-			var optionsJson = this.getAttribute('data-options') || '{}';
58
-			var options1 = JSON.parse(optionsJson);
59
-			var myDate = new Date();
60
-			options1.endYear = myDate.getFullYear()+3
61
-			var id = this.getAttribute('id');
62
-			var picker = new $.DtPicker(options1);
63
-			picker.show(function(rs) {
64
-				result1.value = rs.text;
65
-				picker.dispose();
66
-			});
67
-		}, false);
68 23
 	});
69
-	
70
-})(mui);
24
+	(function($) {
25
+		$.init();
26
+		var result = $('#start_data')[0];
27
+		var btns = $('.btn');
28
+		btns.each(function(i, btn) {
29
+			btn.addEventListener('tap', function() {
30
+				
31
+				var optionsJson = this.getAttribute('data-options') || '{}';
32
+				var options = JSON.parse(optionsJson);
33
+				var myDate = new Date();
34
+				options.endYear = myDate.getFullYear()+3
35
+				var id = this.getAttribute('id');
36
+				var picker = new $.DtPicker(options);
37
+				picker.show(function(rs) {
38
+					result.value = rs.text;
39
+					picker.dispose();
40
+				});
41
+			}, false);
42
+		});
43
+		var result1 = $('#end_data')[0];
44
+		var btns1 = $('.btn1');
45
+		btns1.each(function(i, btn) {
46
+			btn.addEventListener('tap', function() {
47
+				var optionsJson = this.getAttribute('data-options') || '{}';
48
+				var options1 = JSON.parse(optionsJson);
49
+				var myDate = new Date();
50
+				options1.endYear = myDate.getFullYear()+3
51
+				var id = this.getAttribute('id');
52
+				var picker = new $.DtPicker(options1);
53
+				picker.show(function(rs) {
54
+					result1.value = rs.text;
55
+					picker.dispose();
56
+				});
57
+			}, false);
58
+		});
59
+		
60
+	})(mui);
61
+}
62
+
63
+
71 64
 
72 65
 
73 66
 

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

@@ -40,6 +40,7 @@
40 40
 		<script src="../js/zepto.js"></script>
41 41
 		<script src="../js/huayi.config.js"></script>
42 42
 		<script src="../js/huayi.http.js"></script>
43
+		<script src="../js/utils/index.js"></script>
43 44
 		<script src="js/Work-list.js"></script>
44 45
 		<script src="../js/jquery-1.8.js"></script>
45 46
 	</body>

+ 8 - 7
双汇APP-h5/Common/repositorydetail.html

@@ -90,12 +90,13 @@
90 90
 	<script src="../js/mui.min.js"></script>
91 91
 	<script src="../js/zepto.js"></script>
92 92
 	<script src="../js/huayi.config.js"></script>
93
+	<script src="../js/utils/index.js"></script>
93 94
 	<script>
94 95
 		mui.init();
95
-		mui.plusReady(function() {
96
-			var wv = plus.webview.currentWebview();
97
-			var token = wv.token;
98
-			var id = wv.name;
96
+		window.onload = function () {
97
+			var id = getQueryString('id');
98
+			var token = localStorage.getItem("token");
99
+			console.log(id)
99 100
 			mui.ajax(huayi.config.callcenter_url + 'Knowledge/GetInfo', {
100 101
 				data: {
101 102
 					infoid: id,
@@ -116,11 +117,11 @@
116 117
 				},
117 118
 				error: function(xhr, type, errorThrown) {
118 119
 					//异常处理;
119
-
120
+			
120 121
 				}
121 122
 			})
122
-
123
-		});
123
+		}
124
+		
124 125
 	</script>
125 126
 
126 127
 </html>

+ 38 - 42
双汇APP-h5/js/setting.js

@@ -56,7 +56,7 @@ window.onload = function () {
56 56
 			
57 57
 		});
58 58
 	})
59
-	//用户管理
59
+	//列表导出
60 60
 	$("#listExport").on('tap', function() {
61 61
 		mui.openWindow({
62 62
 			id: 'seach',
@@ -76,61 +76,57 @@ window.onload = function () {
76 76
 	})
77 77
 }
78 78
 
79
-//常见问题
80
-document.getElementById('Question').addEventListener('tap', function() {
81
-	
82
-	var nwaiting = plus.nativeUI.showWaiting();
83
-	webviewShow = plus.webview.create("Common/portrait_head.html"); //后台创建webview并打开show.html  
84
-	webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件  
85
-		nwaiting.close(); //新webview的载入完毕后关闭等待框  
86
-		webviewShow.show("slide-in-right", 300); //把新webview窗体显示出来,显示动画效果为速度300毫秒的右侧移入动画
87
-	}, false);
88
-});
89
-//常见问题
79
+//服务守则
90 80
 document.getElementById('fwsz').addEventListener('tap', function() {
81
+	mui.openWindow({
82
+		id: 'Setting-SZ',
83
+		url: 'Common/Setting-SZ.html',
84
+		createNew: true
85
+	});
91 86
 	
92
-	var nwaiting = plus.nativeUI.showWaiting();
93
-	webviewShow = plus.webview.create("Common/Setting-SZ.html"); //后台创建webview并打开show.html  
94
-	webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件  
95
-		nwaiting.close(); //新webview的载入完毕后关闭等待框  
96
-		webviewShow.show("slide-in-right", 300); //把新webview窗体显示出来,显示动画效果为速度300毫秒的右侧移入动画
97
-	}, false);
98 87
 });
99 88
 
100 89
 //常见问题
101 90
 document.getElementById('Bom').addEventListener('tap', function() {
91
+	mui.openWindow({
92
+		id: 'Setting-Bm',
93
+		url: 'Common/Setting-Bm.html',
94
+		createNew: true
95
+	});
102 96
 	
103
-	var nwaiting = plus.nativeUI.showWaiting();
104
-	webviewShow = plus.webview.create("Common/Setting-Bm.html"); //后台创建webview并打开show.html  
105
-	webviewShow.addEventListener("loaded", function() { //注册新webview的载入完成事件  
106
-		nwaiting.close(); //新webview的载入完毕后关闭等待框  
107
-		webviewShow.show("slide-in-right", 300); //把新webview窗体显示出来,显示动画效果为速度300毫秒的右侧移入动画
108
-	}, false);
109 97
 });
110 98
 
111 99
 
112 100
 //退出
113 101
 document.getElementById('exit').addEventListener('tap', function() {
114
-	var btnArray = [{
115
-		title: "注销当前账号"
116
-	}, {
117
-		title: "直接关闭应用"
118
-	}];
119
-	plus.nativeUI.actionSheet({
120
-		cancel: "取消",
121
-		buttons: btnArray
122
-	}, function(event) {
123
-		var index = event.index;
124
-		switch(index) {
125
-			case 1:
126
-				//注销账号						
127
-				plus.runtime.restart();
128
-				break;
129
-			case 2:
130
-				plus.runtime.quit();
131
-				break;
102
+	mui.confirm('您确定此操作吗?', '登出', ['取消', '注销当前账号'], function(e) {
103
+		if (e.index === 1) {
104
+			logout()
105
+			mui.openWindow({
106
+				id: 'login',
107
+				url: 'login.html',
108
+				createNew: true
109
+			});
110
+		} else {
111
+			mui.toast('点击了取消');
112
+			
132 113
 		}
133 114
 	});
115
+	// plus.nativeUI.actionSheet({
116
+	// 	cancel: "取消",
117
+	// 	buttons: btnArray
118
+	// }, function(event) {
119
+	// 	var index = event.index;
120
+	// 	switch(index) {
121
+	// 		case 1:
122
+	// 			//注销账号						
123
+	// 			plus.runtime.restart();
124
+	// 			break;
125
+	// 		case 2:
126
+	// 			plus.runtime.quit();
127
+	// 			break;
128
+	// 	}
129
+	// });
134 130
 }, false);
135 131
 
136 132
 function logout() {