Compare commits

..

8 Commits
main ... code

@ -1,18 +1,17 @@
{
"entryPagePath": "pages/login/login",
"entryPagePath": "pages/course_detail/course_detail",
"pages": [
"pages/course/course",
"pages/my/my",
"pages/course_detail/course_detail",
"pages/course_detail(2)/course_detail(2)",
"pages/student_info/student_info",
"pages/student_info(2)/student_info(2)",
"pages/login/login",
"pages/forget/forget",
"pages/register/register",
"pages/choose_name/choose_name",
"pages/call_the_name/call_the_name",
"pages/my_callname/my_callname"
"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": "点名系统",
@ -43,5 +42,4 @@
"componentFramework": "glass-easel",
"sitemapLocation": "sitemap.json",
"lazyCodeLoading": "requiredComponents"
}

@ -0,0 +1 @@
undefined

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

File diff suppressed because one or more lines are too long

@ -1,94 +0,0 @@
Page({
/**
* 页面的初始数据
*/
data: {
studentId : '',
name: '',
password: ''
},
addScore1: function() {
this.addScore(-0.5);
this.call_the_name();
},
addScore2: function() {
this.addScore(0);
this.call_the_name();
},
addScore3: function() {
this.addScore(0.5);
this.call_the_name();
},
addScore4: function() {
this.call_the_name();
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.call_the_name();
},
call_the_name: function() {
const kind = wx.getStorageSync('call_kind');
const that = this;
var url = '';
if (kind == '1') {
url = 'http://10.133.15.50:8888/admin/randomRollCall?courseId=' + wx.getStorageSync('courseId');
} else if (kind == '2') {
url = 'http://10.133.15.50:8888/admin/callByLastNum?courseId=' + wx.getStorageSync('courseId') + '&lastNum=' + wx.getStorageSync('lastNum');
} else if (kind == '3') {
url = 'http://10.133.15.50:8888/admin/callByFirstname?courseId=' + wx.getStorageSync('courseId') + '&firstname=' + wx.getStorageSync('firstname');
}
wx.request({
url: url,
method: 'POST',
header: {
'admin_token': wx.getStorageSync('token') // 携带token
},
success(res) {
if (res.statusCode === 200) {
console.log(res.data.data);
that.setData({
studentId: res.data.data.studentId,
name: res.data.data.name,
password: res.data.data.password
});
}
},
fail(error) {
console.error(error);
}
});
},
addScore: function(score) {
const that = this;
wx.request({
url: 'http://10.133.15.50:8888/admin/addScore?score=' + score,
method: 'PUT',
header: {
'admin_token': wx.getStorageSync('token') // 携带token
},
data: {
student: {
studentId: that.data.studentId,
name: that.data.name,
password: that.data.password
},
course: {
courseId: wx.getStorageSync('courseId'),
description: wx.getStorageSync('description')
}
},
success(res) {
if (res.statusCode === 200) {
console.log("right op");
}
},
fail(error) {
console.error(error);
}
});
}
})

@ -1,60 +0,0 @@
page {
background-color: #eeeeee;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 60rpx;
}
.top {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.top_detail {
font-size:45rpx;
padding: 20rpx;
}
.option_detail {
width: 340rpx !important; /* 根据需要调整宽度 */
height: 85rpx; /* 根据需要调整高度 */
border: 1px solid #BBBBBB; /* 边框颜色 */
border-radius: 20rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-top: 80rpx; /* 组件上外边距 */
font-size: 40rpx;
}
.option_detail2 {
width: 200rpx !important; /* 根据需要调整宽度 */
height: 80rpx; /* 根据需要调整高度 */
border: 1px solid #000000; /* 边框颜色 */
border-radius: 20rpx; /* 圆角半径 */
background-color: #DB4949; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
margin-top: 80rpx; /* 组件上外边距 */
font-size: 40rpx;
text {
color: #FFFFFF;
}
}
.bottom_image {
width: 400rpx;
height: 400rpx;
}

@ -1,15 +0,0 @@
<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.5分</button>
<button class="option_detail" bindtap="addScore2">0分</button>
<button class="option_detail" bindtap="addScore3">+0.5分</button>
<button class="option_detail2" bindtap="addScore4">
<text style="color: #FFFFFF">旷课</text>
</button>
</view>
<image class="bottom_image" src="/素材/微笑.png"/>
</view>

@ -1,59 +0,0 @@
// pages/choose_name/choose_name.js
Page({
/**
* 页面的初始数据
*/
data: {
},
option1: function(e) {
wx.setStorageSync('call_kind', '1');
wx.navigateTo({
url: '/pages/call_the_name/call_the_name',
})
},
option2: function(e) {
wx.setStorageSync('call_kind', '2');
wx.showModal({
editable:true,//显示输入框
placeholderText:'输入学号尾数',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content);//用户输入的值
wx.setStorageSync("lastNum", res.content);
wx.navigateTo({
url: '/pages/call_the_name/call_the_name',
})
} else {
console.log('用户点击了取消')
}
}
})
},
option3: function(e) {
wx.setStorageSync('call_kind', '3');
wx.showModal({
editable:true,//显示输入框
placeholderText:'输入姓氏',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content);//用户输入的值
wx.setStorageSync("firstname", res.content);
wx.navigateTo({
url: '/pages/call_the_name/call_the_name',
})
} else {
console.log('用户点击了取消')
}
}
})
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
})

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

