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
d081895d
authored
2021-01-08 10:40:34 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:新闻
1 parent
09694f59
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
6 deletions
staticJs/pageHome.js
staticJs/pageHome.js
View file @
d081895
...
...
@@ -68,8 +68,13 @@ function NewsData() {
url
:
portal
.
api_url
+
"/portal/MhNews/getNewsList"
,
//路径
dataType
:
"json"
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
if
(
result
.
data
[
0
].
preViewUrl
)
{
$
(
'.news-img img'
).
attr
(
'src'
,
result
.
data
[
0
].
preViewUrl
);
}
else
{
$
(
'.news-img img'
).
attr
(
'src'
,
'./staticImages/news_demo.jpg'
);
}
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
if
(
i
==
6
)
return
;
publishTime
=
CutDate
(
result
.
data
[
i
].
publishTime
);
...
...
@@ -86,11 +91,6 @@ function NewsData() {
li
+=
'<span>'
+
publishTime
+
'</span></a></li>'
;
ulNews
.
append
(
li
);
}
if
(
result
.
data
[
0
].
preViewUrl
)
{
$
(
'.news-img img'
).
attr
(
'src'
,
result
.
data
[
0
].
preViewUrl
);
}
else
{
$
(
'.news-img img'
).
attr
(
'src'
,
'./staticImages/news_demo.jpg'
);
}
}
}
});
...
...
Please
register
or
sign in
to post a comment