陈建宇 1 month ago
parent 8a7eec60b5
commit 1672533caf

@ -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,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,45 @@
{
"entryPagePath": "pages/course_detail/course_detail",
"pages": [
"pages/course/course",
"pages/my/my",
"pages/course_detail/course_detail",
"pages/student_info/student_info",
"pages/login/login",
"pages/forget/forget",
"pages/register/register",
"pages/choose_name/choose_name",
"pages/call_the_name(1)/call_the_name(1)",
"pages/call_the_name(2)/call_the_name(2)",
"pages/call_the_name(3)/call_the_name(3)"
],
"window": {
"navigationBarTitleText": "点名系统",
"navigationBarBackgroundColor": "#f3514f",
"enablePullDownRefresh": true,
"backgroundColor": "#efefef",
"backgroundTextStyle":"dark"
},
"tabBar": {
"selectedColor": "f3514f",
"color": "#666",
"list":[
{
"text": "课程",
"pagePath": "pages/course/course",
"iconPath": "/assets/tabbar/课程1.png",
"selectedIconPath": "/assets/tabbar/课程2.png"
},
{
"text": "我的",
"pagePath": "pages/my/my",
"iconPath": "/assets/tabbar/我的1.png",
"selectedIconPath": "/assets/tabbar/我的2.png"
}
]
},
"style": "v2",
"componentFramework": "glass-easel",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
}

