Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
任超
/
js.portalStaticPage
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
afdb2759
authored
2020-11-27 18:02:30 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:法律法规
1 parent
e7eee81f
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
271 additions
and
41 deletions
staticCss/flfg.css
staticJs/flfg.js
staticJs/flfgxq.js
staticJs/sfrz.js
staticViews/flfg.html
staticViews/flfgxq.html
staticCss/flfg.css
View file @
afdb275
...
...
@@ -25,7 +25,7 @@
display
:
inline-block
;
font-size
:
20px
;
color
:
#4a4a4a
;
width
:
8
5
%
;
width
:
8
2
%
;
white-space
:
nowrap
;
overflow
:
hidden
;
text-overflow
:
ellipsis
;
...
...
staticJs/flfg.js
View file @
afdb275
...
...
@@ -3,13 +3,116 @@ $(function () {
let
element
=
layui
.
element
;
});
addTabs
(
'#zwgk'
)
layui
.
use
(
'laypage'
,
function
()
{
var
laypage
=
layui
.
laypage
;
//执行一个laypage实例
laypage
.
render
({
elem
:
'page'
//注意,这里的 test1 是 ID,不用加 # 号
,
count
:
50
//数据总数,从服务端得到
});
getLawsArticleList
()
getPolicyHotArticleList
()
HotArticle
()
})
// 获取法律法规列表数据
function
getLawsArticleList
()
{
var
flfgList
=
$
(
"#flfgList"
);
flfgList
.
empty
();
var
li
=
''
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/MhLaws/getLawsArticleList"
,
//路径
dataType
:
"json"
,
async
:
false
,
data
:
{
"currentPage"
:
data
.
currentPage
,
"pageSize"
:
data
.
pageSize
},
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
data
.
total
=
result
.
data
.
total
for
(
var
i
=
0
;
i
<
result
.
data
.
records
.
length
;
i
++
)
{
li
=
'<li>'
;
li
+=
'<a href="./flfgxq.html?id='
+
result
.
data
.
records
[
i
].
id
+
'" title="'
+
result
.
data
.
records
[
i
].
headline
+
'" target="_blank">'
li
+=
'<p>'
+
result
.
data
.
records
[
i
].
headline
+
'</p>'
;
li
+=
'<span>'
+
result
.
data
.
records
[
i
].
deadtime
+
'</span>'
;
li
+=
'</a>'
;
li
+=
'</li>'
;
flfgList
.
append
(
li
);
}
}
}
})
}
// 相应政策推荐
function
getPolicyHotArticleList
()
{
var
policy_list_con
=
$
(
".policy_list_con"
);
policy_list_con
.
empty
();
var
li
=
''
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/MhPolicy/getPolicyHotArticleList"
,
//路径
dataType
:
"json"
,
async
:
false
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
li
=
'<li>'
li
+=
'<h3>'
+
result
.
data
[
i
].
headline
+
'</h3>'
li
+=
'<p class="recommend_con">'
+
result
.
data
[
i
].
summary
+
'</p>'
li
+=
'<p class="recommend_date">'
+
result
.
data
[
i
].
deadtime
+
'</p>'
li
+=
'</li>'
policy_list_con
.
append
(
li
);
}
}
}
})
}
// 获取新闻动态的推荐数据
function
HotArticle
()
{
var
news_list_con
=
$
(
".news_list_con"
);
news_list_con
.
empty
();
var
li
=
''
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/MhNews/getNewsHotArticleList"
,
//路径
dataType
:
"json"
,
async
:
false
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
li
=
'<li>'
;
li
+=
'<img src="'
+
result
.
data
[
i
].
cover
+
'">'
;
li
+=
'<h3>'
+
result
.
data
[
i
].
headline
+
'</h3>'
;
li
+=
'<p class="recommend_date">'
+
result
.
data
[
i
].
deadtime
+
'</p>'
;
li
+=
'</li>'
;
news_list_con
.
append
(
li
);
}
}
}
})
}
layui
.
use
(
'laypage'
,
function
()
{
var
laypage
=
layui
.
laypage
;
//执行一个laypage实例
laypage
.
render
({
elem
:
'page'
//注意,这里的 test1 是 ID,不用加 # 号
,
count
:
data
.
total
//数据总数,从服务端得到
,
limit
:
data
.
pageSize
,
prev
:
'<'
,
next
:
'>'
,
theme
:
'#0091FF'
,
jump
:
function
(
obj
,
first
)
{
data
.
currentPage
=
obj
.
curr
getLawsArticleList
();
}
});
})
\ No newline at end of file
});
var
data
=
{
//数据
"list"
:
[],
total
:
undefined
,
currentPage
:
1
,
pageSize
:
5
};
\ No newline at end of file
...
...
staticJs/flfgxq.js
0 → 100644
View file @
afdb275
$
(
function
()
{
let
Mydate
=
new
Date
()
let
year
=
Mydate
.
getFullYear
();
let
minutes
=
Mydate
.
getMinutes
()
let
hour
=
Mydate
.
getHours
();
let
date
=
Mydate
.
getDate
()
let
month
=
Mydate
.
getMonth
();
$
(
'.date div:first-child'
).
text
(
year
)
$
(
'.date div:nth-child(2)'
).
text
(
month
+
1
+
"/"
+
date
)
$
(
'.date div:last-child'
).
text
(
hour
+
":"
+
minutes
)
LawsData
()
HotArticle
();
PolicyHotArticle
();
})
// 新闻详情数据
function
LawsData
()
{
var
newsList
=
$
(
"#newsList"
);
newsList
.
empty
();
var
li
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/MhNews/getDetailById"
,
//路径
data
:{
"id"
:
GetQueryString
(
'id'
),
},
dataType
:
"json"
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
console
.
log
(
999
,
result
.
data
)
$
(
'.newsTitle'
).
html
(
result
.
data
.
title
)
newsList
.
append
(
result
.
data
.
content
)
}
}
});
}
// 获取新闻动态的推荐数据
function
HotArticle
()
{
var
recommend
=
$
(
"#news_recommendation"
);
recommend
.
empty
();
var
li
=
''
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/MhNews/getNewsHotArticleList"
,
//路径
dataType
:
"json"
,
async
:
false
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
li
=
'<li class="tj">'
;
li
+=
'<img src="'
+
result
.
data
[
i
].
cover
+
'">'
;
li
+=
'<span class="tj-title">'
+
result
.
data
[
i
].
headline
+
'</span>'
;
li
+=
'<span class="tj-date">'
+
result
.
data
[
i
].
deadtime
+
'</span>'
;
li
+=
'</li>'
;
recommend
.
append
(
li
);
}
}
}
})
}
// 政策法规推荐
function
PolicyHotArticle
()
{
var
regulation
=
$
(
"#regulation"
);
regulation
.
empty
();
var
li
=
''
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/MhPolicy/getPolicyHotArticleList"
,
//路径
dataType
:
"json"
,
async
:
false
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
li
=
'<li class="zcfg">'
li
+=
'<div class="zcfg-top">'
+
result
.
data
[
i
].
headline
+
'</div>'
li
+=
'<p class="zcfg-body">'
+
result
.
data
[
i
].
summary
+
'</p>'
li
+=
'<div class="zcfg-bottom">'
+
result
.
data
[
i
].
deadtime
+
'</div>'
li
+=
'</li>'
regulation
.
append
(
li
);
}
}
}
})
}
$
(
window
).
scroll
(
function
()
{
let
juli
=
$
(
document
).
scrollTop
();
if
(
juli
>
360
)
{
$
(
'.left-left'
).
addClass
(
'middle_active'
);
}
else
{
$
(
'.left-left'
).
removeClass
(
'middle_active'
);
}
})
layui
.
use
(
'element'
,
function
()
{
var
element
=
layui
.
element
;
//导航的hover效果、二级菜单等功能,需要依赖element模块
//监听导航点击
element
.
on
(
'nav(demo)'
,
function
(
elem
)
{
layer
.
msg
(
elem
.
text
());
});
});
function
GetQueryString
(
name
)
{
var
reg
=
new
RegExp
(
"(^|&)"
+
name
+
"=([^&]*)(&|$)"
);
var
r
=
window
.
location
.
search
.
substr
(
1
).
match
(
reg
);
if
(
r
!=
null
)
return
decodeURIComponent
(
r
[
2
]);
return
null
;
}
\ No newline at end of file
staticJs/sfrz.js
View file @
afdb275
...
...
@@ -53,22 +53,20 @@ $(function () {
});
});
// ////
Webcam
.
set
({
width
:
320
,
height
:
240
,
image_format
:
'jpeg'
,
jpeg_quality
:
90
});
Webcam
.
attach
(
'#my_camera'
);
function
take_snapshot
()
{
// take snapshot and get image data
Webcam
.
snap
(
function
(
data_uri
)
{
// display results in page
document
.
getElementById
(
'results'
).
innerHTML
=
'<h2>Here is your image:</h2>'
+
'<img src="'
+
data_uri
+
'"/>'
;
}
);
}
Webcam
.
attach
(
'#my_camera'
);
})
function
take_snapshot
()
{
// take snapshot and get image data
Webcam
.
snap
(
function
(
data_uri
)
{
// display results in page
document
.
getElementById
(
'results'
).
innerHTML
=
'<h2>Here is your image:</h2>'
+
'<img src="'
+
data_uri
+
'"/>'
;
});
}
...
...
staticViews/flfg.html
View file @
afdb275
...
...
@@ -22,35 +22,19 @@
</div>
<div
class=
"laws_regulations"
>
<div
class=
"item_list"
>
<ul>
<li>
<p>
中华人民共和国物权法
</p>
<span>
2020-10-26
</span>
</li>
<ul
id=
"flfgList"
>
</ul>
<div
id=
"page"
></div>
</div>
<div
class=
"recommend_list"
>
<ul
class=
"policy_list"
>
<h2>
相应政策
</h2>
<div
class=
"policy_list_con"
>
<li>
<h3>
爬山虎国土空间规划信息化解决
</h3>
<p
class=
"recommend_con"
>
10月21日,农业农村部举行新闻发布会,
</p>
<p
class=
"recommend_date"
>
2018-12-19
</p>
</li>
</div>
<div
class=
"policy_list_con"
></div>
</ul>
<ul
class=
"news_list"
>
<h2>
新闻推荐
</h2>
<div
class=
"news_list_con"
>
<li>
<img
src=
"../staticImages/news_demo.jpg"
alt=
""
>
<h3>
爬山虎国土空间规划信息化解决
</h3>
<p
class=
"recommend_date"
>
2018-12-19
</p>
</li>
</div>
<div
class=
"news_list_con"
></div>
</ul>
</div>
</div>
...
...
staticViews/flfgxq.html
0 → 100644
View file @
afdb275
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html
xmlns=
"http://www.w3.org/1999/xhtml"
>
<head>
<style>
</style>
<meta
http-equiv=
"Content-Type"
content=
"text/html; charset=utf-8"
/>
<title>
法律法规详情
</title>
<script
type=
"text/javascript"
src=
"../staticJs/head.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"../staticCss/ggxq.css"
>
</head>
<body>
<div
class=
"navigation_crumbs"
>
<div
class=
"contentBox"
>
<span
class=
"layui-breadcrumb"
>
<a
href=
"../index.html"
>
首页
</a>
<a
href=
""
>
法律法规
</a>
<a><cite>
法律法规详情
</cite></a>
</span>
</div>
</div>
<div
class=
"mainbody"
>
<div
class=
"title newsTitle"
></div>
<div
class=
"release"
>
<div>
发布单位:国土信息
</div>
<div>
发布日期:
<p
class=
"releaseTime"
>
2020-20-15
</p></div>
</div>
<div
class=
"DividingLine"
></div>
<div
class=
"notice_content"
id=
"newsDetail"
>
</div>
</div>
</body>
<script
type=
"text/javascript"
src=
"../staticJs/common.js"
></script>
<script
type=
"text/javascript"
src=
"../staticJs/down.js"
></script>
<script
type=
"text/javascript"
src=
"../staticJs/ggxq.js"
></script>
</html>
\ No newline at end of file
Please
register
or
sign in
to post a comment