@ -1,49 +0,0 @@
page {
background-color: #eeeeee;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 70rpx;
}
.course_name {
position: relative;
font-size: 50rpx;
}
.option {
width: 400rpx !important; /* 根据需要调整宽度 */
height: 100rpx; /* 根据需要调整高度 */
border: 1px solid #000000; /* 边框颜色 */
border-radius: 15rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
font-size: 40rpx;
font-weight: 500;
margin-left: 100rpx !important;
}
.combition {
display: flex;
align-items: center;
margin-top: 90rpx; /* 组件上外边距 */
}
.right_image {
margin-left: 40rpx;
width: 100rpx;
height: 100rpx;
}
.bottom_image {
width: 550rpx;
height: 550rpx;
margin-top: 50rpx; /* 组件上外边距 */
}

@ -1,16 +0,0 @@
<view class="container">
<view class="course_name">选择点名方式</view>
<view class="combition">
<button class="option" bindtap="option1">随机点名</button>
<image class="right_image" src="/素材/企鹅,卡通动物.png"/>
</view>
<view class="combition">
<button class="option" bindtap="option2">根据学号尾数点名</button>
<image class="right_image" src="/素材/乌龟,卡通动物.png"/>
</view>
<view class="combition">
<button class="option" bindtap="option3">根据姓氏点名</button>
<image class="right_image" src="/素材/鱼,卡通动物.png"/>
</view>
<image class="bottom_image" src="/素材/问答.png"/>
</view>

@ -1,137 +0,0 @@
Page({
/**
* 页面的初始数据
*/
data: {
courseList: [],
isAdmin: true
},
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);
if (this.data.isAdmin) {
wx.navigateTo({url: '/pages/course_detail/course_detail'});
} else {
wx.navigateTo({url: '/pages/course_detail(2)/course_detail(2)'});
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.getCourse();
},
getCourse: function() {
const that = this;
that.setData ({
isAdmin: wx.getStorageSync("isAdmin")
});
if (that.data.isAdmin) {
wx.request({
url: 'http://10.133.15.50:8888/admin/ownCourseList',
method: 'GET',
header: {
admin_token: wx.getStorageSync('token') // 携带token
},
success(res) {
if (res.statusCode === 200) {
console.log(res.data.data);
that.setData({
courseList: res.data.data
});
}
},
fail(error) {
console.error(err);
}
});
} else {
wx.request({
url: 'http://10.133.15.50:8888/student/ownCourseList',
method: 'GET',
header: {
student_token: wx.getStorageSync('token') // 携带token
},
success(res) {
if (res.statusCode === 200) {
console.log(res.data.data);
that.setData({
courseList: res.data.data
});
}
},
fail(error) {
console.error(err);
}
});
}
},
update: function(event) {
const that = this;
if (wx.getStorageSync('isAdmin') == true) {
wx.showModal({
title:'创建新课程',
editable:true,//显示输入框
placeholderText:'输入课程名',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content)//用户输入的值
wx.request({
url: 'http://10.133.15.50:8888/admin/createCourse?courseDescription=' + res.content,
method: 'POST',
header: {
'admin_token': wx.getStorageSync('token') // 携带token
},
success(res) {
if (res.statusCode === 200) {
console.log("yes");
}
that.getCourse();
},
fail(error) {
console.error(error);
}
})
} else {
console.log("取消");
}
}
})
} else {
wx.showModal({
title:'加入课程',
editable:true,//显示输入框
placeholderText:'输入课程名',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content)//用户输入的值
wx.request({
url: 'http://10.133.15.50:8888/student/joinCourse?courseDescription=' + res.content,
method: 'POST',
header: {
'student_token': wx.getStorageSync('token') // 携带token
},
success(res) {
if (res.statusCode === 200) {
console.log("yes");
}
that.getCourse();
},
fail(error) {
console.error(error);
}
})
} else {
console.log("取消");
}
}
})
}
}
})

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

