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
0901f53f
authored
2021-01-27 10:13:31 +0800
by
任超
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
style:日期
1 parent
b5203c00
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
9 deletions
index.html
staticJs/header.js
index.html
View file @
0901f53
...
...
@@ -22,7 +22,7 @@
<div
class=
'home-sticky'
>
<div
class=
'top-logo'
>
<div
class=
'top_logo_content'
>
<div
class=
"head-time"
>
今天是2021年1月19日 星期二
</div>
<div
class=
"head-time"
></div>
<ul
class=
'login layui-nav login-con'
>
<span
class=
'loginButton'
id=
"login"
>
登录
</span>
<p
class=
'loginButton register'
id=
'register'
><a
href=
'/staticViews/register.html'
>
注册
</a></p>
...
...
staticJs/header.js
View file @
0901f53
...
...
@@ -3,6 +3,7 @@ $(function () {
if
(
getItem
(
'myCookie'
)
&&
getItem
(
'myCookie'
).
userid
)
{
fetchNewsData
(
getItem
(
'myCookie'
).
userid
,
5
);
}
$
(
'.head-time'
).
html
(
getDateWeek
())
})
function
newsCenterData
()
{
$
(
document
).
on
(
"mouseover"
,
".sysNewsList .newsDetail"
,
function
(
e
)
{
...
...
@@ -14,16 +15,16 @@ function newsCenterData() {
})
$
(
document
).
on
(
"mouseover"
,
".sysNewsItem .userImage"
,
function
(
e
)
{
$
(
this
).
attr
(
'src'
,
'/staticImages/sexiaoxi.png'
);
$
(
this
).
attr
(
'src'
,
'/staticImages/sexiaoxi.png'
);
})
$
(
document
).
on
(
"mouseout"
,
".sysNewsItem .userImage"
,
function
(
e
)
{
$
(
this
).
attr
(
'src'
,
'/staticImages/xiaoxi.png'
);
$
(
this
).
attr
(
'src'
,
'/staticImages/xiaoxi.png'
);
})
$
(
document
).
on
(
"mouseover"
,
".sysNewsList"
,
function
(
e
)
{
$
(
'.sysNewsItem .userImage'
).
attr
(
'src'
,
'/staticImages/sexiaoxi.png'
);
$
(
'.sysNewsItem .userImage'
).
attr
(
'src'
,
'/staticImages/sexiaoxi.png'
);
})
$
(
document
).
on
(
"mouseout"
,
".sysNewsList"
,
function
(
e
)
{
$
(
'.sysNewsItem .userImage'
).
attr
(
'src'
,
'/staticImages/xiaoxi.png'
);
$
(
'.sysNewsItem .userImage'
).
attr
(
'src'
,
'/staticImages/xiaoxi.png'
);
})
}
// 根据用户id及展示数量读取消息提醒
...
...
@@ -33,7 +34,7 @@ function fetchNewsData(userid, size) {
var
li
;
$
.
ajax
({
type
:
"get"
,
//提交方式
url
:
portal
.
api_url
+
"/portal/messageRemind/getDetailByUserid?userid="
+
userid
+
"&size="
+
size
,
//路径
url
:
portal
.
api_url
+
"/portal/messageRemind/getDetailByUserid?userid="
+
userid
+
"&size="
+
size
,
//路径
dataType
:
"json"
,
//数据,这里使用的是Json格式进行传输
success
:
function
(
result
)
{
//返回数据根据结果进行相应的处理
...
...
@@ -41,11 +42,11 @@ function fetchNewsData(userid, size) {
for
(
var
i
=
0
;
i
<
result
.
data
.
length
;
i
++
)
{
li
=
'<dd>'
li
+=
'<a>'
li
+=
'<p class="newsDetail ellipsis">'
+
result
.
data
[
i
].
content
+
'</p>'
li
+=
'<div class="newsDetail-time"><span>'
+
result
.
data
[
i
].
addTime
+
'</span>'
li
+=
'<p class="newsDetail ellipsis">'
+
result
.
data
[
i
].
content
+
'</p>'
li
+=
'<div class="newsDetail-time"><span>'
+
result
.
data
[
i
].
addTime
+
'</span>'
if
(
result
.
data
[
i
].
status
==
0
)
{
li
+=
'<span clas="unread" style="color: #ff0000">未读</span></div>'
}
else
{
}
else
{
li
+=
'<span class="read">已读</span></div>'
}
li
+=
'</a>'
...
...
@@ -56,3 +57,26 @@ function fetchNewsData(userid, size) {
}
});
}
function
getDateWeek
()
{
todayDate
=
new
Date
();
date
=
todayDate
.
getDate
();
month
=
todayDate
.
getMonth
()
+
1
;
year
=
todayDate
.
getYear
();
var
dateweek
=
"今天是:"
;
if
(
navigator
.
appName
==
"Netscape"
)
{
dateweek
=
dateweek
+
(
1900
+
year
)
+
"年"
+
month
+
"月"
+
date
+
"日 "
;
}
if
(
navigator
.
appVersion
.
indexOf
(
"MSIE"
)
!=
-
1
)
{
dateweek
=
dateweek
+
year
+
"年"
+
month
+
"月"
+
date
+
"日 "
;
}
switch
(
todayDate
.
getDay
())
{
case
0
:
dateweek
+=
"星期日"
;
break
;
case
1
:
dateweek
+=
"星期一"
;
break
;
case
2
:
dateweek
+=
"星期二"
;
break
;
case
3
:
dateweek
+=
"星期三"
;
break
;
case
4
:
dateweek
+=
"星期四"
;
break
;
case
5
:
dateweek
+=
"星期五"
;
break
;
case
6
:
dateweek
+=
"星期六"
;
break
;
}
return
dateweek
;
}
\ No newline at end of file
...
...
Please
register
or
sign in
to post a comment