afdb2759 by 任超

style:法律法规

1 parent e7eee81f
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
25 display: inline-block; 25 display: inline-block;
26 font-size: 20px; 26 font-size: 20px;
27 color: #4a4a4a; 27 color: #4a4a4a;
28 width: 85%; 28 width: 82%;
29 white-space:nowrap; 29 white-space:nowrap;
30 overflow:hidden; 30 overflow:hidden;
31 text-overflow:ellipsis; 31 text-overflow:ellipsis;
......
...@@ -3,13 +3,116 @@ $(function () { ...@@ -3,13 +3,116 @@ $(function () {
3 let element = layui.element; 3 let element = layui.element;
4 }); 4 });
5 addTabs('#zwgk') 5 addTabs('#zwgk')
6 layui.use('laypage', function () { 6 getLawsArticleList()
7 var laypage = layui.laypage; 7 getPolicyHotArticleList()
8 HotArticle()
9 })
10
11 // 获取法律法规列表数据
12 function getLawsArticleList() {
13 var flfgList = $("#flfgList");
14 flfgList.empty();
15 var li = '';
16 $.ajax({
17 type: "get", //提交方式
18 url: portal.api_url + "/hlwj/MhLaws/getLawsArticleList",//路径
19 dataType: "json",
20 async: false,
21 data: {
22 "currentPage": data.currentPage,
23 "pageSize": data.pageSize
24 },
25 //数据,这里使用的是Json格式进行传输
26 success: function (result) {//返回数据根据结果进行相应的处理
27 if (result.code == 200 && result.data != null) {
28 data.total = result.data.total
29 for (var i = 0; i < result.data.records.length; i++) {
30 li = '<li>';
31 li += '<a href="./flfgxq.html?id='+result.data.records[i].id+'" title="' + result.data.records[i].headline + '" target="_blank">'
32 li += '<p>' + result.data.records[i].headline + '</p>';
33 li += '<span>' + result.data.records[i].deadtime + '</span>';
34 li += '</a>';
35 li += '</li>';
36 flfgList.append(li);
37 }
38 }
39 }
40
41 })
42 }
43
44 // 相应政策推荐
45 function getPolicyHotArticleList() {
46 var policy_list_con = $(".policy_list_con");
47 policy_list_con.empty();
48 var li = '';
49 $.ajax({
50 type: "get", //提交方式
51 url: portal.api_url + "/hlwj/MhPolicy/getPolicyHotArticleList",//路径
52 dataType: "json",
53 async: false,
54 //数据,这里使用的是Json格式进行传输
55 success: function (result) {//返回数据根据结果进行相应的处理
56 if (result.code == 200 && result.data != null) {
57 for (var i = 0; i < result.data.length; i++) {
58 li = '<li>'
59 li += '<h3>'+result.data[i].headline+'</h3>'
60 li += '<p class="recommend_con">'+result.data[i].summary+'</p>'
61 li += '<p class="recommend_date">'+result.data[i].deadtime+'</p>'
62 li += '</li>'
63 policy_list_con.append(li);
64 }
65 }
66 }
67 })
68 }
69 // 获取新闻动态的推荐数据
70 function HotArticle() {
71 var news_list_con = $(".news_list_con");
72 news_list_con.empty();
73 var li = '';
74 $.ajax({
75 type: "get", //提交方式
76 url: portal.api_url + "/hlwj/MhNews/getNewsHotArticleList",//路径
77 dataType: "json",
78 async: false,
79 //数据,这里使用的是Json格式进行传输
80 success: function (result) {//返回数据根据结果进行相应的处理
81 if (result.code == 200 && result.data != null) {
82 for (var i = 0; i < result.data.length; i++) {
83 li = '<li>';
84 li += '<img src="' + result.data[i].cover + '">';
85 li += '<h3>'+result.data[i].headline+'</h3>';
86 li += '<p class="recommend_date">'+result.data[i].deadtime+'</p>';
87 li += '</li>';
88 news_list_con.append(li);
89 }
90 }
91 }
92 })
93 }
8 94
95
96
97 layui.use('laypage', function () {
98 var laypage = layui.laypage;
9 //执行一个laypage实例 99 //执行一个laypage实例
10 laypage.render({ 100 laypage.render({
11 elem: 'page' //注意,这里的 test1 是 ID,不用加 # 号 101 elem: 'page' //注意,这里的 test1 是 ID,不用加 # 号
12 , count: 50 //数据总数,从服务端得到 102 , count: data.total //数据总数,从服务端得到
103 , limit: data.pageSize
104 , prev: '<'
105 , next: '>'
106 , theme: '#0091FF'
107 , jump: function (obj, first) {
108 data.currentPage = obj.curr
109 getLawsArticleList();
110 }
13 }); 111 });
14 });
15 })
...\ No newline at end of file ...\ No newline at end of file
112 });
113 var data = { //数据
114 "list": [],
115 total: undefined,
116 currentPage: 1,
117 pageSize: 5
118 };
...\ No newline at end of file ...\ No newline at end of file
......
1 $(function () {
2 let Mydate = new Date()
3 let year = Mydate.getFullYear();
4 let minutes = Mydate.getMinutes()
5 let hour = Mydate.getHours();
6 let date = Mydate.getDate()
7 let month = Mydate.getMonth();
8 $('.date div:first-child').text(year)
9 $('.date div:nth-child(2)').text(month + 1 + "/" + date)
10 $('.date div:last-child').text(hour + ":" + minutes)
11 LawsData()
12 HotArticle();
13 PolicyHotArticle();
14 })
15 // 新闻详情数据
16 function LawsData() {
17 var newsList = $("#newsList");
18 newsList.empty();
19 var li;
20 $.ajax({
21 type: "get", //提交方式
22 url: portal.api_url + "/hlwj/MhNews/getDetailById",//路径
23 data:{
24 "id":GetQueryString('id'),
25 },
26 dataType: "json",
27 //数据,这里使用的是Json格式进行传输
28 success: function (result) {//返回数据根据结果进行相应的处理
29 if (result.code == 200 && result.data != null) {
30 console.log(999,result.data)
31 $('.newsTitle').html(result.data.title)
32 newsList.append(result.data.content)
33 }
34 }
35 });
36 }
37
38 // 获取新闻动态的推荐数据
39 function HotArticle() {
40 var recommend = $("#news_recommendation");
41 recommend.empty();
42 var li = '';
43 $.ajax({
44 type: "get", //提交方式
45 url: portal.api_url + "/hlwj/MhNews/getNewsHotArticleList",//路径
46 dataType: "json",
47 async: false,
48 //数据,这里使用的是Json格式进行传输
49 success: function (result) {//返回数据根据结果进行相应的处理
50 if (result.code == 200 && result.data != null) {
51 for (var i = 0; i < result.data.length; i++) {
52 li = '<li class="tj">';
53 li += '<img src="' + result.data[i].cover + '">';
54 li += '<span class="tj-title">'+result.data[i].headline+'</span>';
55 li += '<span class="tj-date">'+result.data[i].deadtime+'</span>';
56 li += '</li>';
57 recommend.append(li);
58 }
59 }
60 }
61 })
62 }
63 // 政策法规推荐
64 function PolicyHotArticle() {
65 var regulation = $("#regulation");
66 regulation.empty();
67 var li = '';
68 $.ajax({
69 type: "get", //提交方式
70 url: portal.api_url + "/hlwj/MhPolicy/getPolicyHotArticleList",//路径
71 dataType: "json",
72 async: false,
73 //数据,这里使用的是Json格式进行传输
74 success: function (result) {//返回数据根据结果进行相应的处理
75 if (result.code == 200 && result.data != null) {
76 for (var i = 0; i < result.data.length; i++) {
77 li = '<li class="zcfg">'
78 li += '<div class="zcfg-top">'+result.data[i].headline+'</div>'
79 li += '<p class="zcfg-body">'+result.data[i].summary+'</p>'
80 li += '<div class="zcfg-bottom">'+result.data[i].deadtime+'</div>'
81 li += '</li>'
82 regulation.append(li);
83 }
84 }
85 }
86 })
87 }
88
89 $(window).scroll(function () {
90 let juli = $(document).scrollTop();
91 if (juli > 360) {
92 $('.left-left').addClass('middle_active');
93 } else {
94 $('.left-left').removeClass('middle_active');
95 }
96 })
97 layui.use('element', function () {
98 var element = layui.element; //导航的hover效果、二级菜单等功能,需要依赖element模块
99 //监听导航点击
100 element.on('nav(demo)', function (elem) {
101 layer.msg(elem.text());
102 });
103 });
104 function GetQueryString(name) {
105 var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)");
106 var r = window.location.search.substr(1).match(reg);
107 if (r != null) return decodeURIComponent(r[2]);
108 return null;
109 }
...\ No newline at end of file ...\ No newline at end of file
...@@ -53,22 +53,20 @@ $(function () { ...@@ -53,22 +53,20 @@ $(function () {
53 }); 53 });
54 }); 54 });
55 55
56
57 // ////
58 Webcam.set({ 56 Webcam.set({
59 width: 320, 57 width: 320,
60 height: 240, 58 height: 240,
61 image_format: 'jpeg', 59 image_format: 'jpeg',
62 jpeg_quality: 90 60 jpeg_quality: 90
63 }); 61 });
64 Webcam.attach( '#my_camera' ); 62 Webcam.attach('#my_camera');
65 function take_snapshot() { 63 })
64 function take_snapshot() {
66 // take snapshot and get image data 65 // take snapshot and get image data
67 Webcam.snap( function(data_uri) { 66 Webcam.snap(function (data_uri) {
68 // display results in page 67 // display results in page
69 document.getElementById('results').innerHTML = 68 document.getElementById('results').innerHTML =
70 '<h2>Here is your image:</h2>' + 69 '<h2>Here is your image:</h2>' +
71 '<img src="'+data_uri+'"/>'; 70 '<img src="' + data_uri + '"/>';
72 } ); 71 });
73 } 72 }
74 })
......
...@@ -22,35 +22,19 @@ ...@@ -22,35 +22,19 @@
22 </div> 22 </div>
23 <div class="laws_regulations"> 23 <div class="laws_regulations">
24 <div class="item_list"> 24 <div class="item_list">
25 <ul> 25 <ul id="flfgList">
26 <li>
27 <p>中华人民共和国物权法</p>
28 <span>2020-10-26</span>
29 </li>
30 </ul> 26 </ul>
31 <div id="page"></div> 27 <div id="page"></div>
32 </div> 28 </div>
33 <div class="recommend_list"> 29 <div class="recommend_list">
34 <ul class="policy_list"> 30 <ul class="policy_list">
35 <h2>相应政策</h2> 31 <h2>相应政策</h2>
36 <div class="policy_list_con"> 32 <div class="policy_list_con"></div>
37 <li>
38 <h3>爬山虎国土空间规划信息化解决</h3>
39 <p class="recommend_con">10月21日,农业农村部举行新闻发布会,</p>
40 <p class="recommend_date">2018-12-19</p>
41 </li>
42 </div>
43 </ul> 33 </ul>
44 34
45 <ul class="news_list"> 35 <ul class="news_list">
46 <h2>新闻推荐</h2> 36 <h2>新闻推荐</h2>
47 <div class="news_list_con"> 37 <div class="news_list_con"></div>
48 <li>
49 <img src="../staticImages/news_demo.jpg" alt="">
50 <h3>爬山虎国土空间规划信息化解决</h3>
51 <p class="recommend_date">2018-12-19</p>
52 </li>
53 </div>
54 </ul> 38 </ul>
55 </div> 39 </div>
56 </div> 40 </div>
......
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>发布单位:国土信息</div>
26 <div>发布日期:<p class="releaseTime">2020-20-15</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/ggxq.js"></script>
36 </html>
...\ No newline at end of file ...\ No newline at end of file