@ -1,49 +0,0 @@
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%;
}
.add_icon{
position: fixed;
width: 100rpx;
height: 100rpx;
bottom: 50rpx;
right: 45rpx;
}

@ -1,13 +0,0 @@
<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 bindtap='adddetial'>
<image class="add_icon" src="/素材/circle-plus-outline.png" bindtap="update"></image>
</view>

@ -1,86 +0,0 @@
// 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")
});
},
})

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

@ -1,12 +0,0 @@
<view class="container">
<view class="course_name">{{description}}</view>
<view class="combition">
<navigator class="option" navigator url="/pages/student_info(2)/student_info(2)">查看学生信息</navigator>
<image class="right_image" src="/素材/海豚,卡通动物.png"/>
</view>
<view class="combition">
<navigator class="option" navigator url="/pages/my_callname/my_callname">个人点名记录</navigator>
<image class="right_image" src="/素材/bird动物卡通.png"/>
</view>
<image class="bottom_image" src="/素材/任务完成.png"/>
</view>

@ -1,146 +0,0 @@
// 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)
/* 下面补充确定后向后端传输数据*/
const that = this;
wx.request({
url: 'http://10.133.15.50:8888/admin/addStudent2Course',
method: 'PUT',
header: {
'admin_token': wx.getStorageSync('token') // 携带token
},
data: {
student: {
studentId: that.data.studentId,
name: that.data.name,
password: that.data.password
},
course: {
courseId: wx.getStorageSync('courseId'),
description: wx.getStorageSync('description')
}
},
success(res) {
if (res.statusCode === 200) {
console.log("yes");
}
},
fail(error) {
console.error(error);
}
});
},
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")
});
},
chooseMessageFile: function (event) {
var that = this;
wx.chooseMessageFile({
count: 1,
type: 'all',
success(res) {
var filename = res.tempFiles[0].name
that.setData({filename:filename});
console.info(filename);
console.log(res.tempFiles[0].path);
wx.uploadFile({
url: 'http://10.133.15.50:8888/admin/batchAddStudents?courseId=' + wx.getStorageSync('courseId') + '&file=' + res.tempFiles[0].path,
header: {
admin_token: wx.getStorageSync('token') // 携带token
},
name: filename,
method: 'POST',
success(res) {
var data = JSON.parse(res.data)
if (data.code == 200) {
console.log('上传成功');
} else{
console.log('上传失败');
wx.showToast({
title: res.message,
icon: 'none'
})
}
}
})
}
});
}
})

