diff --git a/code/.eslintrc.js b/code/.eslintrc.js new file mode 100644 index 0000000..115cc02 --- /dev/null +++ b/code/.eslintrc.js @@ -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: {}, +} diff --git a/code/app.js b/code/app.js new file mode 100644 index 0000000..1ed57c4 --- /dev/null +++ b/code/app.js @@ -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 + } +}) diff --git a/code/app.json b/code/app.json new file mode 100644 index 0000000..d856cce --- /dev/null +++ b/code/app.json @@ -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" +} \ No newline at end of file diff --git a/code/app.wxss b/code/app.wxss new file mode 100644 index 0000000..06c6fc9 --- /dev/null +++ b/code/app.wxss @@ -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; +} diff --git a/code/assets/course/arrow-right.png b/code/assets/course/arrow-right.png new file mode 100644 index 0000000..e567898 Binary files /dev/null and b/code/assets/course/arrow-right.png differ diff --git a/code/assets/course/多栏明细账.png b/code/assets/course/多栏明细账.png new file mode 100644 index 0000000..c7b0727 Binary files /dev/null and b/code/assets/course/多栏明细账.png differ diff --git a/code/assets/login/极光.png b/code/assets/login/极光.png new file mode 100644 index 0000000..294c741 Binary files /dev/null and b/code/assets/login/极光.png differ diff --git a/code/assets/my/个人信息.png b/code/assets/my/个人信息.png new file mode 100644 index 0000000..d78340e Binary files /dev/null and b/code/assets/my/个人信息.png differ diff --git a/code/assets/my/修改密码.png b/code/assets/my/修改密码.png new file mode 100644 index 0000000..d4d6c52 Binary files /dev/null and b/code/assets/my/修改密码.png differ diff --git a/code/assets/tabbar/我的(1).png b/code/assets/tabbar/我的(1).png new file mode 100644 index 0000000..9786b96 Binary files /dev/null and b/code/assets/tabbar/我的(1).png differ diff --git a/code/assets/tabbar/我的(2).png b/code/assets/tabbar/我的(2).png new file mode 100644 index 0000000..c0e0130 Binary files /dev/null and b/code/assets/tabbar/我的(2).png differ diff --git a/code/assets/tabbar/课程(1).png b/code/assets/tabbar/课程(1).png new file mode 100644 index 0000000..085e40d Binary files /dev/null and b/code/assets/tabbar/课程(1).png differ diff --git a/code/assets/tabbar/课程(2).png b/code/assets/tabbar/课程(2).png new file mode 100644 index 0000000..414afee Binary files /dev/null and b/code/assets/tabbar/课程(2).png differ diff --git a/code/openAPI/default.html b/code/openAPI/default.html new file mode 100644 index 0000000..ed1389f --- /dev/null +++ b/code/openAPI/default.html @@ -0,0 +1,797 @@ + + + + + + OpenAPI definition + + + + +
+
+ + + + +
+

{{instance.title}}

+
+
+ + +

简介

+
+ +
+ +
+
+ + +

作者

+
+ +
+ +
+
+ + +

版本

+
+ +
+ +
+
+ + +

host

+
+ +
+ +
+
+ + +

basePath

+
+ +
+ +
+
+ + +

服务Url

+
+ +
+ +
+
+ + +

分组名称

+
+ +
+ +
+
+ + +

分组url

+
+ +
+ +
+
+ + +

分组location

+
+ +
+ +
+
+ + +

接口统计信息

+
+ + + + {{param.method}} + + + {{param.count}} + + + + +
+
+
+
+ + + + + 隐藏 + + + + + + + + +

{{tag.name}}

+
+ + + + + {{ api.summary }} + + + {{ api.summary }} + + + +
+ {{ api.methodType }} + {{ api.showUrl }} +
+
+ + + + 请求数据类型 + {{ api.consumes }} + + + + + 响应数据类型 + {{ api.produces }} + + + +
+
+
+ 开发者 +
+
+
+ +
+
+ 接口描述 +
+
+
+ +
+
+ 请求示例 +
+

+              
+
+ 请求参数 +
+ + + + + + + + +
+ 响应状态 +
+ + + + + +
+ + + + +
+
+ 响应Header +
+ + +
+ +
+ 响应参数 +
+ + +
+ 响应示例 +
+
+ {{ resp.responseText }} +
+

+                    
+                    
+                  
+
+
+
+ +
+
+ 响应Header +
+ + +
+ +
+ 响应参数 +
+ + +
+ 响应示例 +
+
+ {{ api.multipData.responseText }} +
+

