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
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
2 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
This diff is collapsed.
Click to expand it.
Please
register
or
sign in
to post a comment