@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Eslint config file
|
||||
* Documentation: https://eslint.org/docs/user-guide/configuring/
|
||||
* Install the Eslint extension before using this feature.
|
||||
*/
|
||||
module.exports = {
|
||||
env: {
|
||||
es6: true,
|
||||
browser: true,
|
||||
node: true,
|
||||
},
|
||||
ecmaFeatures: {
|
||||
modules: true,
|
||||
},
|
||||
parserOptions: {
|
||||
ecmaVersion: 2018,
|
||||
sourceType: 'module',
|
||||
},
|
||||
globals: {
|
||||
wx: true,
|
||||
App: true,
|
||||
Page: true,
|
||||
getCurrentPages: true,
|
||||
getApp: true,
|
||||
Component: true,
|
||||
requirePlugin: true,
|
||||
requireMiniProgram: true,
|
||||
},
|
||||
// extends: 'eslint:recommended',
|
||||
rules: {},
|
||||
}
|
@ -0,0 +1,14 @@
|
||||
# Windows
|
||||
[Dd]esktop.ini
|
||||
Thumbs.db
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# macOS
|
||||
.DS_Store
|
||||
.fseventsd
|
||||
.Spotlight-V100
|
||||
.TemporaryItems
|
||||
.Trashes
|
||||
|
||||
# Node.js
|
||||
node_modules/
|
@ -0,0 +1,19 @@
|
||||
// app.js
|
||||
App({
|
||||
onLaunch() {
|
||||
// 展示本地存储能力
|
||||
const logs = wx.getStorageSync('logs') || []
|
||||
logs.unshift(Date.now())
|
||||
wx.setStorageSync('logs', logs)
|
||||
|
||||
// 登录
|
||||
wx.login({
|
||||
success: res => {
|
||||
// 发送 res.code 到后台换取 openId, sessionKey, unionId
|
||||
}
|
||||
})
|
||||
},
|
||||
globalData: {
|
||||
userInfo: null
|
||||
}
|
||||
})
|
@ -0,0 +1,22 @@
|
||||
{
|
||||
"pages": [
|
||||
"pages/welcome/welcome",
|
||||
"pages/call_roll/call_roll",
|
||||
"pages/function/function",
|
||||
"pages/class_manage/class_manage",
|
||||
"pages/add_stu/add_stu",
|
||||
"pages/class_message/class_message",
|
||||
"pages/record/record",
|
||||
"pages/index/index",
|
||||
"pages/logs/logs"
|
||||
],
|
||||
"window": {
|
||||
"navigationBarTextStyle": "black",
|
||||
"navigationBarTitleText": "Weixin",
|
||||
"navigationBarBackgroundColor": "#ffffff"
|
||||
},
|
||||
"style": "v2",
|
||||
"componentFramework": "glass-easel",
|
||||
"sitemapLocation": "sitemap.json",
|
||||
"lazyCodeLoading": "requiredComponents"
|
||||
}
|
@ -0,0 +1 @@
|
||||
/**app.wxss**/
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,111 @@
|
||||
/* pages/add_stu/add_stu.wxss */
|
||||
page{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.bg image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.header {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 20rpx;
|
||||
font-size: 60rpx;
|
||||
font-weight: bold;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
.tip {
|
||||
position: absolute;
|
||||
top:100rpx;
|
||||
left: 20rpx;
|
||||
font-size: 40rpx;
|
||||
font-weight: bold;
|
||||
color: rgb(0, 0, 0);
|
||||
}
|
||||
|
||||
.stu_textarea {
|
||||
position: absolute;
|
||||
border: 5rpx solid rgb(252, 252, 252);
|
||||
top: 180rpx;
|
||||
left: 72rpx;
|
||||
width: 80%;
|
||||
box-sizing: border-box;
|
||||
font-size: 40rpx;
|
||||
height: 300rpx;
|
||||
color: black;
|
||||
}
|
||||
|
||||
.add {
|
||||
position: absolute;
|
||||
left: 200rpx;
|
||||
top: 525rpx;
|
||||
display: inline-block;
|
||||
padding: 10rpx 50rpx; /* 调整内边距以改变按钮大小 */
|
||||
font-size: 40rpx;
|
||||
color: rgba(0, 0, 0, 1);
|
||||
background-color: #ffae0060; /* 按钮背景色 */
|
||||
border: none;
|
||||
border-radius: 100rpx; /* 初始设置为圆角矩形 */
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
overflow: hidden; /* 隐藏超出按钮范围的内容 */
|
||||
}
|
||||
.add:before {
|
||||
left: -10rpx; /* 圆形部分在按钮左侧的位置 */
|
||||
}
|
||||
|
||||
.add:after {
|
||||
right: -10px; /* 圆形部分在按钮右侧的位置 */
|
||||
}
|
||||
|
||||
.add:hover {
|
||||
background-color: #00b30f3d; /* 鼠标悬停时按钮的背景色 */
|
||||
}
|
||||
|
||||
.add:hover:before,
|
||||
.add:hover:after {
|
||||
background-color: #00b31e5e; /* 鼠标悬停时圆形部分的背景色 */
|
||||
}
|
||||
|
||||
.excel {
|
||||
background-color: rgba(255, 166, 0, 0.486);
|
||||
position: absolute;
|
||||
padding: 0 0;
|
||||
margin: 0 0;
|
||||
width: 600rpx;
|
||||
top: 800rpx;
|
||||
left: 200rpx;
|
||||
font-size: 60rpx;
|
||||
}
|
||||
|
||||
.return {
|
||||
position: absolute;
|
||||
width: 200rpx;
|
||||
height: 100rpx;
|
||||
bottom: 100rpx;
|
||||
right: 100rpx;
|
||||
font-size: 60rpx;
|
||||
background-color: rgba(255, 0, 0, 0.384);
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
<!--pages/call_roll/call_roll.wxml-->
|
||||
<view class="bg">
|
||||
<image src="/pages/images/call_roll.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<view class="student-name">{{currentStudentName}}</view>
|
||||
<view class="student-list">
|
||||
<block wx:for="{{students}}" wx:key="id">
|
||||
<view class="student-item {{index === currentStudentIndex ? 'selected' : ''}}">{{name}}</view>
|
||||
</block>
|
||||
<button bindtap="toggleRoll" data-rolling="{{rolling}}">{{rolling ? '暂停' : '开始'}}随机点名</button>
|
||||
</view>
|
||||
<text class="tip">积分设置:</text>
|
||||
<input class="number" input type="text" bindinput="setPoint" value="{{point}}"/>
|
||||
<button class="confirmPoint" bindtap="confirmPoint">确认</button>
|
||||
<button class="return" bindtap="goTofunction">返回</button>
|
||||
</view>
|
@ -0,0 +1,113 @@
|
||||
/* pages/call_roll/call_roll.wxss */
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.bg image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
|
||||
.student-list {
|
||||
top: 400rpx;
|
||||
left: 220rpx;
|
||||
position: absolute;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.student-list button{
|
||||
position: absolute;
|
||||
top: 100rpx;
|
||||
background-color: rgba(234, 0, 255, 0.171);
|
||||
}
|
||||
|
||||
.student-item {
|
||||
margin-bottom: 20rpx;
|
||||
opacity: 0.5; /* 默认透明度 */
|
||||
}
|
||||
|
||||
.selected {
|
||||
opacity: 1; /* 选中的透明度 */
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.student-name {
|
||||
position: absolute;
|
||||
top: 100rpx;
|
||||
left: 220rpx;
|
||||
font-size: 80rpx;
|
||||
text-align: center;
|
||||
margin: 20rpx 0;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.tip {
|
||||
font-size: 40rpx;
|
||||
position: absolute;
|
||||
top: 623rpx;
|
||||
left: 200rpx;
|
||||
}
|
||||
|
||||
.number {
|
||||
height: 100rpx;
|
||||
font-size: 40rpx;
|
||||
position: absolute;
|
||||
top: 600rpx;
|
||||
left: 400rpx;
|
||||
}
|
||||
|
||||
.confirmPoint {
|
||||
position: absolute;
|
||||
top: 700rpx;
|
||||
left: 220rpx;
|
||||
background-color: rgba(222, 184, 135, 0.699);
|
||||
}
|
||||
|
||||
.return {
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
bottom: 40rpx;
|
||||
display: inline-block;
|
||||
padding: 10rpx 50rpx; /* 调整内边距以改变按钮大小 */
|
||||
font-size: 40rpx;
|
||||
color: rgba(0, 0, 0, 1);
|
||||
background-color: #ffae00; /* 按钮背景色 */
|
||||
border: none;
|
||||
border-radius: 100rpx; /* 初始设置为圆角矩形 */
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
overflow: hidden; /* 隐藏超出按钮范围的内容 */
|
||||
}
|
||||
.return:before {
|
||||
left: -10rpx; /* 圆形部分在按钮左侧的位置 */
|
||||
}
|
||||
|
||||
.return:after {
|
||||
right: -10px; /* 圆形部分在按钮右侧的位置 */
|
||||
}
|
||||
|
||||
.return:hover {
|
||||
background-color: #b30000; /* 鼠标悬停时按钮的背景色 */
|
||||
}
|
||||
|
||||
.return:hover:before,
|
||||
.return:hover:after {
|
||||
background-color: #b30000; /* 鼠标悬停时圆形部分的背景色 */
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
Component({
|
||||
properties: {
|
||||
visible: {
|
||||
type: Boolean,
|
||||
value: false
|
||||
},
|
||||
classList: {
|
||||
type: Array,
|
||||
value: []
|
||||
}
|
||||
},
|
||||
data: {
|
||||
selectedClassName: ''
|
||||
},
|
||||
methods: {
|
||||
selectClass(e) {
|
||||
this.setData({
|
||||
selectedClassName: e.currentTarget.dataset.name
|
||||
});
|
||||
},
|
||||
confirmSelection() {
|
||||
if (this.data.selectedClassName) {
|
||||
this.triggerEvent('confirm', { className: this.data.selectedClassName });
|
||||
this.setData({ visible: false }); // 隐藏弹窗
|
||||
} else {
|
||||
wx.showToast({
|
||||
title: '请选择班级',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
cancelSelection() {
|
||||
this.setData({ visible: false }); // 隐藏弹窗
|
||||
this.triggerEvent('cancel'); // 可选:触发取消事件
|
||||
}
|
||||
}
|
||||
});
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<view class="class-selector-overlay" wx:if="{{visible}}">
|
||||
<view class="class-selector">
|
||||
<view class="class-list">
|
||||
<block wx:for="{{classList}}" wx:key="index">
|
||||
<view class="class-item {{item.name === selectedClassName ? 'selected' : ''}}" bindtap="selectClass" data-name="{{item.name}}">{{item.name}}</view>
|
||||
</block>
|
||||
</view>
|
||||
<view class="class-selector-buttons">
|
||||
<button bindtap="confirmSelection">确定</button>
|
||||
<button bindtap="cancelSelection">取消</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,33 @@
|
||||
/* 添加适当的样式来定位和美化弹窗 */
|
||||
.class-selector-overlay {
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
background: rgba(0, 0, 0, 0.5);
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.class-selector {
|
||||
background: white;
|
||||
padding: 20px;
|
||||
border-radius: 10px;
|
||||
/* 其他样式 */
|
||||
}
|
||||
|
||||
.class-item {
|
||||
/* 班级项的默认样式 */
|
||||
margin: 10rpx;
|
||||
padding: 10rpx;
|
||||
border-bottom: 1px solid rgb(21, 255, 0);
|
||||
}
|
||||
|
||||
.class-item.selected {
|
||||
/* 选中后的样式 */
|
||||
background-color: #007aff; /* 例如,蓝色背景 */
|
||||
color: white; /* 白色文字 */
|
||||
}
|
||||
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
<!--pages/class_manage/class_manage.wxml-->
|
||||
<view class="bg">
|
||||
<image src="/pages/images/class_manage.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<text class="class_list">班级列表</text>
|
||||
<button class="add" bindtap="showModal1">添加班级</button>
|
||||
<view class="list">
|
||||
<view class="class_item" wx:for="{{classList}}" wx:key="index" bindtap="showAndGet" data-index="{{index}}">
|
||||
<text>{{item.name}}</text>
|
||||
<image class="arrow-icon" src="/pages/images/arrow_icon.png"/>
|
||||
</view>
|
||||
</view>
|
||||
<modal hidden="{{!showModal1}}" title="添加班级" bindcancel="hideModal1" bindconfirm="addClass">
|
||||
<view class="modal-input">
|
||||
<input placeholder="输入班级名称" bindinput="inputChange" class="first_modal"/>
|
||||
</view>
|
||||
</modal>
|
||||
<modal hidden="{{!showModal2}}" title="修改班级名称" bindcancel="hideModal2" bindconfirm="change_name">
|
||||
<view class="modal-input">
|
||||
<input placeholder="输入班级名称" bindinput="inputChange" class="first_modal"/>
|
||||
</view>
|
||||
</modal>
|
||||
<view class="hide" wx:if="{{showElement}}">
|
||||
<button class="hide_item" bindtap="goToadd_stu">添加学生</button>
|
||||
<button class="hide_item" bindtap="goToclass_message">查看详情</button>
|
||||
<button class="hide_item" bindtap="delete_class">删除班级</button>
|
||||
<button class="hide_item" bindtap="showModal2">修改班级名称</button>
|
||||
</view>
|
||||
</view>
|
||||
|
@ -0,0 +1,139 @@
|
||||
/* pages/class_manage/class_manage.wxss */
|
||||
/* page覆盖全页面 */
|
||||
page{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.bg image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.class_list {
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 10rpx;
|
||||
font-size: 65rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
|
||||
.add {
|
||||
position: absolute;
|
||||
right: 10rpx;
|
||||
top: 30rpx;
|
||||
display: inline-block;
|
||||
padding: 10rpx 50rpx; /* 调整内边距以改变按钮大小 */
|
||||
font-size: 40rpx;
|
||||
color: rgba(0, 0, 0, 1);
|
||||
background-color: #ffae00; /* 按钮背景色 */
|
||||
border: none;
|
||||
border-radius: 100rpx; /* 初始设置为圆角矩形 */
|
||||
text-align: center;
|
||||
text-decoration: none;
|
||||
overflow: hidden; /* 隐藏超出按钮范围的内容 */
|
||||
}
|
||||
.add:before {
|
||||
left: -10rpx; /* 圆形部分在按钮左侧的位置 */
|
||||
}
|
||||
|
||||
.add:after {
|
||||
right: -10px; /* 圆形部分在按钮右侧的位置 */
|
||||
}
|
||||
|
||||
.add:hover {
|
||||
background-color: #b30000; /* 鼠标悬停时按钮的背景色 */
|
||||
}
|
||||
|
||||
.add:hover:before,
|
||||
.add:hover:after {
|
||||
background-color: #b30000; /* 鼠标悬停时圆形部分的背景色 */
|
||||
}
|
||||
|
||||
.modal-input {
|
||||
margin: 50rpx;
|
||||
}
|
||||
|
||||
.first_modal {
|
||||
border: 1rpx solid #ccc;
|
||||
padding: 0rpx;
|
||||
border-radius: 5rpx;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
height: 100rpx;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
|
||||
.list {
|
||||
width: 100%;
|
||||
position: absolute;
|
||||
top: 120rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.class_item {
|
||||
width: 100%;
|
||||
padding: 20rpx;
|
||||
background-color: #ffffff34;
|
||||
margin-bottom: 5rpx;
|
||||
border-radius: 5rpx;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
}
|
||||
.class_item text {
|
||||
font-size: 50rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.class_item image {
|
||||
width: 40rpx;
|
||||
height: 40rpx;
|
||||
object-fit: cover;
|
||||
position: absolute;
|
||||
right: 20rpx;
|
||||
margin: 13rpx;
|
||||
}
|
||||
|
||||
.hide {
|
||||
width: 100%;
|
||||
height: 500rpx;
|
||||
position: absolute;
|
||||
bottom: 40rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.hide_item {
|
||||
width: 600rpx;
|
||||
margin: 10rpx 0;
|
||||
padding: 10rpx;
|
||||
font-size: 55rpx;
|
||||
/* transition: font-style 0.3s; */
|
||||
background-color: transparent;
|
||||
color: rgb(255, 255, 255);
|
||||
}
|
||||
.hide_item:hover {
|
||||
font-style: italic;
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
<!--pages/class_message/class_message.wxml-->
|
||||
<view class="bg">
|
||||
<image src="/pages/images/class_message.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
<view class="container">
|
||||
<view class="stu_list" wx:for="{{students}}" wx:for-item="item" wx:key="id">
|
||||
<text class="id">{{item.id}}</text>
|
||||
<text class="name">{{item.name}}</text>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,38 @@
|
||||
/* pages/class_message/class_message.wxss */
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.bg image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.stu_list {
|
||||
font-size: 60rpx;
|
||||
}
|
||||
.stu_list .id {
|
||||
position: relative;
|
||||
left: 50rpx;
|
||||
}
|
||||
|
||||
.stu_list .name {
|
||||
position: relative;
|
||||
left: 150rpx;
|
||||
}
|
||||
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"component": true,
|
||||
"usingComponents": {"class-selector" :"/pages/classSelector/classSelector"}
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
<!-- pages/function/function.wxml -->
|
||||
|
||||
<view class="bg">
|
||||
<image src="/pages/images/function.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
<view class="container">
|
||||
<view class="text">
|
||||
<text class="title">首</text>
|
||||
<text class="title">页</text>
|
||||
</view>
|
||||
<view class="menu">
|
||||
<button class="menu-item" bindtap="goToclass_manage">班级管理</button>
|
||||
<button class="menu-item" bindtap="goTocall_roll">随机点名</button>
|
||||
<button class="menu-item" bindtap="goTorecord">考勤管理</button>
|
||||
</view>
|
||||
<class-selector visible="{{classSelectorVisible1}}" classList="{{classList}}" bind:confirm="handleClassConfirm1" bind:cancel="handleClassCancel1"></class-selector> <class-selector visible="{{classSelectorVisible2}}" classList="{{classList}}" bind:confirm="handleClassConfirm2" bind:cancel="handleClassCancel2"></class-selector>
|
||||
</view>
|
@ -0,0 +1,70 @@
|
||||
/* pages/function/function.wxss */
|
||||
/* pages/function/function.wxss */
|
||||
page{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.bg image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
/* 把默认的padding: 200rpx 0;改掉 */
|
||||
padding: 0 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.text {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 20rpx;
|
||||
left: 40rpx;
|
||||
}
|
||||
|
||||
.title {
|
||||
/* 设置字体粗细 */
|
||||
font-weight: bold;
|
||||
padding: 10rpx 0;
|
||||
font-size: 80rpx;
|
||||
}
|
||||
|
||||
.menu {
|
||||
width: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
position: absolute;
|
||||
top: 300rpx;
|
||||
}
|
||||
|
||||
.menu-item {
|
||||
margin: 10rpx 0;
|
||||
padding: 10rpx;
|
||||
font-size: 65rpx;
|
||||
/* transition: font-style 0.3s; */
|
||||
background-color: transparent;
|
||||
/* 相对定位 */
|
||||
position: relative;
|
||||
right: 210rpx;
|
||||
}
|
||||
|
||||
.menu-item:hover {
|
||||
font-style: italic;
|
||||
}
|
After Width: | Height: | Size: 248 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 349 KiB |
After Width: | Height: | Size: 218 KiB |
After Width: | Height: | Size: 291 KiB |
After Width: | Height: | Size: 3.8 KiB |
After Width: | Height: | Size: 30 KiB |
After Width: | Height: | Size: 314 KiB |
After Width: | Height: | Size: 106 KiB |
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
}
|
||||
}
|
@ -0,0 +1,27 @@
|
||||
<!--index.wxml-->
|
||||
<scroll-view class="scrollarea" scroll-y type="list">
|
||||
<view class="container">
|
||||
<view class="userinfo">
|
||||
<block wx:if="{{canIUseNicknameComp && !hasUserInfo}}">
|
||||
<button class="avatar-wrapper" open-type="chooseAvatar" bind:chooseavatar="onChooseAvatar">
|
||||
<image class="avatar" src="{{userInfo.avatarUrl}}"></image>
|
||||
</button>
|
||||
<view class="nickname-wrapper">
|
||||
<text class="nickname-label">昵称</text>
|
||||
<input type="nickname" class="nickname-input" placeholder="请输入昵称" bind:change="onInputChange" />
|
||||
</view>
|
||||
</block>
|
||||
<block wx:elif="{{!hasUserInfo}}">
|
||||
<button wx:if="{{canIUseGetUserProfile}}" bindtap="getUserProfile"> 获取头像昵称 </button>
|
||||
<view wx:else> 请使用2.10.4及以上版本基础库 </view>
|
||||
</block>
|
||||
<block wx:else>
|
||||
<image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
|
||||
<text class="userinfo-nickname">{{userInfo.nickName}}</text>
|
||||
</block>
|
||||
</view>
|
||||
<view class="usermotto">
|
||||
<text class="user-motto">{{motto}}</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
@ -0,0 +1,62 @@
|
||||
/**index.wxss**/
|
||||
page {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.scrollarea {
|
||||
flex: 1;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
|
||||
.userinfo {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
color: #aaa;
|
||||
width: 80%;
|
||||
}
|
||||
|
||||
.userinfo-avatar {
|
||||
overflow: hidden;
|
||||
width: 128rpx;
|
||||
height: 128rpx;
|
||||
margin: 20rpx;
|
||||
border-radius: 50%;
|
||||
}
|
||||
|
||||
.usermotto {
|
||||
margin-top: 200px;
|
||||
}
|
||||
|
||||
.avatar-wrapper {
|
||||
padding: 0;
|
||||
width: 56px !important;
|
||||
border-radius: 8px;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 40px;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
display: block;
|
||||
width: 56px;
|
||||
height: 56px;
|
||||
}
|
||||
|
||||
.nickname-wrapper {
|
||||
display: flex;
|
||||
width: 100%;
|
||||
padding: 16px;
|
||||
box-sizing: border-box;
|
||||
border-top: .5px solid rgba(0, 0, 0, 0.1);
|
||||
border-bottom: .5px solid rgba(0, 0, 0, 0.1);
|
||||
color: black;
|
||||
}
|
||||
|
||||
.nickname-label {
|
||||
width: 105px;
|
||||
}
|
||||
|
||||
.nickname-input {
|
||||
flex: 1;
|
||||
}
|
@ -0,0 +1,18 @@
|
||||
// logs.js
|
||||
const util = require('../../utils/util.js')
|
||||
|
||||
Page({
|
||||
data: {
|
||||
logs: []
|
||||
},
|
||||
onLoad() {
|
||||
this.setData({
|
||||
logs: (wx.getStorageSync('logs') || []).map(log => {
|
||||
return {
|
||||
date: util.formatTime(new Date(log)),
|
||||
timeStamp: log
|
||||
}
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
@ -0,0 +1,4 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
}
|
||||
}
|
@ -0,0 +1,6 @@
|
||||
<!--logs.wxml-->
|
||||
<scroll-view class="scrollarea" scroll-y type="list">
|
||||
<block wx:for="{{logs}}" wx:key="timeStamp" wx:for-item="log">
|
||||
<view class="log-item">{{index + 1}}. {{log.date}}</view>
|
||||
</block>
|
||||
</scroll-view>
|
@ -0,0 +1,16 @@
|
||||
page {
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.scrollarea {
|
||||
flex: 1;
|
||||
overflow-y: hidden;
|
||||
}
|
||||
.log-item {
|
||||
margin-top: 20rpx;
|
||||
text-align: center;
|
||||
}
|
||||
.log-item:last-child {
|
||||
padding-bottom: env(safe-area-inset-bottom);
|
||||
}
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,13 @@
|
||||
<!--pages/record/record.wxml-->
|
||||
<view class="bg">
|
||||
<image src="/pages/images/record.png" mode="aspectFill"></image>
|
||||
</view>
|
||||
|
||||
<view class="container">
|
||||
<text class="title">出勤状况</text>
|
||||
<view class="stu_list" wx:for="{{students}}" wx:for-item="item" wx:key="id">
|
||||
<text class="id">{{item.id}}</text>
|
||||
<text class="name">{{item.name}}</text>
|
||||
<text class="point">积分数:{{item.point}}</text>
|
||||
</view>
|
||||
</view>
|
@ -0,0 +1,49 @@
|
||||
/* pages/record/record.wxss */
|
||||
.bg {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
position: fixed;
|
||||
top: 0;
|
||||
left: 0;
|
||||
z-index: -1;
|
||||
}
|
||||
|
||||
.bg image {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 100%;
|
||||
height: 100vh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
padding: 0 0;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.title {
|
||||
font-size: 80rpx;
|
||||
font-weight: bold;
|
||||
margin: 80rpx;
|
||||
}
|
||||
|
||||
.stu_list {
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.stu_list .id {
|
||||
position: relative;
|
||||
left: 50rpx;
|
||||
}
|
||||
|
||||
.stu_list .name {
|
||||
position: relative;
|
||||
left: 120rpx;
|
||||
}
|
||||
|
||||
.stu_list .point {
|
||||
position: absolute;
|
||||
left: 500rpx;
|
||||
}
|
||||
|
@ -0,0 +1,9 @@
|
||||
// pages/welcome/welcome.js
|
||||
Page({
|
||||
// 跳转到功能页面的函数
|
||||
goToFunction: function() {
|
||||
wx.navigateTo({
|
||||
url: '/pages/function/function' // 跳转function页面
|
||||
});
|
||||
}
|
||||
});
|
@ -0,0 +1,3 @@
|
||||
{
|
||||
"usingComponents": {}
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
<!-- pages/index/index.wxml -->
|
||||
<!-- view绑定触发函数 -->
|
||||
<view class="page-container" bindtap="goToFunction">
|
||||
<image src="/pages/images/welcome.png" mode="cover" class="background-image" />
|
||||
</view>
|
@ -0,0 +1,21 @@
|
||||
/* pages/index/index.wxss */
|
||||
page{
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
.page-container {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
width: 100%; /* 宽度100% */
|
||||
height: 100%; /* 高度100% */
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.background-image {
|
||||
width: 100%; /* 宽度100% */
|
||||
height: 100%; /* 高度100% */
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
{
|
||||
"compileType": "miniprogram",
|
||||
"libVersion": "trial",
|
||||
"packOptions": {
|
||||
"ignore": [],
|
||||
"include": []
|
||||
},
|
||||
"setting": {
|
||||
"coverView": true,
|
||||
"es6": true,
|
||||
"postcss": true,
|
||||
"minified": true,
|
||||
"enhance": true,
|
||||
"showShadowRootInWxmlPanel": true,
|
||||
"packNpmRelationList": [],
|
||||
"babelSetting": {
|
||||
"ignore": [],
|
||||
"disablePlugins": [],
|
||||
"outputPath": ""
|
||||
}
|
||||
},
|
||||
"condition": {},
|
||||
"editorSetting": {
|
||||
"tabIndent": "auto",
|
||||
"tabSize": 2
|
||||
},
|
||||
"appid": "wx008217ca2c2b30d3"
|
||||
}
|
@ -0,0 +1,7 @@
|
||||
{
|
||||
"desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html",
|
||||
"rules": [{
|
||||
"action": "allow",
|
||||
"page": "*"
|
||||
}]
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
const formatTime = date => {
|
||||
const year = date.getFullYear()
|
||||
const month = date.getMonth() + 1
|
||||
const day = date.getDate()
|
||||
const hour = date.getHours()
|
||||
const minute = date.getMinutes()
|
||||
const second = date.getSeconds()
|
||||
|
||||
return `${[year, month, day].map(formatNumber).join('/')} ${[hour, minute, second].map(formatNumber).join(':')}`
|
||||
}
|
||||
|
||||
const formatNumber = n => {
|
||||
n = n.toString()
|
||||
return n[1] ? n : `0${n}`
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
formatTime
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.demo;
|
||||
|
||||
import org.mybatis.spring.annotation.MapperScan;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@SpringBootApplication
|
||||
@MapperScan("com.demo.mapper")
|
||||
|
||||
public class DemoApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(DemoApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.demo.controller;
|
||||
|
||||
import com.demo.entity.Clazz;
|
||||
import com.demo.entity.Student;
|
||||
import com.demo.mapper.ClazzMapper;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/clazz")
|
||||
public class ClazzController {
|
||||
@Resource
|
||||
ClazzMapper clazzMapper;
|
||||
|
||||
@PostMapping("/save")
|
||||
public String addClazz(@RequestBody Clazz clazz){
|
||||
clazzMapper.save(clazz);
|
||||
return "success";
|
||||
}
|
||||
@GetMapping("/list")
|
||||
public List<Clazz> getClazz(){
|
||||
return clazzMapper.findAll();
|
||||
}
|
||||
@DeleteMapping("/{name}")
|
||||
public String deleteClazz(@PathVariable("name") String name){
|
||||
clazzMapper.deleteByname(name);
|
||||
return "success";
|
||||
}
|
||||
@PutMapping("/update")
|
||||
public String updateClazz(@RequestBody Clazz clazz){
|
||||
clazzMapper.updateById(clazz);
|
||||
return "success";
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
package com.demo.controller;
|
||||
|
||||
import cn.hutool.poi.excel.ExcelReader;
|
||||
import cn.hutool.poi.excel.ExcelUtil;
|
||||
import com.demo.entity.Student;
|
||||
import com.demo.mapper.StudentMapper;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.io.InputStream;
|
||||
import java.nio.channels.MulticastChannel;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/excel")
|
||||
@CrossOrigin(origins = "*")
|
||||
public class ExcelController {
|
||||
@Resource
|
||||
private StudentMapper studentMapper;
|
||||
@PostMapping("/import")
|
||||
public void imp(@RequestBody MultipartFile file)throws Exception{
|
||||
InputStream inputStream = file.getInputStream();
|
||||
ExcelReader reader = ExcelUtil.getReader(inputStream);
|
||||
List<Student> students = reader.readAll(Student.class);
|
||||
studentMapper.batchInsert(students);
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
package com.demo.controller;
|
||||
|
||||
import com.demo.entity.Clazz;
|
||||
import com.demo.entity.Student;
|
||||
import com.demo.mapper.StudentMapper;
|
||||
import lombok.SneakyThrows;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
import org.springframework.web.multipart.MultipartFile;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.util.List;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/student")
|
||||
public class StudentController {
|
||||
@Resource
|
||||
StudentMapper studentMapper;
|
||||
@GetMapping
|
||||
public List<Student> getStudent(){
|
||||
return studentMapper.findAll();
|
||||
}
|
||||
@PostMapping("/set")
|
||||
public String addStudent(@RequestBody Student student){
|
||||
studentMapper.save(student);
|
||||
return "success";
|
||||
}
|
||||
@GetMapping("/{clazz}")
|
||||
public List<Student> getStudent1(@PathVariable("clazz") String clazz){
|
||||
|
||||
return studentMapper.findByclazz(clazz);
|
||||
}
|
||||
@PutMapping("/update")
|
||||
public String updateStudent(@RequestBody Student student){
|
||||
studentMapper.updateByname(student);
|
||||
return "success";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,9 @@
|
||||
package com.demo.entity;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class Clazz {
|
||||
private String name;
|
||||
private int id;
|
||||
}
|
@ -0,0 +1,16 @@
|
||||
package com.demo.entity;
|
||||
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Student {
|
||||
private String id;
|
||||
private String name;
|
||||
private int point;
|
||||
private String clazz;
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package com.demo.mapper;
|
||||
|
||||
import com.demo.entity.Clazz;
|
||||
import com.demo.entity.Student;
|
||||
import org.apache.ibatis.annotations.Delete;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import org.springframework.web.bind.annotation.PathVariable;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface ClazzMapper {
|
||||
@Select("select * from classes")
|
||||
List<Clazz> findAll();
|
||||
@Insert("INSERT INTO classes (name) VALUES (#{name});")
|
||||
@Transactional
|
||||
void save(Clazz clazz);
|
||||
@Delete("delete from classes where name = #{name}")
|
||||
void deleteByname(String name);
|
||||
@Update("update classes set name = #{name} where id = #{id}")
|
||||
@Transactional
|
||||
void updateById(Clazz clazz);
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
package com.demo.mapper;
|
||||
|
||||
import com.demo.entity.Clazz;
|
||||
import com.demo.entity.Student;
|
||||
import org.apache.ibatis.annotations.Insert;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
import org.apache.ibatis.annotations.Select;
|
||||
import org.apache.ibatis.annotations.Update;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public interface StudentMapper {
|
||||
@Select("select * from students")
|
||||
List<Student> findAll();
|
||||
|
||||
@Insert("INSERT INTO students (`id`, `name`, `point`, `clazz`) VALUES (#{id},#{name},#{point},#{clazz});")
|
||||
@Transactional
|
||||
void save(Student student);
|
||||
|
||||
@Select("select * from students where clazz = #{clazz}")
|
||||
List<Student> findByclazz(String clazz);
|
||||
|
||||
@Update("update students set point = #{point} where name = #{name}")
|
||||
@Transactional
|
||||
void updateByname(Student student);
|
||||
|
||||
@Insert({
|
||||
"<script>",
|
||||
"INSERT INTO students (id, name, point, clazz) VALUES ",
|
||||
"<foreach collection='list' item='student' separator=','>",
|
||||
"(#{student.id}, #{student.name}, #{student.point}, #{student.clazz})",
|
||||
"</foreach>",
|
||||
"</script>"
|
||||
})
|
||||
void batchInsert(@Param("list") List<Student> list);
|
||||
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
server:
|
||||
port: 8090
|
||||
spring:
|
||||
datasource:
|
||||
driver-class-name: com.mysql.cj.jdbc.Driver
|
||||
url: jdbc:mysql://localhost:3306/demo?serverTimezone=GMT%2B8&characterEncoding=utf-8&useSSL=false
|
||||
username: root
|
||||
password: 123456
|
@ -0,0 +1,13 @@
|
||||
package com.demo;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class DemoApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|