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
fb3d5c65
authored
2020-11-21 14:55:46 +0800
by
田浩浩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改首页数据加载内容
1 parent
27d58361
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
3 deletions
index.html
staticJs/pageHome.js
index.html
View file @
fb3d5c6
...
...
@@ -258,7 +258,7 @@
<i>
查看全部 >
</i>
</a>
</h2>
<ul
class=
"laws_list"
>
<ul
class=
"laws_list"
id=
"ulLaws"
>
<li>
<a
href=
""
title=
"基础问题基础问题基础问题基础问题基"
>
基础问题基础问题基础问题基础问题基础问题基础问题基础问题基础问题基础问题基础问题基础问题基础问题
...
...
staticJs/pageHome.js
View file @
fb3d5c6
...
...
@@ -45,8 +45,6 @@ function getDate() {
data
.
push
(
Math
.
round
((
Math
.
random
()
-
0.5
)
*
20
+
data
[
i
-
1
]));
}
return
date
.
reverse
();
// var newdate = date.reverse(); //往后一周的话需要将数组倒叙
//console.log(date);
}
//初始化方法
...
...
@@ -55,6 +53,7 @@ $(function () {
recentlyDay
=
getDate
();
NewsData
();
NoticeData
();
LawsData
();
});
//加载新闻数据
...
...
@@ -116,3 +115,27 @@ function NoticeData() {
}
});
}
//加载法律法规数据
function
LawsData
()
{
var
ulTag
=
$
(
"#ulLaws"
);
ulTag
.
empty
();
var
li
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/Mh/getLawsList"
,
//路径
dataType
:
"json"
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
if
(
i
==
6
)
return
;
li
=
'<li><a href="#" title="'
+
result
.
data
[
i
].
headline
+
'">'
+
result
.
data
[
i
].
headline
;
li
+=
'</a></li>'
;
ulTag
.
append
(
li
);
}
}
}
});
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment