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
ff4f0d82
authored
2020-11-25 17:12:49 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:公示公告
1 parent
931b90ea
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
76 additions
and
15 deletions
staticJs/gsgg.js
staticViews/gsgg.html
staticJs/gsgg.js
View file @
ff4f0d8
layui
.
use
(
'element'
,
function
()
{
var
element
=
layui
.
element
;
//导航的hover效果、二级菜单等功能,需要依赖element模块
//监听导航点击
element
.
on
(
'nav(demo)'
,
function
(
elem
)
{
//console.log(elem)
$
(
function
()
{
layui
.
use
(
'element'
,
function
()
{
var
element
=
layui
.
element
;
//导航的hover效果、二级菜单等功能,需要依赖element模块
//监听导航点击
element
.
on
(
'nav(demo)'
,
function
(
elem
)
{
layer
.
msg
(
elem
.
text
());
});
});
layui
.
use
(
'laydate'
,
function
()
{
layui
.
use
(
'laydate'
,
function
()
{
var
laydate
=
layui
.
laydate
;
//常规用法
laydate
.
render
({
elem
:
'#date'
});
})
})
layui
.
use
(
'laypage'
,
function
()
{
layui
.
use
(
'laypage'
,
function
()
{
var
laypage
=
layui
.
laypage
;
//执行一个laypage实例
laypage
.
render
({
elem
:
'test1'
//注意,这里的 test1 是 ID,不用加 # 号
,
count
:
50
//数据总数,从服务端得到
,
count
:
50
//数据总数,从服务端得到
});
});
});
\ No newline at end of file
layui
.
use
(
'laytpl'
,
function
()
{
laytpl
=
layui
.
laytpl
;
var
getTpl
=
document
.
getElementById
(
'demo'
).
innerHTML
,
view
=
document
.
getElementById
(
'notice-list'
);
laytpl
(
getTpl
).
render
(
data
,
function
(
html
)
{
view
.
innerHTML
=
html
;
});
});
initData
()
})
//门户公示公告列表
function
initData
()
{
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/hlwj/MhNotice/getNoticeList"
,
//路径
data
:{
"currentPage"
:
1
,
"pageSize"
:
10
},
dataType
:
"json"
,
async
:
false
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
data
.
list
=
result
.
data
.
records
;
}
}
});
}
var
data
=
{
//数据
"list"
:
[]
};
\ No newline at end of file
...
...
staticViews/gsgg.html
View file @
ff4f0d8
...
...
@@ -43,8 +43,8 @@
<!-- 列表区域 -->
<div
class=
"listArea"
>
<div
class=
"announcement_list"
>
<ul
class=
"gglist"
>
<li>
<ul
class=
"gglist"
id=
"notice-list"
>
<
!-- <
li>
<a href="./ggxq.html" target="_blank">
<div class="gg">
<svg class="icon svg-icon" aria-hidden="true">
...
...
@@ -56,6 +56,18 @@
</div>
</a>
</li>
<li>
<a href="./ggxq.html" target="_blank">
<div class="gg">
<svg class="icon svg-icon" aria-hidden="true">
<use xlink:href="#icongongshi"></use>
</svg>
<p class="item_list">
党的十八大以来双拥工作综述:为实现中国梦强军梦凝聚强大力量 前三季度主要指标由负转正
</p>
</div>
</a>
</li> -->
</ul>
<div
id=
"test1"
></div>
</div>
...
...
@@ -112,5 +124,20 @@
<script
type=
"text/javascript"
src=
"../staticJs/common.js"
></script>
<script
type=
"text/javascript"
src=
"../staticJs/down.js"
></script>
<script
type=
"text/javascript"
src=
"../staticJs/gsgg.js"
></script>
<script
id=
"demo"
type=
"text/html"
>
{{
#
layui
.
each
(
d
.
list
,
function
(
index
,
item
){
}}
<
li
>
<
a
href
=
'./ggxq.html?id="{{item.id}}"'
target
=
"_blank"
>
<
div
class
=
"gg"
>
<
svg
class
=
"icon svg-icon"
aria
-
hidden
=
"true"
>
<
use
xlink
:
href
=
"#icongonggao1"
><
/use
>
<
/svg
>
<
p
class
=
"item_list"
>
{{
item
.
title
}}
<
/p
>
<
/div
>
<
/a
>
<
/li
>
{{
#
});
}}
</script>
</html>
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment