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
947047e5
authored
2020-11-21 16:57:57 +0800
by
田浩浩
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加新闻页读取
1 parent
fb3d5c65
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
139 deletions
staticJs/xwdt.js
staticViews/xwdt.html
staticJs/xwdt.js
View file @
947047e
...
...
@@ -18,5 +18,38 @@ $(function () {
,
theme
:
'#0091FF'
});
})
addTabs
(
'#news'
)
})
\ No newline at end of file
LoadNewsData
();
layui
.
use
(
'laytpl'
,
function
()
{
laytpl
=
layui
.
laytpl
;
var
getTpl
=
document
.
getElementById
(
'demo'
).
innerHTML
,
view
=
document
.
getElementById
(
'ulNews'
);
laytpl
(
getTpl
).
render
(
data
,
function
(
html
)
{
view
.
innerHTML
=
html
;
});
});
addTabs
(
'#news'
);
//
});
//加载新闻列表数据
function
LoadNewsData
()
{
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/Mh/getNewsHotArticleList"
,
//路径
dataType
:
"json"
,
async
:
false
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
data
.
list
=
result
.
data
;
}
}
});
}
var
data
=
{
//数据
"title"
:
"Layui常用模块"
,
"list"
:
[]
};
\ No newline at end of file
...
...
staticViews/xwdt.html
View file @
947047e
<!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>
...
...
@@ -9,6 +10,7 @@
<script
type=
"text/javascript"
src=
"../staticJs/head.js"
></script>
<link
rel=
"stylesheet"
type=
"text/css"
href=
"../staticCss/xwdt.css"
>
</head>
<body>
<div
class=
"navigation_crumbs"
>
<div
class=
"contentBox"
>
...
...
@@ -20,143 +22,8 @@
</div>
<div
class=
"leftandright"
>
<div
class=
"left"
>
<ul
class=
"leftContainer"
>
<li>
<a
class=
"left-top"
title=
"前三季度主要指标由负转正 中国经济持续稳定恢复"
href=
"./xwxq.html"
target=
"_blank"
>
前三季度主要指标由负转正 中国经济持续稳定恢复
</a>
<a
class=
"xw"
href=
"./xwxq.html"
target=
"_blank"
>
<div
class=
"xw-left"
>
<img
src=
"https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1938529415,777611275&fm=26&gp=0.jpg"
>
</div>
<div
class=
"xw-right"
>
<div
class=
"left-body"
>
10月21日,农业农村部举行新闻发布会,介绍2020年前三季度农业农村经济形式,农业农村部总经济师,发展
划司司长魏白刚介绍,今年农业收来之不易,农业农村经济保持了持续向好、稳中有进的态势,粮食丰收已成定局,预计产量达到历史最高水平
</div>
<div
class=
"left-buttom"
>
<div>
<svg
class=
"icon svg-icon"
aria-hidden=
"true"
>
<use
xlink:href=
"#iconchakan"
></use>
</svg>
<span>
123
</span>
</div>
<div>
<svg
class=
"icon svg-icon"
aria-hidden=
"true"
>
<use
xlink:href=
"#iconpinglun"
></use>
</svg>
<span>
456
</span>
</div>
<div
class=
"left-buttom-date"
>
2020-12-27
</div>
</div>
</div>
</a>
</li>
<li>
<a
class=
"left-top"
title=
"前三季度主要指标由负转正 中国经济持续稳定恢复"
href=
"./xwxq.html"
target=
"_blank"
>
前三季度主要指标由负转正 中国经济持续稳定恢复
</a>
<a
class=
"xw"
href=
"./xwxq.html"
target=
"_blank"
>
<div
class=
"xw-left"
>
<img
src=
"https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1938529415,777611275&fm=26&gp=0.jpg"
>
</div>
<div
class=
"xw-right"
>
<div
class=
"left-body"
>
10月21日,农业农村部举行新闻发布会,介绍2020年前三季度农业农村经济形式,农业农村部总经济师,发展
划司司长魏白刚介绍,今年农业收来之不易,农业农村经济保持了持续向好、稳中有进的态势,粮食丰收已成定局,预计产量达到历史最高水平
</div>
<div
class=
"left-buttom"
>
<div>
<svg
class=
"icon svg-icon"
aria-hidden=
"true"
>
<use
xlink:href=
"#iconchakan"
></use>
</svg>
<span>
123
</span>
</div>
<div>
<svg
class=
"icon svg-icon"
aria-hidden=
"true"
>
<use
xlink:href=
"#iconpinglun"
></use>
</svg>
<span>
456
</span>
</div>
<div
class=
"left-buttom-date"
>
2020-12-27
</div>
</div>
</div>
</a>
</li>
<li>
<a
class=
"left-top"
title=
"前三季度主要指标由负转正 中国经济持续稳定恢复"
href=
"./xwxq.html"
target=
"_blank"
>
前三季度主要指标由负转正 中国经济持续稳定恢复
</a>
<a
class=
"xw"
href=
"./xwxq.html"
target=
"_blank"
>
<div
class=
"xw-left"
>
<img
src=
"https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1938529415,777611275&fm=26&gp=0.jpg"
>
</div>
<div
class=
"xw-right"
>
<div
class=
"left-body"
>
10月21日,农业农村部举行新闻发布会,介绍2020年前三季度农业农村经济形式,农业农村部总经济师,发展
划司司长魏白刚介绍,今年农业收来之不易,农业农村经济保持了持续向好、稳中有进的态势,粮食丰收已成定局,预计产量达到历史最高水平
</div>
<div
class=
"left-buttom"
>
<div>
<svg
class=
"icon svg-icon"
aria-hidden=
"true"
>
<use
xlink:href=
"#iconchakan"
></use>
</svg>
<span>
123
</span>
</div>
<div>
<svg
class=
"icon svg-icon"
aria-hidden=
"true"
>
<use
xlink:href=
"#iconpinglun"
></use>
</svg>
<span>
456
</span>
</div>
<div
class=
"left-buttom-date"
>
2020-12-27
</div>
</div>
</div>
</a>
</li>
<li>
<a
class=
"left-top"
title=
"前三季度主要指标由负转正 中国经济持续稳定恢复"
href=
"./xwxq.html"
target=
"_blank"
>
前三季度主要指标由负转正 中国经济持续稳定恢复
</a>
<a
class=
"xw"
href=
"./xwxq.html"
target=
"_blank"
>
<div
class=
"xw-left"
>
<img
src=
"https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1938529415,777611275&fm=26&gp=0.jpg"
>
</div>
<div
class=
"xw-right"
>
<div
class=
"left-body"
>
10月21日,农业农村部举行新闻发布会,介绍2020年前三季度农业农村经济形式,农业农村部总经济师,发展
划司司长魏白刚介绍,今年农业收来之不易,农业农村经济保持了持续向好、稳中有进的态势,粮食丰收已成定局,预计产量达到历史最高水平
</div>
<div
class=
"left-buttom"
>
<div>
<svg
class=
"icon svg-icon"
aria-hidden=
"true"
>
<use
xlink:href=
"#iconchakan"
></use>
</svg>
<span>
123
</span>
</div>
<div>
<svg
class=
"icon svg-icon"
aria-hidden=
"true"
>
<use
xlink:href=
"#iconpinglun"
></use>
</svg>
<span>
456
</span>
</div>
<div
class=
"left-buttom-date"
>
2020-12-27
</div>
</div>
</div>
</a>
</li>
<ul
class=
"leftContainer"
id=
'ulNews'
>
</ul>
<div
id=
"page"
></div>
</div>
...
...
@@ -219,4 +86,41 @@
<script
type=
"text/javascript"
src=
"../staticJs/common.js"
></script>
<script
type=
"text/javascript"
src=
"../staticJs/down.js"
></script>
<script
type=
"text/javascript"
src=
"../staticJs/xwdt.js"
></script>
<script
id=
"demo"
type=
"text/html"
>
{{
#
layui
.
each
(
d
.
list
,
function
(
index
,
item
){
}}
<
li
>
<
a
class
=
"left-top"
title
=
"前三季度主要指标由负转正 中国经济持续稳定恢复"
href
=
"./xwxq.html"
target
=
"_blank"
>
{{
item
.
headline
}}
<
/a
>
<
a
class
=
"xw"
href
=
"./xwxq.html"
target
=
"_blank"
>
<
div
class
=
"xw-left"
>
<
img
src
=
"https://dss0.bdstatic.com/70cFvHSh_Q1YnxGkpoWK1HF6hhy/it/u=1938529415,777611275&fm=26&gp=0.jpg"
>
<
/div
>
<
div
class
=
"xw-right"
>
<
div
class
=
"left-body"
>
{{
item
.
headline
}}
<
/div
>
<
div
class
=
"left-buttom"
>
<
div
>
<
svg
class
=
"icon svg-icon"
aria
-
hidden
=
"true"
>
<
use
xlink
:
href
=
"#iconchakan"
><
/use
>
<
/svg>
<
span
>
{{
item
.
pageviews
}}
<
/span
>
<
/div
>
<
div
>
<
svg
class
=
"icon svg-icon"
aria
-
hidden
=
"true"
>
<
use
xlink
:
href
=
"#iconpinglun"
><
/use
>
<
/svg
>
<
span
>
{{
item
.
commentnum
}}
<
/span
>
<
/div
>
<
div
class
=
"left-buttom-date"
>
{{
item
.
publishTime
}}
<
/div
>
<
/div
>
<
/div
>
<
/a
>
<
/li
>
{{
#
});
}}
</script>
</html>
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment