From 27f1600197400fbaa4da9413aa5f27d319c2900f Mon Sep 17 00:00:00 2001
From: guotao_Z <3151635414@qq.com>
Date: Fri, 13 Oct 2023 19:01:22 +0800
Subject: [PATCH] course
---
zgt_src/course/course.js | 270 +++++++++++++++++++++++++++++++++++++
zgt_src/course/course.json | 3 +
zgt_src/course/course.wxml | 64 +++++++++
zgt_src/course/course.wxss | 77 +++++++++++
4 files changed, 414 insertions(+)
create mode 100644 zgt_src/course/course.js
create mode 100644 zgt_src/course/course.json
create mode 100644 zgt_src/course/course.wxml
create mode 100644 zgt_src/course/course.wxss
diff --git a/zgt_src/course/course.js b/zgt_src/course/course.js
new file mode 100644
index 0000000..30d0818
--- /dev/null
+++ b/zgt_src/course/course.js
@@ -0,0 +1,270 @@
+// pages/course/course.js
+/*Page({
+
+ /**
+ * 页面的初始数据
+
+ data: {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面加载
+
+ onLoad(options) {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面初次渲染完成
+
+ onReady() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面显示
+
+ onShow() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面隐藏
+
+ onHide() {
+
+ },
+
+ /**
+ * 生命周期函数--监听页面卸载
+
+ onUnload() {
+
+ },
+
+ /**
+ * 页面相关事件处理函数--监听用户下拉动作
+
+ onPullDownRefresh() {
+
+ },
+
+ /**
+ * 页面上拉触底事件的处理函数
+
+ onReachBottom() {
+
+ },
+
+ /**
+ * 用户点击右上角分享
+
+ onShareAppMessage() {
+
+ }
+})*/
+
+// pages/index/index.js
+Page({
+
+ data: {
+ mounth:"11", // 显示月份
+ // 头部数据 (数据也可以存储在数据库中读取出来,这样代码可以减少许多)
+ allOver:[{
+ id:0, // ID
+ week:"日", // 周
+ date:"23" // 日
+ },{
+ id:1,
+ week:"一",
+ date:"24"
+ },{
+ id:2,
+ week:"二",
+ date:"25"
+ },{
+ id:3,
+ week:"三",
+ date:"26"
+ },{
+ id:4,
+ week:"四",
+ date:"27"
+ },{
+ id:5,
+ week:"五",
+ date:"28"
+ },{
+ id:6,
+ week:"六",
+ date:"29"
+ }],
+ // 课程数据 (如果要从数据库取数据,需要进行排序)
+ courseInfo:[{
+ id:0,
+ week:"星期日",
+ // 代表当天拥有的课程
+ courseList:[
+ // 同理也需要排序,可以根据position来进行定位
+ {
+ id:0,
+ position:1,
+ ifexist:false,
+ },{
+ id:1,
+ position:2,
+ ifexist:true, // 存在与否属性
+ courseName:"高等数学", // 课程名称
+ courseRoom:"A-201" // 课程教室
+ },{
+ id:2,
+ position:3,
+ ifexist:false,
+ },{
+ id:3,
+ position:4,
+ ifexist:false,
+ }]
+ },{
+ id:1,
+ week:"星期一",
+ courseList:[{
+ id:0,
+ position:1,
+ ifexist:true,
+ courseName:"线性代数",
+ courseRoom:"B-301",
+ },{
+ id:1,
+ position:2,
+ ifexist:true,
+ courseName:"计算机导论",
+ courseRoom:"N25-101"
+ },{
+ id:2,
+ position:3,
+ ifexist:false,
+ },{
+ id:3,
+ position:4,
+ ifexist:false,
+ }]
+ },{
+ id:2,
+ week:"星期二",
+ courseList:[{
+ id:0,
+ position:1,
+ ifexist:false
+ },{
+ id:1,
+ position:2,
+ ifexist:true,
+ courseName:"数据结构",
+ courseRoom:"S3-201"
+ },{
+ id:2,
+ position:3,
+ ifexist:false,
+ },{
+ id:3,
+ position:4,
+ ifexist:false,
+ }]
+ },{
+ id:3,
+ week:"星期三",
+ courseList:[{
+ id:0,
+ position:1,
+ ifexist:false,
+ },{
+ id:1,
+ position:2,
+ ifexist:false,
+ },{
+ id:2,
+ position:3,
+ ifexist:true,
+ courseName:"互联网开发",
+ courseRoom:"N18-214"
+ },{
+ id:3,
+ position:4,
+ ifexist:false,
+ }]
+ },{
+ id:4,
+ week:"星期四",
+ courseList:[{
+ id:0,
+ position:1,
+ ifexist:true,
+ courseName:"程序设计基础",
+ courseRoom:"N25-333"
+ },{
+ id:1,
+ position:2,
+ ifexist:false,
+ },{
+ id:2,
+ position:3,
+ ifexist:false,
+ },{
+ id:3,
+ position:4,
+ ifexist:false,
+ }]
+ },{
+ id:5,
+ week:"星期五",
+ courseList:[{
+ id:0,
+ position:1,
+ ifexist:true,
+ courseName:"接口技术",
+ courseRoom:"N25-331"
+ },{
+ id:1,
+ position:2,
+ ifexist:false,
+ },{
+ id:2,
+ position:3,
+ ifexist:false,
+ },{
+ id:3,
+ position:4,
+ ifexist:false,
+ }]
+ },{
+ id:6,
+ week:"星期六",
+ courseList:[{
+ id:0,
+ position:1,
+ ifexist:true,
+ courseName:"Java程序设计",
+ courseRoom:"S5-101"
+ },{
+ id:1,
+ position:2,
+ ifexist:false,
+ },{
+ id:2,
+ position:3,
+ ifexist:false,
+ },{
+ id:3,
+ position:4,
+ ifexist:false,
+ }]
+ }]
+ },
+
+ onLoad(options) {
+
+ },
+
+})
\ No newline at end of file
diff --git a/zgt_src/course/course.json b/zgt_src/course/course.json
new file mode 100644
index 0000000..8835af0
--- /dev/null
+++ b/zgt_src/course/course.json
@@ -0,0 +1,3 @@
+{
+ "usingComponents": {}
+}
\ No newline at end of file
diff --git a/zgt_src/course/course.wxml b/zgt_src/course/course.wxml
new file mode 100644
index 0000000..189a020
--- /dev/null
+++ b/zgt_src/course/course.wxml
@@ -0,0 +1,64 @@
+
+pages/course/course.wxml
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{index+1}}
+
+
+
+
+
+
+
+
+
+
+
+
+ {{item1.courseList[index2].courseRoom}}
+
+
+ {{item1.courseList[index2].courseName}}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/zgt_src/course/course.wxss b/zgt_src/course/course.wxss
new file mode 100644
index 0000000..0090358
--- /dev/null
+++ b/zgt_src/course/course.wxss
@@ -0,0 +1,77 @@
+/* pages/course/course.wxss */
+
+
+page{
+ width: 100%;
+ height: 100%;
+}
+
+.farther_box{
+ width: 100%;
+ height: 100%;
+ display: flex;
+ flex-direction: column;
+}
+/* 头部样式 */
+.header_box{
+ width: 100%;
+ display: flex;
+}
+.header_item{
+ flex: 5;
+ text-align: center;
+ /*border: 1rpx solid black;*/
+ margin-left: 10rpx;
+ margin-right: 10rpx;
+}
+
+/* 表体样式 */
+.content_box{
+ display: flex;
+ height: 100%;
+}
+/* 左边 */
+.content_left{
+ flex: 1;
+ text-align: center;
+ display: flex;
+ padding-top: 50rpx;
+ flex-direction: column;
+}
+.content_left_item{
+ flex: 1;
+}
+/* 右边 */
+.content_right{
+ flex: 8;
+ display: flex;
+ position: relative;
+}
+.content_right_week_item{
+ height: 100%;
+ flex: 1;
+ z-index: 99;
+}
+.content_right_course_item{
+ display: flex;
+ flex-direction: column;
+ height: 100%;
+}
+.course_box{
+ flex: 1;
+ margin:8rpx 2rpx;
+}
+.course_item{
+ width: 100%;
+ height: 100%;
+ background-color: #9afffa;
+ border-radius: 15rpx;
+}
+.block{
+ flex: 1;
+}
+.gildLines{
+ display: flex;
+ height: 100%;
+ flex-direction: column;
+}
\ No newline at end of file