0901f53f by 任超

style:日期

1 parent b5203c00
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
22 <div class='home-sticky'> 22 <div class='home-sticky'>
23 <div class='top-logo'> 23 <div class='top-logo'>
24 <div class='top_logo_content'> 24 <div class='top_logo_content'>
25 <div class="head-time">今天是2021年1月19日 星期二</div> 25 <div class="head-time"></div>
26 <ul class='login layui-nav login-con'> 26 <ul class='login layui-nav login-con'>
27 <span class='loginButton' id="login">登录</span> 27 <span class='loginButton' id="login">登录</span>
28 <p class='loginButton register' id='register'><a href='/staticViews/register.html'>注册</a></p> 28 <p class='loginButton register' id='register'><a href='/staticViews/register.html'>注册</a></p>
......
...@@ -3,6 +3,7 @@ $(function () { ...@@ -3,6 +3,7 @@ $(function () {
3 if (getItem('myCookie') && getItem('myCookie').userid) { 3 if (getItem('myCookie') && getItem('myCookie').userid) {
4 fetchNewsData(getItem('myCookie').userid, 5); 4 fetchNewsData(getItem('myCookie').userid, 5);
5 } 5 }
6 $('.head-time').html(getDateWeek())
6 }) 7 })
7 function newsCenterData() { 8 function newsCenterData() {
8 $(document).on("mouseover", ".sysNewsList .newsDetail", function (e) { 9 $(document).on("mouseover", ".sysNewsList .newsDetail", function (e) {
...@@ -14,16 +15,16 @@ function newsCenterData() { ...@@ -14,16 +15,16 @@ function newsCenterData() {
14 }) 15 })
15 16
16 $(document).on("mouseover", ".sysNewsItem .userImage", function (e) { 17 $(document).on("mouseover", ".sysNewsItem .userImage", function (e) {
17 $(this).attr('src','/staticImages/sexiaoxi.png'); 18 $(this).attr('src', '/staticImages/sexiaoxi.png');
18 }) 19 })
19 $(document).on("mouseout", ".sysNewsItem .userImage", function (e) { 20 $(document).on("mouseout", ".sysNewsItem .userImage", function (e) {
20 $(this).attr('src','/staticImages/xiaoxi.png'); 21 $(this).attr('src', '/staticImages/xiaoxi.png');
21 }) 22 })
22 $(document).on("mouseover", ".sysNewsList", function (e) { 23 $(document).on("mouseover", ".sysNewsList", function (e) {
23 $('.sysNewsItem .userImage').attr('src','/staticImages/sexiaoxi.png'); 24 $('.sysNewsItem .userImage').attr('src', '/staticImages/sexiaoxi.png');
24 }) 25 })
25 $(document).on("mouseout", ".sysNewsList", function (e) { 26 $(document).on("mouseout", ".sysNewsList", function (e) {
26 $('.sysNewsItem .userImage').attr('src','/staticImages/xiaoxi.png'); 27 $('.sysNewsItem .userImage').attr('src', '/staticImages/xiaoxi.png');
27 }) 28 })
28 } 29 }
29 // 根据用户id及展示数量读取消息提醒 30 // 根据用户id及展示数量读取消息提醒
...@@ -33,7 +34,7 @@ function fetchNewsData(userid, size) { ...@@ -33,7 +34,7 @@ function fetchNewsData(userid, size) {
33 var li; 34 var li;
34 $.ajax({ 35 $.ajax({
35 type: "get", //提交方式 36 type: "get", //提交方式
36 url: portal.api_url + "/portal/messageRemind/getDetailByUserid?userid="+userid+"&size="+size,//路径 37 url: portal.api_url + "/portal/messageRemind/getDetailByUserid?userid=" + userid + "&size=" + size,//路径
37 dataType: "json", 38 dataType: "json",
38 //数据,这里使用的是Json格式进行传输 39 //数据,这里使用的是Json格式进行传输
39 success: function (result) {//返回数据根据结果进行相应的处理 40 success: function (result) {//返回数据根据结果进行相应的处理
...@@ -41,11 +42,11 @@ function fetchNewsData(userid, size) { ...@@ -41,11 +42,11 @@ function fetchNewsData(userid, size) {
41 for (var i = 0; i < result.data.length; i++) { 42 for (var i = 0; i < result.data.length; i++) {
42 li = '<dd>' 43 li = '<dd>'
43 li += '<a>' 44 li += '<a>'
44 li += '<p class="newsDetail ellipsis">'+result.data[i].content+'</p>' 45 li += '<p class="newsDetail ellipsis">' + result.data[i].content + '</p>'
45 li += '<div class="newsDetail-time"><span>'+result.data[i].addTime+'</span>' 46 li += '<div class="newsDetail-time"><span>' + result.data[i].addTime + '</span>'
46 if (result.data[i].status == 0) { 47 if (result.data[i].status == 0) {
47 li += '<span clas="unread" style="color: #ff0000">未读</span></div>' 48 li += '<span clas="unread" style="color: #ff0000">未读</span></div>'
48 }else { 49 } else {
49 li += '<span class="read">已读</span></div>' 50 li += '<span class="read">已读</span></div>'
50 } 51 }
51 li += '</a>' 52 li += '</a>'
...@@ -55,4 +56,27 @@ function fetchNewsData(userid, size) { ...@@ -55,4 +56,27 @@ function fetchNewsData(userid, size) {
55 } 56 }
56 } 57 }
57 }); 58 });
59 }
60 function getDateWeek() {
61 todayDate = new Date();
62 date = todayDate.getDate();
63 month = todayDate.getMonth() + 1;
64 year = todayDate.getYear();
65 var dateweek = "今天是:";
66 if (navigator.appName == "Netscape") {
67 dateweek = dateweek + (1900 + year) + "年" + month + "月" + date + "日 ";
68 }
69 if (navigator.appVersion.indexOf("MSIE") != -1) {
70 dateweek = dateweek + year + "年" + month + "月" + date + "日 ";
71 }
72 switch (todayDate.getDay()) {
73 case 0: dateweek += "星期日"; break;
74 case 1: dateweek += "星期一"; break;
75 case 2: dateweek += "星期二"; break;
76 case 3: dateweek += "星期三"; break;
77 case 4: dateweek += "星期四"; break;
78 case 5: dateweek += "星期五"; break;
79 case 6: dateweek += "星期六"; break;
80 }
81 return dateweek;
58 } 82 }
...\ No newline at end of file ...\ No newline at end of file
......