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
83e54d43
authored
2021-01-22 13:43:53 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:消息
1 parent
d0e011c0
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
34 additions
and
18 deletions
staticCss/sysnews-center.css
staticJs/header.js
staticJs/sysnews-center.js
staticViews/sysnews-center.html
staticCss/sysnews-center.css
View file @
83e54d4
...
...
@@ -38,6 +38,11 @@
border-radius
:
5px
;
border
:
1px
solid
#dedede
;
}
.sysnews-list
li
{
line-height
:
50px
;
border-bottom
:
1px
dotted
#dedede
;
margin-bottom
:
15px
;
}
.sysnews-list
li
p
{
display
:
inline-block
;
}
...
...
staticJs/header.js
View file @
83e54d4
...
...
@@ -25,7 +25,6 @@ function fetchNewsData(userid, size) {
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
console
.
log
(
result
.
data
)
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
li
=
'<dd>'
li
+=
'<a>'
...
...
staticJs/sysnews-center.js
View file @
83e54d4
...
...
@@ -26,18 +26,37 @@ function initNewsData() {
flow
.
load
({
elem
:
'#sys-news'
//流加载容器
,
scrollElem
:
'#sys-news'
//滚动条所在元素,一般不用填,此处只是演示需要。
,
done
:
function
(
page
,
next
)
{
//执行下一页的回调
,
done
:
function
(
page
,
next
)
{
//模拟数据插入
setTimeout
(
function
()
{
var
lis
=
[];
for
(
var
i
=
0
;
i
<
8
;
i
++
)
{
lis
.
push
(
'<li>'
+
((
page
-
1
)
*
8
+
i
+
1
)
+
'</li>'
)
// setTimeout(function () {
// var lis = [];
// for (var i = 0; i < 8; i++) {
// lis.push('<li>' + ((page - 1) * 8 + i + 1) + '</li>')
// }
// next(lis.join(''), page < 10); //假设总页数为 10
// }, 500);
var
lis
=
[];
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/portal/messageRemind/getDetailByUserid?userid="
+
getItem
(
'myCookie'
).
userid
+
"&size="
+
5
,
//路径
dataType
:
"json"
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
if
(
result
.
code
==
200
&&
result
.
data
!=
null
)
{
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
li
=
'<li><span class="list-date">'
+
result
.
data
[
i
].
addTime
+
'</span>'
li
+=
'<p>'
+
result
.
data
[
i
].
content
+
'</p>'
if
(
result
.
data
[
i
].
status
==
0
)
{
li
+=
'<span class="list-type list-type-unread">未读</span></li>'
}
else
{
li
+=
'<span class="list-type list-type-read">已读</span></li>'
}
lis
.
push
(
li
)
}
next
(
lis
.
join
(
''
),
page
<
2
);
//假设总页数为 10
}
}
//执行下一页渲染,第二参数为:满足“加载更多”的条件,即后面仍有分页
//pages为Ajax返回的总页数,只有当前页小于总页数的情况下,才会继续出现加载更多
next
(
lis
.
join
(
''
),
page
<
10
);
//假设总页数为 10
},
500
);
});
}
});
});
...
...
staticViews/sysnews-center.html
View file @
83e54d4
...
...
@@ -35,13 +35,6 @@
</div>
<!-- 列表 -->
<ul
class=
"sysnews-list flow-default"
id=
"sys-news"
>
<li>
<span
class=
"list-date"
>
2020-12-23
</span>
<p>
您申请办理的XXX业务已成功提交,
</p>
<span
class=
"list-type"
>
已阅
</span>
</li>
</ul>
</div>
</div>
...
...
Please
register
or
sign in
to post a comment