d1e1798b by 任超

Merge branch 'master' of yun.pashanhoo.com:renchao/portalStaticPage

2 parents 2d482f94 1b23dd3c
......@@ -11,4 +11,25 @@ $(function(){
$('#phone').text(getCookie().phone)
$('#zjhm').text(getCookie().zjhm)
$('#recordtime').text(getCookie().recordtime)
$('#hellotime').text(getTimeState())
})
function getTimeState(){
// 获取当前时间
let timeNow = new Date();
// 获取当前小时
let hours = timeNow.getHours();
// 设置默认文字
let text = '';
// 判断当前时间段
if (hours >= 0 && hours <= 10) {
text = '早上好:';
} else if (hours > 10 && hours <= 14) {
text = '中午好:';
} else if (hours > 14 && hours <= 18) {
text = '下午好:';
} else if (hours > 18 && hours <= 24) {
text = `晚上好:`;
}
// 返回当前时间段对应的状态
return text;
};
\ No newline at end of file
......
......@@ -26,7 +26,9 @@ $(function () {
dataRendering(dataList.list)
}
})
$(function() {
$('#hellotime').text(getTimeState())
})
$(document).on("click", ".appintmentList li .handle", function () {
let businessNo = $(this).attr('data-businessNo');
let slsqBsm = $(this).attr('data-slsqBsm');
......@@ -254,6 +256,26 @@ function dataRendering() {
$('.appintmentList').append(li)
}
}
function getTimeState(){
// 获取当前时间
let timeNow = new Date();
// 获取当前小时
let hours = timeNow.getHours();
// 设置默认文字
let text = '';
// 判断当前时间段
if (hours >= 0 && hours <= 10) {
text = '早上好:';
} else if (hours > 10 && hours <= 14) {
text = '中午好:';
} else if (hours > 14 && hours <= 18) {
text = '下午好:';
} else if (hours > 18 && hours <= 24) {
text = `晚上好:`;
}
// 返回当前时间段对应的状态
return text;
};
var dataList = {
"list": [],
......
......@@ -28,7 +28,7 @@
<img src="../staticImages/person.png" alt="">
<ul>
<li>
<span>上午好:</span>
<span id='hellotime'>上午好:</span>
<p id="username"></p>
</li>
<li>
......
......@@ -29,7 +29,7 @@
<img src="../staticImages/person.png" alt="">
<ul>
<li>
<span>上午好:</span>
<span id='hellotime'>上午好:</span>
<p id="username"></p>
</li>
<li>
......@@ -43,7 +43,7 @@
<li class="applyBusinessRecord">
<a data-id='1' class="itemTitleActive">
<p>
<span>5</span>
<span>0</span>
<b></b>
</p>
<p>办理合计</p>
......@@ -52,7 +52,7 @@
<li class="to_be_submitted">
<a data-id='2'>
<p>
<span>1</span>
<span>0</span>
<b></b>
</p>
<p>待提交</p>
......@@ -61,7 +61,7 @@
<li class="applyBusinessIn">
<a data-id='3'>
<p>
<span>5</span>
<span>0</span>
<b></b>
</p>
<p>办理中</p>
......@@ -70,7 +70,7 @@
<li class="applyBusinessEnd">
<a data-id='6'>
<p>
<span>5</span>
<span>0</span>
<b></b>
</p>
<p>已办结</p>
......