+              
+ + + +
+
+
+ +
+
+ + + + + + \ No newline at end of file diff --git a/code/pages/call_the_name(1)/call_the_name(1).js b/code/pages/call_the_name(1)/call_the_name(1).js new file mode 100644 index 0000000..e035093 --- /dev/null +++ b/code/pages/call_the_name(1)/call_the_name(1).js @@ -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() { + + } +}) \ No newline at end of file diff --git a/code/pages/call_the_name(1)/call_the_name(1).json b/code/pages/call_the_name(1)/call_the_name(1).json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/call_the_name(1)/call_the_name(1).json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/call_the_name(1)/call_the_name(1).scss b/code/pages/call_the_name(1)/call_the_name(1).scss new file mode 100644 index 0000000..2616c86 --- /dev/null +++ b/code/pages/call_the_name(1)/call_the_name(1).scss @@ -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; +} \ No newline at end of file diff --git a/code/pages/call_the_name(1)/call_the_name(1).wxml b/code/pages/call_the_name(1)/call_the_name(1).wxml new file mode 100644 index 0000000..587b654 --- /dev/null +++ b/code/pages/call_the_name(1)/call_the_name(1).wxml @@ -0,0 +1,12 @@ + + + + 学号:{{studentId}} + 姓名:{{name}} + + + + + + + \ No newline at end of file diff --git a/code/pages/call_the_name(2)/call_the_name(2).js b/code/pages/call_the_name(2)/call_the_name(2).js new file mode 100644 index 0000000..efd042b --- /dev/null +++ b/code/pages/call_the_name(2)/call_the_name(2).js @@ -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() { + + } +}) \ No newline at end of file diff --git a/code/pages/call_the_name(2)/call_the_name(2).json b/code/pages/call_the_name(2)/call_the_name(2).json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/call_the_name(2)/call_the_name(2).json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/call_the_name(2)/call_the_name(2).scss b/code/pages/call_the_name(2)/call_the_name(2).scss new file mode 100644 index 0000000..2616c86 --- /dev/null +++ b/code/pages/call_the_name(2)/call_the_name(2).scss @@ -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; +} \ No newline at end of file diff --git a/code/pages/call_the_name(2)/call_the_name(2).wxml b/code/pages/call_the_name(2)/call_the_name(2).wxml new file mode 100644 index 0000000..587b654 --- /dev/null +++ b/code/pages/call_the_name(2)/call_the_name(2).wxml @@ -0,0 +1,12 @@ + + + + 学号:{{studentId}} + 姓名:{{name}} + + + + + + + \ No newline at end of file diff --git a/code/pages/call_the_name(3)/call_the_name(3).js b/code/pages/call_the_name(3)/call_the_name(3).js new file mode 100644 index 0000000..5b0c9f6 --- /dev/null +++ b/code/pages/call_the_name(3)/call_the_name(3).js @@ -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() { + + } +}) \ No newline at end of file diff --git a/code/pages/call_the_name(3)/call_the_name(3).json b/code/pages/call_the_name(3)/call_the_name(3).json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/call_the_name(3)/call_the_name(3).json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/call_the_name(3)/call_the_name(3).scss b/code/pages/call_the_name(3)/call_the_name(3).scss new file mode 100644 index 0000000..2616c86 --- /dev/null +++ b/code/pages/call_the_name(3)/call_the_name(3).scss @@ -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; +} \ No newline at end of file diff --git a/code/pages/call_the_name(3)/call_the_name(3).wxml b/code/pages/call_the_name(3)/call_the_name(3).wxml new file mode 100644 index 0000000..587b654 --- /dev/null +++ b/code/pages/call_the_name(3)/call_the_name(3).wxml @@ -0,0 +1,12 @@ + + + + 学号:{{studentId}} + 姓名:{{name}} + + + + + + + \ No newline at end of file diff --git a/code/pages/choose_name/choose_name.js b/code/pages/choose_name/choose_name.js new file mode 100644 index 0000000..b83aadd --- /dev/null +++ b/code/pages/choose_name/choose_name.js @@ -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() { + + } +}) \ No newline at end of file diff --git a/code/pages/choose_name/choose_name.json b/code/pages/choose_name/choose_name.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/choose_name/choose_name.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/choose_name/choose_name.scss b/code/pages/choose_name/choose_name.scss new file mode 100644 index 0000000..db0d111 --- /dev/null +++ b/code/pages/choose_name/choose_name.scss @@ -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; +} \ No newline at end of file diff --git a/code/pages/choose_name/choose_name.wxml b/code/pages/choose_name/choose_name.wxml new file mode 100644 index 0000000..497fc79 --- /dev/null +++ b/code/pages/choose_name/choose_name.wxml @@ -0,0 +1,6 @@ + + 请选择点名方式 + 随机点名 + 根据学号尾数点名 + 根据姓氏点名 + \ No newline at end of file diff --git a/code/pages/course/course.js b/code/pages/course/course.js new file mode 100644 index 0000000..0b4d7ad --- /dev/null +++ b/code/pages/course/course.js @@ -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() { + + } +}) \ No newline at end of file diff --git a/code/pages/course/course.json b/code/pages/course/course.json new file mode 100644 index 0000000..b55b5a2 --- /dev/null +++ b/code/pages/course/course.json @@ -0,0 +1,4 @@ +{ + "usingComponents": { + } +} \ No newline at end of file diff --git a/code/pages/course/course.scss b/code/pages/course/course.scss new file mode 100644 index 0000000..2b9e103 --- /dev/null +++ b/code/pages/course/course.scss @@ -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%; +} \ No newline at end of file diff --git a/code/pages/course/course.wxml b/code/pages/course/course.wxml new file mode 100644 index 0000000..51987d7 --- /dev/null +++ b/code/pages/course/course.wxml @@ -0,0 +1,7 @@ + + + diff --git a/code/pages/course_detail/course_detail.js b/code/pages/course_detail/course_detail.js new file mode 100644 index 0000000..37d281c --- /dev/null +++ b/code/pages/course_detail/course_detail.js @@ -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() { + + } +}) \ No newline at end of file diff --git a/code/pages/course_detail/course_detail.json b/code/pages/course_detail/course_detail.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/course_detail/course_detail.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/course_detail/course_detail.scss b/code/pages/course_detail/course_detail.scss new file mode 100644 index 0000000..61b5d11 --- /dev/null +++ b/code/pages/course_detail/course_detail.scss @@ -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; +} \ No newline at end of file diff --git a/code/pages/course_detail/course_detail.wxml b/code/pages/course_detail/course_detail.wxml new file mode 100644 index 0000000..c96c37a --- /dev/null +++ b/code/pages/course_detail/course_detail.wxml @@ -0,0 +1,31 @@ + + {{description}} + 查看学生信息 + 添加学生 + 点名 + + + + + + + + + + 添加学生 + + + 学生学号: + + + + 学生姓名: + + + + + 取消 + 确定 + + + diff --git a/code/pages/forget/forget.js b/code/pages/forget/forget.js new file mode 100644 index 0000000..5239ad0 --- /dev/null +++ b/code/pages/forget/forget.js @@ -0,0 +1,66 @@ +// pages/forget/forget.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/code/pages/forget/forget.json b/code/pages/forget/forget.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/forget/forget.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/forget/forget.scss b/code/pages/forget/forget.scss new file mode 100644 index 0000000..fcceff1 --- /dev/null +++ b/code/pages/forget/forget.scss @@ -0,0 +1 @@ +/* pages/forget/forget.wxss */ \ No newline at end of file diff --git a/code/pages/forget/forget.wxml b/code/pages/forget/forget.wxml new file mode 100644 index 0000000..73a0a08 --- /dev/null +++ b/code/pages/forget/forget.wxml @@ -0,0 +1,2 @@ + +pages/forget/forget.wxml \ No newline at end of file diff --git a/code/pages/login/login.js b/code/pages/login/login.js new file mode 100644 index 0000000..a4f9b79 --- /dev/null +++ b/code/pages/login/login.js @@ -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' + }); + } + }); + }, +}); \ No newline at end of file diff --git a/code/pages/login/login.json b/code/pages/login/login.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/login/login.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/login/login.scss b/code/pages/login/login.scss new file mode 100644 index 0000000..fe9615b --- /dev/null +++ b/code/pages/login/login.scss @@ -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; +} \ No newline at end of file diff --git a/code/pages/login/login.wxml b/code/pages/login/login.wxml new file mode 100644 index 0000000..a03c5ba --- /dev/null +++ b/code/pages/login/login.wxml @@ -0,0 +1,21 @@ + + + 用户登录 + + 账号 + + + + 密码 + + + + 记住我 + + + + 忘记密码? + 注册新账户 + + + \ No newline at end of file diff --git a/code/pages/logs/logs.js b/code/pages/logs/logs.js new file mode 100644 index 0000000..85f6aac --- /dev/null +++ b/code/pages/logs/logs.js @@ -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 + } + }) + }) + } +}) diff --git a/code/pages/logs/logs.json b/code/pages/logs/logs.json new file mode 100644 index 0000000..b55b5a2 --- /dev/null +++ b/code/pages/logs/logs.json @@ -0,0 +1,4 @@ +{ + "usingComponents": { + } +} \ No newline at end of file diff --git a/code/pages/logs/logs.wxml b/code/pages/logs/logs.wxml new file mode 100644 index 0000000..85cf1bf --- /dev/null +++ b/code/pages/logs/logs.wxml @@ -0,0 +1,6 @@ + + + + {{index + 1}}. {{log.date}} + + diff --git a/code/pages/logs/logs.wxss b/code/pages/logs/logs.wxss new file mode 100644 index 0000000..33f9d9e --- /dev/null +++ b/code/pages/logs/logs.wxss @@ -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); +} diff --git a/code/pages/my/my.js b/code/pages/my/my.js new file mode 100644 index 0000000..7c8d6d5 --- /dev/null +++ b/code/pages/my/my.js @@ -0,0 +1,66 @@ +// pages/my/my.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/code/pages/my/my.json b/code/pages/my/my.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/my/my.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/my/my.scss b/code/pages/my/my.scss new file mode 100644 index 0000000..3154817 --- /dev/null +++ b/code/pages/my/my.scss @@ -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%; +} \ No newline at end of file diff --git a/code/pages/my/my.wxml b/code/pages/my/my.wxml new file mode 100644 index 0000000..7ac1aa5 --- /dev/null +++ b/code/pages/my/my.wxml @@ -0,0 +1,12 @@ + + + + 个人信息 + + + + + 修改密码 + + + \ No newline at end of file diff --git a/code/pages/register/register.js b/code/pages/register/register.js new file mode 100644 index 0000000..730cbba --- /dev/null +++ b/code/pages/register/register.js @@ -0,0 +1,66 @@ +// pages/register/register.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad(options) { + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady() { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow() { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide() { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload() { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh() { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom() { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage() { + + } +}) \ No newline at end of file diff --git a/code/pages/register/register.json b/code/pages/register/register.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/register/register.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/register/register.scss b/code/pages/register/register.scss new file mode 100644 index 0000000..cb8065a --- /dev/null +++ b/code/pages/register/register.scss @@ -0,0 +1 @@ +/* pages/register/register.wxss */ \ No newline at end of file diff --git a/code/pages/register/register.wxml b/code/pages/register/register.wxml new file mode 100644 index 0000000..2c0b947 --- /dev/null +++ b/code/pages/register/register.wxml @@ -0,0 +1,2 @@ + +pages/register/register.wxml \ No newline at end of file diff --git a/code/pages/student_info/student_info.js b/code/pages/student_info/student_info.js new file mode 100644 index 0000000..f1e906e --- /dev/null +++ b/code/pages/student_info/student_info.js @@ -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() { + + } +}) \ No newline at end of file diff --git a/code/pages/student_info/student_info.json b/code/pages/student_info/student_info.json new file mode 100644 index 0000000..8835af0 --- /dev/null +++ b/code/pages/student_info/student_info.json @@ -0,0 +1,3 @@ +{ + "usingComponents": {} +} \ No newline at end of file diff --git a/code/pages/student_info/student_info.wxml b/code/pages/student_info/student_info.wxml new file mode 100644 index 0000000..1a68ada --- /dev/null +++ b/code/pages/student_info/student_info.wxml @@ -0,0 +1,27 @@ + + + 学号 + 姓名 + 点名次数 + 积分 + 操作 + + + + + + + + + {{item.studentId}} + {{item.name}} + {{item.callCount}} + {{item.score}} + 删除 + + + \ No newline at end of file diff --git a/code/pages/student_info/student_info.wxss b/code/pages/student_info/student_info.wxss new file mode 100644 index 0000000..5d42fee --- /dev/null +++ b/code/pages/student_info/student_info.wxss @@ -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; +} \ No newline at end of file diff --git a/code/project.config.json b/code/project.config.json new file mode 100644 index 0000000..e0eb071 --- /dev/null +++ b/code/project.config.json @@ -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" +} \ No newline at end of file diff --git a/code/project.private.config.json b/code/project.private.config.json new file mode 100644 index 0000000..ef05d4a --- /dev/null +++ b/code/project.private.config.json @@ -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 + } +} \ No newline at end of file diff --git a/code/sitemap.json b/code/sitemap.json new file mode 100644 index 0000000..ca02add --- /dev/null +++ b/code/sitemap.json @@ -0,0 +1,7 @@ +{ + "desc": "关于本文件的更多信息,请参考文档 https://developers.weixin.qq.com/miniprogram/dev/framework/sitemap.html", + "rules": [{ + "action": "allow", + "page": "*" + }] +} \ No newline at end of file diff --git a/code/utils/util.js b/code/utils/util.js new file mode 100644 index 0000000..764bc2c --- /dev/null +++ b/code/utils/util.js @@ -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 +}