-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtab-main.html
275 lines (262 loc) · 10.5 KB
/
tab-main.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="Access-Control-Allow-Origin" content="*" />
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
<title></title>
<script src="js/mui.min.js"></script>
<link href="css/mui.min.css" rel="stylesheet"/>
<link href="css/tab-main.css" rel="stylesheet" />
<script type="text/javascript" charset="UTF-8">
mui.init();
</script>
<script type="text/javascript" src="js/jquery-2.1.0.js"></script>
<script type="text/javascript" src="js/tab-main.js"></script>
<script text/javascript>
$(document).ready(function(){
$.ajax({
type:"get",
url:"http://192.168.1.102:8080/beijiao/policy/app_allPolicy",
data:{},
dataType : 'json', // 数据类型配置成json
async:true,
//contentType:"application/json;charset=utf-8",
success : function(data,status){
//alert("完成");
for (var i = 0; i < data.length; i++) {
var policy = "<li class='mui-table-view-cell mui-media'>" +
"<a class='policy' href='policy.html?policyId="+data[i].policyId+"'>"+
"<div class='mui-media-body'>"+
data[i].polSource +
"<p class='mui-ellipsis'>"+data[i].polTitle+"</p>"+
"<span class='time'>"+data[i].polTime+
"</span></div></a></li>"
$("#pol").append(policy);
}
},
error : function(data,status,e){
alert("失败");
}
});
$.ajax({
type:"get",
url:"http://192.168.1.102:8080/beijiao/picpol/allpicPol_app",
data:{},
dataType : 'json', // 数据类型配置成json
async:true,
//contentType:"application/json;charset=utf-8",
success : function(data,status){
var picpol1 = "<div class='mui-slider-item mui-slider-item-duplicate'><a href='policy-img.html?picPolId="+data[0].picPolId+"'>" +
"<img src='http://192.168.1.102:8080/beijiao/"+data[0].picPolFile+"'/></a></div>"
$("#showpicpol").append(picpol1);
for (var i = 1; i < data.length-1; i++) {
var picpol = "<div class='mui-slider-item'><a href='policy-img.html?picPolId="+data[i].picPolId+"'>" +
"<img src='http://192.168.1.102:8080/beijiao/"+data[i].picPolFile+"'/></a></div>"
$("#showpicpol").append(picpol);
}
var picpol2 = "<div class='mui-slider-item mui-slider-item-duplicate'><a href='policy-img.html?picPolId="+data[data.length-1].picPolId+"'>" +
"<img src='http://192.168.1.102:8080/beijiao/"+data[data.length-1].picPolFile+"'/></a></div>"
$("#showpicpol").append(picpol2);
var img_policy = mui('#img_policy');
img_policy.slider({
interval:1000//自动轮播周期,若为0则不自动播放,默认为0;
});
},
error : function(data,status,e){
alert("失败");
}
});
});
//机构选择菜单取值函数
function select_institution(){
var source={"source":$("#institution option:selected").text()};
$.ajax({
type:"get",
url:"http://192.168.1.102:8080/beijiao/policy/app_sourcePolicy",
data:source,
dataType : 'json', // 数据类型配置成json
async:true,
//contentType:"application/json;charset=utf-8",
success : function(data,status){
$("#pol").children().remove()
for (var i = 0; i < data.length; i++) {
var policy = "<li class='mui-table-view-cell mui-media' >" +
"<a class='policy' href='policy.html?policyId="+data[i].policyId+"'>"+
"<div class='mui-media-body'>"+
data[i].polSource +
"<p class='mui-ellipsis'>"+data[i].polTitle+"</p>"+
"<span class='time'>"+data[i].polTime+
"</span></div></a></li>"
$("#pol").append(policy);
console.log('测试时')
}
},
error : function(data,status,e){
alert("失败");
}
});
};
function check(){
var key = event.keyCode;
if (key == 13){
search = {"search":$('#search_policy').val()}
$("#pol").children().remove()
$.ajax({
type:"get",
url:"http://192.168.1.102:8080/beijiao/policy/app_searchPolicy",
data:search,
dataType : 'json', // 数据类型配置成json
async:true,
//contentType:"application/json;charset=utf-8",
success : function(data,status){
for (var i = 0; i < data.length; i++) {
var policy = "<li class='mui-table-view-cell mui-media' >" +
"<a class='policy' href='policy.html?policyId="+data[i].policyId+"'>"+
"<div class='mui-media-body'>"+
data[i].polSource +
"<p class='mui-ellipsis'>"+data[i].polTitle+"</p>"+
"<span class='time'>"+data[i].polTime+
"</span></div></a></li>"
$("#pol").append(policy);
}
},
error : function(data,status,e){
alert("失败");
}
});
}
}
</script>
</head>
<body>
<script type="text/javascript">
mui('body').on('tap','#pol li a',function(){
var href = $(this).attr("href");
mui.openWindow({
url:href,
id:href,
});
});
mui('body').on('tap','#showpicpol div a',function(){
var href = $(this).attr("href");
mui.openWindow({
url:href,
id:href,
});
});
</script>
<!--带侧滑菜单的框架-->
<div id="offCanvasWrapper" class="mui-off-canvas-wrap mui-draggable">
<!-- 菜单容器 -->
<aside id="offCanvasSide" class="mui-off-canvas-left">
<div class="mui-scroll-wrapper">
<div id="sideBar" class="mui-scroll" >
<!-- 菜单具体展示内容 -->
<span id="sideBar_title" >行业选择</span>
<ul id="sideBar_list" class="mui-table-view" >
<li class="mui-table-view-cell">
<a class="mui-navigate-right" id="main">首页</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry" >机械化工</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry">交通汽车</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry">房产建材</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry">服装纺织</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry">IT互联网</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry">文化传媒</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry">医疗</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry">食品</a>
</li>
<li class="mui-table-view-cell">
<a class="mui-navigate-right industry">农林渔牧</a>
</li>
</ul>
</div>
</div>
</aside>
<!-- 主页面容器 -->
<div class="mui-inner-wrap">
<!-- 头部(从左到右:侧滑按钮、标题、搜索框)-->
<header id="head" class="mui-bar mui-bar-nav">
<a href="#offCanvasSide" class="mui-icon mui-action-menu mui-icon-bars mui-pull-left"></a>
<h1 id="head_title" class="mui-title">新政策网</h1>
</header>
<div class="mui-content mui-scroll-wrapper">
<div class="mui-scroll">
<!--导航栏:左侧是区域选择的下拉菜单,右侧是搜索框-->
<div id="nav_wrap">
<div id="nav_left_wrap">
<div id="nav_left">
<form>
<select id="institution" name="发布机构" onchange="select_institution()" style="height: 38px;">
<option value="所有政策">所有政策</option>
<option value="国务院">国务院</option>
<option value="环保部">环保部</option>
<option value="国家食品药品监督管理总局">国家食品药品监督管理总局</option>
<option value="">其他</option>
</select>
</form>
</div>
</div>
<div id="search" class="mui-content">
<div class="mui-input-row mui-search">
<input type="search" class="mui-input-clear" placeholder="查寻政策" id='search_policy' onkeypress="return check()">
</div>
</div>
</div>
<!--图片轮播-->
<div id="img_policy" class="mui-slider">
<div class="mui-slider-group mui-slider-loop" id="showpicpol">
<!--支持循环,需要重复图片节点-->
<!--<div class="mui-slider-item mui-slider-item-duplicate"><a href="policy-img.html"><img src="images/01.jpg" /></a></div>
<div class="mui-slider-item"><a href="policy-img.html"><img src="images/02.jpg" /></a></div>
<div class="mui-slider-item"><a href="policy-img.html"><img src="images/01.jpg" /></a></div>
<div class="mui-slider-item"><a href="policy-img.html"><img src="images/02.jpg" /></a></div>-->
<!--支持循环,需要重复图片节点-->
<!--<div class="mui-slider-item mui-slider-item-duplicate"><a href="#"><img src="images/01.jpg" /></a></div>-->
</div>
</div>
<!--消息列表-->
<div id="policy_list">
<ul class="mui-table-view" id="pol">
<!--<li class="mui-table-view-cell mui-media">
<a href="javascript:;">
<div class="mui-media-body">
国务院
<p class='mui-ellipsis'>工商总局召开贯彻落实“证照分离”改革试点工作媒体通气会</p>
<span class="time">2017-11-15</span>
</div>
</a>
</li>
<li class="mui-table-view-cell mui-media">
<a href="javascript:;">
<div class="mui-media-body">
国务院
<p class='mui-ellipsis'>工商总局召开贯彻落实“证照分离”改革试点工作媒体通气会</p>
<span class="time">2017-11-15</span>
</div>
</a>
</li>-->
</ul>
</div>
</div>
</div>
</div>
</div>
</body>
</html>