Compare commits
4 Commits
1b89233330
...
9e172002c3
| Author | SHA1 | Date | |
|---|---|---|---|
| 9e172002c3 | |||
| fd1596e7d4 | |||
| bf789cb32d | |||
| 24848e7791 |
2
.idea/SmartRollCall.iml
generated
2
.idea/SmartRollCall.iml
generated
@@ -7,7 +7,7 @@
|
|||||||
<content url="file://$MODULE_DIR$">
|
<content url="file://$MODULE_DIR$">
|
||||||
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
<excludeFolder url="file://$MODULE_DIR$/venv" />
|
||||||
</content>
|
</content>
|
||||||
<orderEntry type="jdk" jdkName="Python 3.11 (venv)" jdkType="Python SDK" />
|
<orderEntry type="jdk" jdkName="Python 3.11 (SmartRollCall)" jdkType="Python SDK" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="jquery" level="application" />
|
<orderEntry type="library" name="jquery" level="application" />
|
||||||
</component>
|
</component>
|
||||||
|
|||||||
@@ -42,6 +42,26 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-body">
|
||||||
|
<div id="sign-in-reminder" class="layui-container">
|
||||||
|
<h1>每日签到</h1>
|
||||||
|
<p>每天签到,享受连续签到奖励!</p>
|
||||||
|
|
||||||
|
<!-- 签到状态 -->
|
||||||
|
<div class="layui-row">
|
||||||
|
<div class="layui-col-xs12">
|
||||||
|
<div id="sign-in-status">你已连续签到 <span id="days-count">0</span> 天</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 操作按钮 -->
|
||||||
|
<div class="layui-row" style="margin-top: 20px;">
|
||||||
|
<div class="layui-col-xs12">
|
||||||
|
<button class="layui-btn" id="sign-in-btn">立即签到</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery -->
|
<script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery -->
|
||||||
|
|||||||
@@ -42,8 +42,29 @@
|
|||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="layui-body">
|
||||||
|
<div id="sign-in-reminder" class="layui-container">
|
||||||
|
<h1>每日签到</h1>
|
||||||
|
<p>每天签到,享受连续签到奖励!</p>
|
||||||
|
|
||||||
|
<!-- 签到状态 -->
|
||||||
|
<div class="layui-row">
|
||||||
|
<div class="layui-col-xs12">
|
||||||
|
<div id="sign-in-status">你已连续签到 <span id="days-count">0</span> 天</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- 操作按钮 -->
|
||||||
|
<div class="layui-row" style="margin-top: 20px;">
|
||||||
|
<div class="layui-col-xs12">
|
||||||
|
<button class="layui-btn" id="sign-in-btn">立即签到</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery -->
|
<script src="static/jquery.min.js"></script> <!-- 确保已经引入jQuery -->
|
||||||
<script src="static/layui.js"></script>
|
<script src="static/layui.js"></script>
|
||||||
<script>
|
<script>
|
||||||
|
|||||||
147
app/templates/test.html
Normal file
147
app/templates/test.html
Normal file
@@ -0,0 +1,147 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<meta charset="utf-8"/>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1"/>
|
||||||
|
<title>Demo</title>
|
||||||
|
<!-- 请勿在项目正式环境中引用该 layui.css 地址 -->
|
||||||
|
<link href="//unpkg.com/layui@2.9.2/dist/css/layui.css" rel="stylesheet"/>
|
||||||
|
<style>
|
||||||
|
.layui-container {
|
||||||
|
margin-top: 20px;
|
||||||
|
background-color: #fff;
|
||||||
|
padding: 20px;
|
||||||
|
border-radius: 5px;
|
||||||
|
box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendar-table {
|
||||||
|
width: 100%;
|
||||||
|
text-align: center;
|
||||||
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendar-table td {
|
||||||
|
font-size: 24px; /* 增加日期的字体大小 */
|
||||||
|
}
|
||||||
|
|
||||||
|
.signed {
|
||||||
|
color: #fff; /* 白色文字 */
|
||||||
|
background-color: green; /* 已签到日期的背景色 */
|
||||||
|
}
|
||||||
|
#current-time {
|
||||||
|
color: #333;
|
||||||
|
margin-bottom: 15px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
.reminder {
|
||||||
|
margin-top: 20px;
|
||||||
|
font-size: 16px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.calendar-table th {
|
||||||
|
background-color: #f2f2f2;
|
||||||
|
}
|
||||||
|
.color-box {
|
||||||
|
display: inline-block;
|
||||||
|
width: 20px;
|
||||||
|
height: 20px;
|
||||||
|
vertical-align: middle;
|
||||||
|
margin-right: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.required-sign {
|
||||||
|
background-color: #FFA07A; /* 需要签到日期的背景色 */
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<!-- 动态显示当前时间的标题 -->
|
||||||
|
<h1 id="current-time">当前时间: </h1>
|
||||||
|
|
||||||
|
<h2>签到提醒</h2>
|
||||||
|
|
||||||
|
<table class="layui-table calendar-table" id="calendar">
|
||||||
|
<!-- 日历的头部 -->
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>日</th>
|
||||||
|
<th>一</th>
|
||||||
|
<th>二</th>
|
||||||
|
<th>三</th>
|
||||||
|
<th>四</th>
|
||||||
|
<th>五</th>
|
||||||
|
<th>六</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<!-- 日历的主体部分 -->
|
||||||
|
<tbody id="calendar-body">
|
||||||
|
<!-- 动态生成日历的日期部分 -->
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<!-- 提醒内容 -->
|
||||||
|
<div class="reminder">
|
||||||
|
<span><span class="color-box" style="background-color: green;"></span>绿色代表当月已签到</span><br>
|
||||||
|
<span><span class="color-box" style="background-color: #FFA07A;"></span>颜色代表本月需要签到</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script src="//unpkg.com/layui@2.9.2/dist/layui.js"></script>
|
||||||
|
<script>
|
||||||
|
layui.use(['layer'], function () {
|
||||||
|
var layer = layui.layer;
|
||||||
|
|
||||||
|
// 假设的已签到日期数据
|
||||||
|
var signedDays = [1, 5, 9]; // 这里仅为示例,实际应从服务器获取
|
||||||
|
var requiredSignDays = [2, 6, 15, 23];
|
||||||
|
|
||||||
|
// 动态生成日历
|
||||||
|
function generateCalendar() {
|
||||||
|
var today = new Date();
|
||||||
|
var currentMonth = today.getMonth();
|
||||||
|
var currentYear = today.getFullYear();
|
||||||
|
|
||||||
|
var firstDay = new Date(currentYear, currentMonth, 1).getDay();
|
||||||
|
var daysInMonth = new Date(currentYear, currentMonth + 1, 0).getDate();
|
||||||
|
|
||||||
|
var calendarHtml = '';
|
||||||
|
var day = 1;
|
||||||
|
|
||||||
|
for (var i = 0; i < 6; i++) {
|
||||||
|
calendarHtml += '<tr>';
|
||||||
|
for (var j = 0; j < 7; j++) {
|
||||||
|
if (i === 0 && j < firstDay) {
|
||||||
|
calendarHtml += '<td></td>';
|
||||||
|
} else if (day > daysInMonth) {
|
||||||
|
break;
|
||||||
|
} else {
|
||||||
|
var classes = '';
|
||||||
|
if (signedDays.includes(day)) classes += 'signed '; // 已签到
|
||||||
|
if (requiredSignDays.includes(day)) classes += 'required-sign'; // 需要签到
|
||||||
|
calendarHtml += `<td class="${classes}">${day}</td>`;
|
||||||
|
day++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
calendarHtml += '</tr>';
|
||||||
|
if (day > daysInMonth) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById('calendar-body').innerHTML = calendarHtml;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateTime() {
|
||||||
|
var now = new Date();
|
||||||
|
var timeStr = now.getFullYear() + '-' + (now.getMonth() + 1) + '-' + now.getDate();
|
||||||
|
document.getElementById('current-time').innerText = '当前时间: ' + timeStr;
|
||||||
|
}
|
||||||
|
|
||||||
|
// 页面加载时生成日历
|
||||||
|
generateCalendar();
|
||||||
|
updateTime();
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Reference in New Issue
Block a user