@ -0,0 +1,10 @@
/**app.wxss**/
.container {
height: 100%;
display: flex;
flex-direction: column;
align-items: center;
justify-content: space-between;
padding: 200rpx 0;
box-sizing: border-box;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

File diff suppressed because one or more lines are too long

@ -0,0 +1,85 @@
// pages/call_the_name(1)/call_the_name(1).js
Page({
/**
* 页面的初始数据
*/
data: {
studentId : "102201111",
name: "王伊瑜",
},
addScore1: function() {
this.setData ({
studentId: "102201351",
name: "吴尔贰"
})
},
addScore2: function() {
this.setData ({
studentId: "102201511",
name: "张飞"
})
},
addScore3: function() {
this.setData ({
studentId: "102201201",
name: "李四"
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,34 @@
/* pages/call_the_name(1)/call_the_name(1).wxss */
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 150rpx;
}
.top {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.top_detail {
font-size:45rpx;
padding: 20rpx;
}
.option_detail {
width: 400rpx; /* 根据需要调整宽度 */
height: 100rpx; /* 根据需要调整高度 */
border: 1px solid #000000; /* 边框颜色 */
border-radius: 15rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-top: 80rpx; /* 组件上外边距 */
font-size: 40rpx;
}

@ -0,0 +1,12 @@
<!--pages/call_the_name(1)/call_the_name(1).wxml-->
<view class="container">
<view class="top">
<view class="top_detail">学号:{{studentId}}</view>
<view class="top_detail">姓名:{{name}}</view>
</view>
<view class="option">
<button class="option_detail" bindtap="addScore1">-0.3分</button>
<button class="option_detail" bindtap="addScore2">0分</button>
<button class="option_detail" bindtap="addScore3">+0.3分</button>
</view>
</view>

@ -0,0 +1,85 @@
// pages/call_the_name(1)/call_the_name(1).js
Page({
/**
* 页面的初始数据
*/
data: {
studentId : "102201199",
name: "箬玉",
},
addScore1: function() {
this.setData ({
studentId: "102201579",
name: "陈贵林"
})
},
addScore2: function() {
this.setData ({
studentId: "102201329",
name: "林克"
})
},
addScore3: function() {
this.setData ({
studentId: "102201209",
name: "吴强"
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,34 @@
/* pages/call_the_name(1)/call_the_name(1).wxss */
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 150rpx;
}
.top {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.top_detail {
font-size:45rpx;
padding: 20rpx;
}
.option_detail {
width: 400rpx; /* 根据需要调整宽度 */
height: 100rpx; /* 根据需要调整高度 */
border: 1px solid #000000; /* 边框颜色 */
border-radius: 15rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-top: 80rpx; /* 组件上外边距 */
font-size: 40rpx;
}

@ -0,0 +1,12 @@
<!--pages/call_the_name(1)/call_the_name(1).wxml-->
<view class="container">
<view class="top">
<view class="top_detail">学号:{{studentId}}</view>
<view class="top_detail">姓名:{{name}}</view>
</view>
<view class="option">
<button class="option_detail" bindtap="addScore1">-0.3分</button>
<button class="option_detail" bindtap="addScore2">0分</button>
<button class="option_detail" bindtap="addScore3">+0.3分</button>
</view>
</view>

@ -0,0 +1,85 @@
// pages/call_the_name(1)/call_the_name(1).js
Page({
/**
* 页面的初始数据
*/
data: {
studentId : "102301124",
name: "陈非",
},
addScore1: function() {
this.setData ({
studentId: "102301514",
name: "陈麟"
})
},
addScore2: function() {
this.setData ({
studentId: "102301314",
name: "陈苣"
})
},
addScore3: function() {
this.setData ({
studentId: "102303333",
name: "陈釰"
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,34 @@
/* pages/call_the_name(1)/call_the_name(1).wxss */
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 150rpx;
}
.top {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.top_detail {
font-size:45rpx;
padding: 20rpx;
}
.option_detail {
width: 400rpx; /* 根据需要调整宽度 */
height: 100rpx; /* 根据需要调整高度 */
border: 1px solid #000000; /* 边框颜色 */
border-radius: 15rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-top: 80rpx; /* 组件上外边距 */
font-size: 40rpx;
}

@ -0,0 +1,12 @@
<!--pages/call_the_name(1)/call_the_name(1).wxml-->
<view class="container">
<view class="top">
<view class="top_detail">学号:{{studentId}}</view>
<view class="top_detail">姓名:{{name}}</view>
</view>
<view class="option">
<button class="option_detail" bindtap="addScore1">-0.3分</button>
<button class="option_detail" bindtap="addScore2">0分</button>
<button class="option_detail" bindtap="addScore3">+0.3分</button>
</view>
</view>

@ -0,0 +1,93 @@
// pages/choose_name/choose_name.js
Page({
/**
* 页面的初始数据
*/
data: {
},
option2: function(e) {
wx.showModal({
editable:true,//显示输入框
placeholderText:'输入学号尾数',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content);//用户输入的值
wx.navigateTo({url: '/pages/call_the_name(2)/call_the_name(2)'});
} else {
console.log('用户点击了取消')
}
}
})
},
option3: function(e) {wx.showModal({
editable:true,//显示输入框
placeholderText:'输入姓氏',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content);//用户输入的值
wx.navigateTo({url: '/pages/call_the_name(3)/call_the_name(3)'});
} else {
console.log('用户点击了取消')
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,31 @@
page {
background-color: #eeeeee;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 150rpx;
}
.course_name {
position: relative;
margin-bottom: 35rpx; /* 组件下外边距 */
font-size: 50rpx;
}
.option {
width: 400rpx; /* 根据需要调整宽度 */
height: 120rpx; /* 根据需要调整高度 */
border: 1px solid #000000; /* 边框颜色 */
border-radius: 15rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-top: 80rpx; /* 组件上外边距 */
font-size: 40rpx;
}

@ -0,0 +1,6 @@
<view class="container">
<view class="course_name">请选择点名方式</view>
<navigator class="option" navigator url="/pages/call_the_name(1)/call_the_name(1)">随机点名</navigator>
<view class="option" bindtap="option2">根据学号尾数点名</view>
<view class="option" bindtap="option3">根据姓氏点名</view>
</view>

@ -0,0 +1,94 @@
Page({
/**
* 页面的初始数据
*/
data: {
courseList: []
},
enterCourse : function(event) {
const courseId = event.currentTarget.dataset.id;
const description = event.currentTarget.dataset.description;
wx.setStorageSync('courseId', courseId);
wx.setStorageSync('description', description);
console.log('courseId', courseId);
console.log('description', description);
wx.navigateTo({
url: '/pages/course_detail/course_detail'
});
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getCourseList();
},
getCourseList: function() {
const that = this;
wx.request({
url: 'http://10.133.23.136:8888/admin/courseList',
method: 'GET',
success: function(res) {
if (res.statusCode === 200) {
console.log(res.data.data);
that.setData({
courseList: res.data.data
});
}
},
fail: function(error) {
console.error('请求失败:', error);
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,4 @@
{
"usingComponents": {
}
}

@ -0,0 +1,41 @@
page {
height: 100vh;
background-color: #eeeeee;
display: flex;
flex-direction: column;
align-items: center;
}
//
.course {
width: 650rpx !important; /* 根据需要调整宽度 */
height: 120rpx; /* 根据需要调整高度 */
border: 1px solid #bbbbbb; /* 边框颜色 */
border-radius: 15rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
flex-direction: row;
align-items: center; /* 组件垂直居中 */
position: relative;
margin-top: 35rpx; /* 组件上外边距 */
}
.icon1 {
width: 60rpx;
height: 60rpx;
position: absolute;
left: 3%;
}
.name {
font-size: 40;
position: absolute;
left: 15%;
}
.icon2 {
width: 60rpx;
height: 60rpx;
position: absolute;
right: 0%;
}

@ -0,0 +1,7 @@
<view wx:for="{{courseList}}" wx:key="unique">
<button class="course" bindtap="enterCourse" data-id="{{item.courseId}}" data-description="{{item.description}}">
<image class="icon1" src="/assets/course/多栏明细账.png" mode="aspectFit"/>
<text class="name">{{item.description}}</text>
<image class="icon2" src="/assets/course/arrow-right.png" mode="aspectFit"/>
</button>
</view>

@ -0,0 +1,135 @@
// pages/course_detail/course_detail.js
const app = getApp()
Page({
/**
* 页面的初始数据
*/
data: {
showModalStatus: false,
studentId: "",
name: "",
description: ""
},
studentId: function(e) {
this.setData({
studentId: e.detail.value
});
console.log("studentId:", e.detail.value);
},
name: function(e) {
this.setData({
name: e.detail.value
});
console.log("name:", e.detail.value);
},
cancel: function (e) {
var currentStatu = e.currentTarget.dataset.statu;
this.util(currentStatu)
},
update: function (e) {
var currentStatu = e.currentTarget.dataset.statu;
this.util(currentStatu)
/* 下面补充确定后向后端传输数据*/
},
util: function (currentStatu) {
/* 动画部分 */
// 第1步创建动画实例
var animation = wx.createAnimation({
duration: 200, //动画时长
timingFunction: "linear", //线性
delay: 0 //0则不延迟
});
// 第2步这个动画实例赋给当前的动画实例
this.animation = animation;
// 第3步执行第一组动画
animation.opacity(0).rotateX(-100).step();
// 第4步导出动画对象赋给数据对象储存
this.setData({
animationData: animation.export()
})
// 第5步设置定时器到指定时候后执行第二组动画
setTimeout(function () {
// 执行第二组动画
animation.opacity(1).rotateX(0).step();
// 给数据对象储存的第一组动画,更替为执行完第二组动画的动画对象
this.setData({
animationData: animation
})
//关闭
if (currentStatu == "close") {
this.setData({
showModalStatus: false
});
}
}.bind(this), 200)
// 显示
if (currentStatu == "open") {
this.setData({
showModalStatus: true
});
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.setData ({
description: wx.getStorageSync("description")
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,114 @@
page {
background-color: #eeeeee;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 150rpx;
}
.course_name {
position: relative;
margin-bottom: 35rpx; /* 组件下外边距 */
font-size: 50rpx;
}
.option {
width: 400rpx; /* 根据需要调整宽度 */
height: 120rpx; /* 根据需要调整高度 */
border: 1px solid #000000; /* 边框颜色 */
border-radius: 15rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-top: 80rpx; /* 组件上外边距 */
font-size: 40rpx;
}
/* 隐藏内容样式 */
/*mask*/
.drawer_screen {
width: 100%;
height: 100%;
position: fixed;
top: 0;
left: 0;
z-index: 1000;
background: #000;
opacity: 0.5;
overflow: hidden;
}
/*content*/
.animation_position{
display: flex;
width:100%;
justify-content: center;
}
.drawer_box{
overflow: hidden;
position: fixed;
/* top:80px; */
bottom: 400rpx;
z-index: 1000;
background: #FAFAFA;
border-radius: 30rpx;
width: 80%;
}
.drawer_title {
padding: 30rpx;
font: 20px "microsoft yahei";
text-align: center;
}
.drawer_content {
}
.btn {
width: 100%;
display: flex;
align-items: center;
justify-content: space-around;
}
.btn_no {
width:50%;
padding: 20rpx;
font: 20px "microsoft yahei";
text-align: center;
border-top: 1rpx solid #CBCBCB;
border-right: 1rpx solid #CBCBCB;
color: #40A4D6;
}
.btn_yes {
width:50%;
padding: 20rpx;
font: 20px "microsoft yahei";
text-align: center;
border-top: 1rpx solid #CBCBCB;
border-left: 1rpx solid #CBCBCB;
color: #40A4D6;
}
.input_group {
margin-bottom: 40rpx;
display: flex;
flex-wrap: wrap;
flex-direction: column;
}
.label {
margin-bottom: 15rpx;
position: relative;
left: 8%;
}
.input {
width: 80%;
align-self: center;
padding: 10px;
border: 1rpx solid #ccc;
border-radius: 15rpx;
}

@ -0,0 +1,31 @@
<view class="container">
<view class="course_name">{{description}}</view>
<navigator class="option" navigator url="/pages/student_info/student_info">查看学生信息</navigator>
<view class="option" bindtap="update" data-statu="open">添加学生</view>
<navigator class="option" navigator url="/pages/choose_name/choose_name">点名</navigator>
</view>
<!--弹出框-->
<view class="drawer_screen" bindtap="update" data-statu="close" wx:if="{{showModalStatus}}"></view>
<!--content-->
<!--使用animation属性指定需要执行的动画-->
<view class="animation_position">
<view animation="{{animationData}}" class="drawer_box" wx:if="{{showModalStatus}}">
<!--drawer content-->
<view class="drawer_title">添加学生</view>
<view class="drawer_content">
<view class="input_group">
<view class="label">学生学号:</view>
<input class="input" bindblur="studentId" placeholder="请输入学生学号"></input>
</view>
<view class="input_group">
<view class="label">学生姓名:</view>
<input class="input" bindblur="name" placeholder="请输入学生姓名"></input>
</view>
</view>
<view class="btn">
<view class="btn_no" bindtap="cancel" data-statu="close">取消</view>
<view class="btn_yes" bindtap="update" data-statu="close">确定</view>
</view>
</view>
</view>

@ -0,0 +1,66 @@
// pages/forget/forget.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1 @@
/* pages/forget/forget.wxss */

@ -0,0 +1,2 @@
<!--pages/forget/forget.wxml-->
<text>pages/forget/forget.wxml</text>

@ -0,0 +1,53 @@
Page({
data: {
account: '',
password: ''
},
onAccountInput: function(e) {
this.setData({
account: e.detail.value
});
},
onPasswordInput: function(e) {
this.setData({
password: e.detail.value
});
},
onLogin: function() {
// 用户登录逻辑
console.log('登录账号:', this.data.account);
console.log('登录密码:', this.data.password);
// 这里可以添加实际的登录逻辑例如调用API
wx.request({
url: 'http://10.133.23.136:8888/admin/login',
method: 'POST',
data: {
adminId: this.data.account, // 管理员ID
password: this.data.password // 密码
},
success(res) {
console.log(res.data);
if (res.statusCode === 200) {
// 处理登录成功
wx.setStorageSync('token', res.data.data.token);
wx.switchTab({
url: '/pages/course/course',
});
} else {
// 处理错误情况
wx.showToast({
title: '登录失败',
icon: 'none'
});
}
},
fail(err) {
console.error(err);
wx.showToast({
title: '请求失败',
icon: 'none'
});
}
});
},
});

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,64 @@
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
padding-top: 25%;
}
.login-form {
width: 650rpx;
}
.title {
font-size: 24px;
margin-bottom: 20px;
text-align: center;
font-weight: 700;
}
.input-group {
margin-bottom: 15rpx;
}
.label {
margin-bottom: 5rpx;
}
.input {
width: 100%;
padding: 10rpx;
border: 1rpx solid #ccc;
border-radius: 4rpx;
}
.checkbox-group {
display: flex;
align-items: center;
margin-bottom: 30rpx;
font-size: 27rpx;
text-align: center;
}
.checkbox {
margin-right: 2rpx;
transform: scale(0.65,0.65);
}
.login-button {
width: 100%;
background-color: #2563EB;
color: white;
padding: 10rpx;
margin-bottom: 50rpx;
}
.options {
display: flex;
justify-content: space-between;
width: 100%;
max-width: 400rpx;
margin-left: 20%;
color: #2563EB;
}

@ -0,0 +1,21 @@
<view class="container">
<view class="login-form">
<view class="title">用户登录</view>
<view class="input-group">
<view class="label">账号</view>
<input class="input" type="text" placeholder="请输入账号" bindinput="onAccountInput"/>
</view>
<view class="input-group">
<view class="label">密码</view>
<input class="input" type="password" placeholder="请输入密码" bindinput="onPasswordInput"/>
</view>
<view class="checkbox-group">
<checkbox class="checkbox" checked="true" /> 记住我
</view>
<button class="login-button" bindtap="onLogin">登录</button>
<view class="options">
<navigator url="/pages/forget/forget">忘记密码?</navigator>
<navigator url="/pages/register/register">注册新账户</navigator>
</view>
</view>
</view>

@ -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,66 @@
// pages/my/my.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,47 @@
page {
background-color: #eeeeee;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 150rpx;
}
.course_name {
position: relative;
margin-bottom: 35rpx; /* 组件下外边距 */
font-size: 50rpx;
}
.option {
width: 90%; /* 根据需要调整宽度 */
height: 120rpx; /* 根据需要调整高度 */
border-bottom: 1px solid #000000; /* 边框颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-top: 80rpx; /* 组件上外边距 */
font-size: 40rpx;
text {
position: absolute;
left: 15%;
}
}
.icon1 {
width: 60rpx;
height: 60rpx;
position: absolute;
left: 3%;
}
.icon2 {
width: 80rpx;
height: 80rpx;
position: absolute;
right: 0%;
}

@ -0,0 +1,12 @@
<view class="container">
<navigator class="option" navigator url="">
<image class="icon1" src="/assets/my/个人信息.png" mode="aspectFit"/>
<text>个人信息</text>
<image class="icon2" src="/assets/course/arrow-right.png" mode="aspectFit"/>
</navigator>
<navigator class="option" navigator url="">
<image class="icon1" src="/assets/my/修改密码.png" mode="aspectFit"/>
<text>修改密码</text>
<image class="icon2" src="/assets/course/arrow-right.png" mode="aspectFit"/>
</navigator>
</view>

@ -0,0 +1,66 @@
// pages/register/register.js
Page({
/**
* 页面的初始数据
*/
data: {
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1 @@
/* pages/register/register.wxss */

@ -0,0 +1,2 @@
<!--pages/register/register.wxml-->
<text>pages/register/register.wxml</text>

@ -0,0 +1,110 @@
// pages/student_info/student_info.js
Page({
/**
* 页面的初始数据
*/
data: {
student_info : [
{
studentId: '10214256',
name: '若羌',
callCount: '5',
score: '0.9'
},
{
studentId: '10214212',
name: '胡光',
callCount: '2',
score: '0.3'
},
{
studentId: '10214232',
name: '似水',
callCount: '3',
score: '0.3'
},
{
studentId: '10214256',
name: '菲戈',
callCount: '4',
score: '0'
},
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const that = this;
var id = wx.getStorageSync("courseId");
wx.request({
url: 'http://10.133.23.136:8888/student/courseInfo',
method: 'GET',
data: {
courseId : id
},
success: function(res) {
if (res.statusCode === 200) {
console.log(res.data.data);
that.setData({
student_info: res.data.data
});
}
},
fail: function(error) {
console.error('请求失败:', error);
}
});
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})

@ -0,0 +1,3 @@
{
"usingComponents": {}
}

@ -0,0 +1,27 @@
<view class="table">
<view class="table-row">
<view class="table-cell">学号</view>
<view class="table-cell">姓名</view>
<view class="table-cell">点名次数</view>
<view class="table-cell">积分</view>
<view class="table-cell">操作</view>
</view>
<view wx:for="{{courseList}}" wx:key="unique">
<button class="course" bindtap="enterCourse" data-id="{{item.courseId}}" data-description="{{item.description}}">
<image class="icon1" src="/assets/course/多栏明细账.png" mode="aspectFit"/>
<text class="name">{{item.description}}</text>
<image class="icon2" src="/assets/course/arrow-right.png" mode="aspectFit"/>
</button>
</view>
<view wx:for="{{student_info}}" wx:key="unique">
<view class="table-row">
<view class="table-cell">{{item.studentId}}</view>
<view class="table-cell">{{item.name}}</view>
<view class="table-cell">{{item.callCount}}</view>
<view class="table-cell">{{item.score}}</view>
<view class="table-cell">删除</view>
</view>
</view>
</view>

@ -0,0 +1,52 @@
/* pages/table/table.wxss */
.table {
display: block;
width: 100%;
}
.table-row {
display: flex;
width: 100%;
border-bottom: 1px solid #ccc;
}
.table-cell {
display: flex; /* 启用Flex布局 */
flex: 1; /* 允许单元格伸缩以填满行 */
padding-top: 20rpx;
padding-bottom: 20rpx;
align-items: center; /* 垂直居中 */
justify-content: center; /* 水平居中 */
border-right: 1rpx solid #ccc;
font-size: 25rpx;
}
.table-row .table-cell:nth-child(1) {
flex: 2; /* 第一列宽度比例为2 */
}
.table-row .table-cell:nth-child(2) {
flex: 1; /* 第二列宽度比例为1 */
}
.table-row .table-cell:nth-child(3) {
flex: 1; /* 第三列宽度比例为1 */
}
.table-row .table-cell:nth-child(4) {
flex: 1; /* 第四列宽度比例为1 */
}
.table-row .table-cell:nth-child(5) {
flex: 1; /* 第五列宽度比例为1 */
}
/* 移除最后一个单元格的右边边框 */
.table-row:last-child .table-cell {
border-bottom: none;
}
/* 移除最后一列的右边边框 */
.table-cell:last-child {
border-right: none;
}

@ -0,0 +1,31 @@
{
"compileType": "miniprogram",
"libVersion": "trial",
"packOptions": {
"ignore": [],
"include": []
},
"setting": {
"useCompilerPlugins": [
"sass"
],
"coverView": true,
"es6": true,
"postcss": true,
"minified": true,
"enhance": true,
"showShadowRootInWxmlPanel": true,
"packNpmRelationList": [],
"babelSetting": {
"ignore": [],
"disablePlugins": [],
"outputPath": ""
}
},
"condition": {},
"editorSetting": {
"tabIndent": "auto",
"tabSize": 2
},
"appid": "wxd6668571fd848bbb"
}

@ -0,0 +1,8 @@
{
"description": "项目私有配置文件。此文件中的内容将覆盖 project.config.json 中的相同字段。项目的改动优先同步到此文件中。详见文档https://developers.weixin.qq.com/miniprogram/dev/devtools/projectconfig.html",
"projectname": "%E7%82%B9%E5%90%8D%E7%B3%BB%E7%BB%9F-2",
"setting": {
"compileHotReLoad": true,
"urlCheck": false
}
}

@ -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
}
Loading…
Cancel
Save