style:相应政策页面的完成
Showing
4 changed files
with
80 additions
and
5 deletions
... | @@ -133,7 +133,7 @@ function LawsData() { | ... | @@ -133,7 +133,7 @@ function LawsData() { |
133 | if (result.code == 200 && result.data != null) { | 133 | if (result.code == 200 && result.data != null) { |
134 | for (var i = 0; i < result.data.length; i++) { | 134 | for (var i = 0; i < result.data.length; i++) { |
135 | if (i == 6) return; | 135 | if (i == 6) return; |
136 | li = '<li><a href="#" title="' + result.data[i].headline + '">'+ result.data[i].headline; | 136 | li = '<li><a href="./staticViews/flfgxq.html?id='+result.data[i].id+'" title="' + result.data[i].headline + '" target="_blank">'+ result.data[i].headline; |
137 | li += '</a></li>'; | 137 | li += '</a></li>'; |
138 | ulTag.append(li); | 138 | ulTag.append(li); |
139 | } | 139 | } |
... | @@ -155,7 +155,7 @@ function policiesData() { | ... | @@ -155,7 +155,7 @@ function policiesData() { |
155 | if (result.code == 200 && result.data != null) { | 155 | if (result.code == 200 && result.data != null) { |
156 | for (var i = 0; i < result.data.length; i++) { | 156 | for (var i = 0; i < result.data.length; i++) { |
157 | if (i == 6) return; | 157 | if (i == 6) return; |
158 | li = '<li><a href="#" title="' + result.data[i].headline + '">'+ result.data[i].headline; | 158 | li = '<li><a href="./staticViews/xyzcxq.html?id='+result.data[i].id+'" title="' + result.data[i].headline + '" target="_blank">'+ result.data[i].headline; |
159 | li += '</a></li>'; | 159 | li += '</a></li>'; |
160 | policies.append(li); | 160 | policies.append(li); |
161 | } | 161 | } | ... | ... |
... | @@ -8,14 +8,14 @@ $(function () { | ... | @@ -8,14 +8,14 @@ $(function () { |
8 | HotArticle() | 8 | HotArticle() |
9 | }) | 9 | }) |
10 | 10 | ||
11 | // 获取法律法规列表数据 | 11 | // 获取相应政策表数据 |
12 | function getLawsArticleList() { | 12 | function getLawsArticleList() { |
13 | var flfgList = $("#flfgList"); | 13 | var flfgList = $("#flfgList"); |
14 | flfgList.empty(); | 14 | flfgList.empty(); |
15 | var li = ''; | 15 | var li = ''; |
16 | $.ajax({ | 16 | $.ajax({ |
17 | type: "get", //提交方式 | 17 | type: "get", //提交方式 |
18 | url: portal.api_url + "/hlwj/MhLaws/getLawsArticleList",//路径 | 18 | url: portal.api_url + "/hlwj/MhPolicy/getPolicyArticleList",//路径 |
19 | dataType: "json", | 19 | dataType: "json", |
20 | async: false, | 20 | async: false, |
21 | data: { | 21 | data: { |
... | @@ -28,7 +28,7 @@ function getLawsArticleList() { | ... | @@ -28,7 +28,7 @@ function getLawsArticleList() { |
28 | data.total = result.data.total | 28 | data.total = result.data.total |
29 | for (var i = 0; i < result.data.records.length; i++) { | 29 | for (var i = 0; i < result.data.records.length; i++) { |
30 | li = '<li>'; | 30 | li = '<li>'; |
31 | li += '<a href="./flfgxq.html?id='+result.data.records[i].id+'" title="' + result.data.records[i].headline + '" target="_blank">' | 31 | li += '<a href="./xyzcxq.html?id='+result.data.records[i].id+'" title="' + result.data.records[i].headline + '" target="_blank">' |
32 | li += '<p>' + result.data.records[i].headline + '</p>'; | 32 | li += '<p>' + result.data.records[i].headline + '</p>'; |
33 | li += '<span>' + result.data.records[i].deadtime + '</span>'; | 33 | li += '<span>' + result.data.records[i].deadtime + '</span>'; |
34 | li += '</a>'; | 34 | li += '</a>'; | ... | ... |
staticJs/xyzcxq.js
0 → 100644
1 | $(function () { | ||
2 | newsDetail() | ||
3 | }) | ||
4 | |||
5 | layui.use('element', function () { | ||
6 | var element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块 | ||
7 | //监听导航点击 | ||
8 | element.on('nav(demo)', function (elem) { | ||
9 | }); | ||
10 | }); | ||
11 | // 新闻详情数据 | ||
12 | function newsDetail() { | ||
13 | var newsDetail = $("#newsDetail"); | ||
14 | newsDetail.empty(); | ||
15 | $.ajax({ | ||
16 | type: "get", //提交方式 | ||
17 | url: portal.api_url + "/hlwj/MhNews/getDetailById",//路径 | ||
18 | data: { | ||
19 | "id": GetQueryString('id'), | ||
20 | }, | ||
21 | dataType: "json", | ||
22 | //数据,这里使用的是Json格式进行传输 | ||
23 | success: function (result) {//返回数据根据结果进行相应的处理 | ||
24 | if (result.code == 200 && result.data != null) { | ||
25 | $('.newsTitle').html(result.data.title) | ||
26 | $('.releaseTime').html(result.data.addtime) | ||
27 | $('.source').html(result.data.source) | ||
28 | newsDetail.append(result.data.content) | ||
29 | } | ||
30 | } | ||
31 | }); | ||
32 | } | ||
33 | |||
34 | function GetQueryString(name) { | ||
35 | var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); | ||
36 | var r = window.location.search.substr(1).match(reg); | ||
37 | if (r != null) return decodeURIComponent(r[2]); | ||
38 | return null; | ||
39 | } | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
staticViews/xyzcxq.html
0 → 100644
1 | <!DOCTYPE html | ||
2 | PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | ||
3 | <html xmlns="http://www.w3.org/1999/xhtml"> | ||
4 | <head> | ||
5 | <style> | ||
6 | </style> | ||
7 | <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
8 | <title>相应政策详情</title> | ||
9 | <script type="text/javascript" src="../staticJs/head.js"></script> | ||
10 | <link rel="stylesheet" type="text/css" href="../staticCss/ggxq.css"> | ||
11 | </head> | ||
12 | <body> | ||
13 | <div class="navigation_crumbs"> | ||
14 | <div class="contentBox"> | ||
15 | <span class="layui-breadcrumb"> | ||
16 | <a href="../index.html">首页</a> | ||
17 | <a href="">法律法规</a> | ||
18 | <a><cite>相应政策详情</cite></a> | ||
19 | </span> | ||
20 | </div> | ||
21 | </div> | ||
22 | <div class="mainbody"> | ||
23 | <div class="title newsTitle"></div> | ||
24 | <div class="release"> | ||
25 | <div class="source"></div> | ||
26 | <div>发布日期:<p class="releaseTime"></p></div> | ||
27 | </div> | ||
28 | <div class="DividingLine"></div> | ||
29 | <div class="notice_content" id="newsDetail"> | ||
30 | </div> | ||
31 | </div> | ||
32 | </body> | ||
33 | <script type="text/javascript" src="../staticJs/common.js"></script> | ||
34 | <script type="text/javascript" src="../staticJs/down.js"></script> | ||
35 | <script type="text/javascript" src="../staticJs/xyzcxq.js"></script> | ||
36 | </html> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
-
Please register or sign in to post a comment