@ -1,130 +0,0 @@
page {
background-color: #eeeeee;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 100rpx;
}
.course_name {
position: relative;
margin-bottom: 35rpx; /* 组件下外边距 */
font-size: 50rpx;
}
.option {
width: 400rpx; /* 根据需要调整宽度 */
height: 100rpx; /* 根据需要调整高度 */
border: 1px solid #000000; /* 边框颜色 */
border-radius: 15rpx; /* 圆角半径 */
background-color: #ffffff; /* 背景颜色 */
display: flex;
align-items: center;
justify-content: center;
position: relative;
font-size: 40rpx;
margin-left: 120rpx;
}
.combition {
display: flex;
align-items: center;
margin-top: 50rpx; /* 组件上外边距 */
}
.right_image {
margin-left: 40rpx;
width: 100rpx;
height: 100rpx;
}
.bottom_image {
width: 600rpx;
height: 600rpx;
margin-top: 0rpx; /* 组件上外边距 */
}
/* 隐藏内容样式 */
/*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;
}
.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;
}

@ -1,45 +0,0 @@
<view class="container">
<view class="course_name">{{description}}</view>
<view class="combition">
<navigator class="option" navigator url="/pages/student_info/student_info">查看学生信息</navigator>
<image class="right_image" src="/素材/海豚,卡通动物.png"/>
</view>
<view class="combition">
<navigator class="option" navigator url="/pages/choose_name/choose_name">点名</navigator>
<image class="right_image" src="/素材/bird动物卡通.png"/>
</view>
<view class="combition">
<view class="option" bindtap="update" data-statu="open">添加学生</view>
<image class="right_image" src="/素材/章鱼,卡通动物.png"/>
</view>
<view class="combition">
<view class="option" bindtap="chooseMessageFile">导入学生名单</view>
<image class="right_image" src="/素材/猴子,卡通动物.png"/>
</view>
<image class="bottom_image" src="/素材/任务完成.png"/>
</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>

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

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

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

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

@ -1,74 +0,0 @@
Page({
data: {
account: '',
password: ''
},
onAccountInput: function(e) {
this.setData({
account: e.detail.value
});
},
onPasswordInput: function(e) {
this.setData({
password: e.detail.value
});
},
onLogin: function() {
const that = this;
// 用户登录逻辑
console.log('登录账号:', that.data.account);
console.log('登录密码:', that.data.password);
// 这里可以添加实际的登录逻辑例如调用API
wx.request({
url: 'http://10.133.15.50:8888/admin/login',
method: 'POST',
data: {
adminId: that.data.account, // 管理员ID
password: that.data.password // 密码
},
success(res) {
console.log(res.data);
if (res.statusCode === 200) {
// 处理登录成功
that.data.isLogin = true;
wx.setStorageSync('adminId', res.data.data.adminId);
wx.setStorageSync('name', res.data.data.name);
wx.setStorageSync('token', res.data.data.token);
wx.setStorageSync('isAdmin', true);
wx.switchTab({
url: '/pages/course/course',
});
} else {
}
},
fail(err) {
}
});
wx.request({
url: 'http://10.133.15.50:8888/student/login',
method: 'POST',
data: {
studentId: that.data.account, // 学生ID
password: that.data.password // 密码
},
success(res) {
console.log(res.data);
if (res.statusCode === 200) {
// 处理登录成功
wx.setStorageSync('studentId', res.data.data.studentId);
wx.setStorageSync('name', res.data.data.name);
wx.setStorageSync('token', res.data.data.token);
wx.setStorageSync('isAdmin', false);
wx.switchTab({
url: '/pages/course/course',
});
} else {
}
},
fail(err) {
console.error(err);
}
});
},
});

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

@ -1,65 +0,0 @@
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
height: 100%;
padding-top: 25%;
}
.login-form {
width: 650rpx;
}
.title {
font-size: 50rpx;
margin-bottom: 40rpx;
text-align: center;
font-weight: 700;
}
.input-group {
margin-bottom: 15rpx;
}
.label {
font-size: 35rpx;
margin:20rpx;
}
.input {
width: 100%;
padding: 10rpx;
border: 1rpx solid #ccc;
border-radius: 15rpx;
}
.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;
}

@ -1,21 +0,0 @@
<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>

@ -1,18 +0,0 @@
// 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
}
})
})
}
})

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

@ -1,6 +0,0 @@
<!--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>

@ -1,16 +0,0 @@
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);
}

@ -1,68 +0,0 @@
// pages/my/my.js
Page({
/**
* 页面的初始数据
*/
data: {
},
change: function(event) {
wx.showModal({
title:'修改密码',
editable:true,//显示输入框
placeholderText:'输入新密码',//显示输入框提示信息
success: res => {
if (res.confirm) { //点击了确认
console.log(res.content)//用户输入的值
if (wx.getStorageSync('isAdmin') == true) {
wx.request({
url: 'http://10.133.15.50:8888/admin/changePassword',
method: 'PUT',
header: {
'admin_token': wx.getStorageSync('token') // 携带token
},
data: {
name: wx.getStorageSync('name'),
adminId: wx.getStorageSync('adminId'),
password: res.content
},
success(res) {
if (res.statusCode === 200) {
console.log("yes");
}
},
fail(error) {
console.error(error);
}
})
} else {
wx.request({
url: 'http://10.133.15.50:8888/student/changePassword',
method: 'PUT',
header: {
'student_token': wx.getStorageSync('token') // 携带token
},
data: {
name: wx.getStorageSync('name'),
adminId: wx.getStorageSync('studentId'),
password: res.content
},
success(res) {
if (res.statusCode === 200) {
console.log("yes");
}
},
fail(error) {
console.error(error);
}
})
}
} else {
console.log("取消");
}
}
})
}
})

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

@ -1,58 +0,0 @@
page {
background-color: #eeeeee;
}
.container {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
padding-top: 100rpx;
}
.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: 20rpx; /* 组件上外边距 */
font-size: 35rpx;
text {
position: absolute;
left: 13%;
}
}
.icon1 {
width: 50rpx;
height: 60rpx;
position: absolute;
left: 3%;
}
.icon2 {
width: 70rpx;
height: 80rpx;
position: absolute;
right: 0%;
}
.bottom_image {
width:700rpx;
height: 700rpx;
margin-top: 20rpx; /* 组件上外边距 */
}
.icon3 {
width: 100rpx;
height: 100rpx;
}

@ -1,13 +0,0 @@
<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>
<view class="option" bindtap='change'>
<image class="icon1" src="/assets/my/修改密码.png" mode="aspectFit"/>
<text>修改密码</text>
<image class="icon2" src="/assets/course/arrow-right.png" mode="aspectFit"/>
</view>
<image class="bottom_image" src="/素材/各司其职.png"/>
</view>

@ -1,41 +0,0 @@
// pages/student_info/student_info.js
Page({
/**
* 页面的初始数据
*/
data: {
records : [
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const that = this;
console.log(wx.getStorageSync('token'));
wx.request({
url: 'http://10.133.15.50:8888/student/callRecord?courseId=' + wx.getStorageSync('courseId'),
method: 'POST',
header: {
'student_token': wx.getStorageSync('token') // 携带token
},
data: {
page: '1',
pageSize: '10000'
},
success: function(res) {
if (res.statusCode === 200) {
console.log(res.data.data);
that.setData({
records: res.data.data.records
});
}
},
fail: function(error) {
console.error('请求失败:', error);
}
});
},
})

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

@ -1,52 +0,0 @@
/* 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;
}

@ -1,14 +0,0 @@
<view class="table">
<view class="table-row">
<view class="table-cell">点名时间</view>
<view class="table-cell">点名老师</view>
<view class="table-cell">积分变化</view>
</view>
<view wx:for="{{records}}" wx:key="unique">
<view class="table-row">
<view class="table-cell">{{item.callTime}}</view>
<view class="table-cell">{{item.adminName}}</view>
<view class="table-cell">{{item.score}}</view>
</view>
</view>
</view>

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

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

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

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

@ -1,44 +0,0 @@
// pages/student_info/student_info.js
Page({
/**
* 页面的初始数据
*/
data: {
studentId : '',
name : '',
callCount : '',
score : ''
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const that = this;
console.log(wx.getStorageSync('token'));
wx.request({
url: 'http://10.133.15.50:8888/student/courseInfo?courseId=' + wx.getStorageSync('courseId'),
method: 'GET',
header: {
'student_token': wx.getStorageSync('token') // 携带token
},
data: {
},
success: function(res) {
if (res.statusCode === 200) {
console.log(res.data.data);
that.setData({
studentId : res.data.data.studentId,
name : res.data.data.name,
callCount : res.data.data.callCount,
score : res.data.data.score
});
}
},
fail: function(error) {
console.error('请求失败:', error);
}
});
},
})

@ -1,52 +0,0 @@
/* 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;
}

@ -1,14 +0,0 @@
<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>
<view class="table-row">
<view class="table-cell">{{studentId}}</view>
<view class="table-cell">{{name}}</view>
<view class="table-cell">{{callCount}}</view>
<view class="table-cell">{{score}}</view>
</view>
</view>

@ -1,41 +0,0 @@
// pages/student_info/student_info.js
Page({
/**
* 页面的初始数据
*/
data: {
student_info : [
]
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
const that = this;
console.log(wx.getStorageSync('token'));
wx.request({
url: 'http://10.133.15.50:8888/admin/pageQuery4Course?courseId=' + wx.getStorageSync('courseId'),
method: 'POST',
header: {
'admin_token': wx.getStorageSync('token') // 携带token
},
data: {
page: '1',
pageSize: '10000'
},
success: function(res) {
if (res.statusCode === 200) {
console.log(res.data.data);
that.setData({
student_info: res.data.data.records
});
}
},
fail: function(error) {
console.error('请求失败:', error);
}
});
},
})

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

@ -1,52 +0,0 @@
/* 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;
}

@ -1,20 +0,0 @@
<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="{{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">
<text style="color: #5DADE2">删除</text>
</view>
</view>
</view>
</view>

@ -1,19 +0,0 @@
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
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 105 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 168 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 269 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 139 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 162 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 188 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 118 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 266 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 134 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 175 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 137 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 130 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 194 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 217 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 199 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 128 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 165 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 177 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 125 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 161 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 117 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 160 KiB

@ -1,31 +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"
{
"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"
}

@ -1,8 +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
}
{
"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
}
}
Loading…
Cancel
Save