From aa3443f46a6ed0a5cd42f7f8182c3c49e963d4f4 Mon Sep 17 00:00:00 2001 From: a <455919189@qq.com> Date: Mon, 9 May 2022 15:41:46 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E6=96=87=E4=BB=B6=E8=87=B3?= =?UTF-8?q?=20'pages/timetable'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/timetable/timetable.js | 132 +++++++++++++++++++++++++++++++++ pages/timetable/timetable.json | 6 ++ pages/timetable/timetable.wxml | 25 +++++++ pages/timetable/timetable.wxss | 58 +++++++++++++++ 4 files changed, 221 insertions(+) create mode 100644 pages/timetable/timetable.js create mode 100644 pages/timetable/timetable.json create mode 100644 pages/timetable/timetable.wxml create mode 100644 pages/timetable/timetable.wxss diff --git a/pages/timetable/timetable.js b/pages/timetable/timetable.js new file mode 100644 index 0000000..fa2fa0d --- /dev/null +++ b/pages/timetable/timetable.js @@ -0,0 +1,132 @@ +// pages/timetable/timetable.js +Page({ + + /** + * 页面的初始数据 + */ + data: { + reallist:[], + wlist: [ + { "xqj": 1, "skjc": 1, "skcd": 3, "kcmc": "高等数学@教A-301" }, + { "xqj": 1, "skjc": 5, "skcd": 3, "kcmc": "高等数学@教A-301" }, + { "xqj": 2, "skjc": 1, "skcd": 2,"kcmc":"高等数学@教A-301"}, + { "xqj": 2, "skjc": 8, "skcd": 2, "kcmc": "高等数学@教A-301" }, + { "xqj": 3, "skjc": 4, "skcd": 1, "kcmc": "高等数学@教A-301" }, + { "xqj": 3, "skjc": 8, "skcd": 1, "kcmc": "高等数学@教A-301" }, + { "xqj": 3, "skjc": 5, "skcd": 2, "kcmc": "高等数学@教A-301" }, + { "xqj": 4, "skjc": 2, "skcd": 3, "kcmc": "高等数学@教A-301" }, + { "xqj": 5, "skjc": 1, "skcd": 2, "kcmc": "高等数学@教A-301" }, + ], + option1: [ + // { text: '2020-2021学年1', value: 2 }, + ], + option2: [ + { text: '第1周', value: '1' }, + { text: '第2周', value: '2' }, + { text: '第3周', value: '3' }, + { text: '第4周', value: '4' }, + { text: '第5周', value: '5' }, + { text: '第6周', value: '6' }, + { text: '第7周', value: '7' }, + { text: '第8周', value: '8' }, + { text: '第9周', value: '9' }, + { text: '第10周', value: '10' }, + ], + value1: 0, + value2: 'a', + colorArrays: [ "#f8f8fc","#f8f8fc", "#f8f8fc", "#f8f8fc", "#f8f8fc", "#f8f8fc", "#f8f8fc", "#f8f8fc", "#f8f8fc"], + + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + + wx.getStorage({ + key:"data", + success:(res)=>{ + var uid = res.data.uid + wx.request({ + url: 'http://10.0.100.100:8000/u/'+uid+'/sems', + method:"GET", + success:(res)=>{ + this.setData({option1:res.data.data}) + } + }) + } + }) + + }, + + /** + * 生命周期函数--监听页面初次渲染完成 + */ + onReady: function () { + + }, + + /** + * 生命周期函数--监听页面显示 + */ + onShow: function () { + + }, + + /** + * 生命周期函数--监听页面隐藏 + */ + onHide: function () { + + }, + + /** + * 生命周期函数--监听页面卸载 + */ + onUnload: function () { + + }, + + /** + * 页面相关事件处理函数--监听用户下拉动作 + */ + onPullDownRefresh: function () { + + }, + + /** + * 页面上拉触底事件的处理函数 + */ + onReachBottom: function () { + + }, + + /** + * 用户点击右上角分享 + */ + onShareAppMessage: function () { + + }, + change: function (e) { + wx.request({ + url: 'http://10.0.100.100:8000/u/201150235/schedule?sem_id='+e.detail, + method:"GET", + success:(res)=>{ + this.setData({wlist:res.data.data}) + } + }) + }, + change2: function (e) { + console.log(e.detail) + var list = [] + var arr = this.data.wlist + for (var i in arr){ + if (parseInt(e.detail) >= parseInt(arr[i].week_list[0].start_week) && parseInt(e.detail) <= parseInt(arr[i].week_list[0].end_week)){ + list.push(arr[i]) + } + } + this.setData({reallist:list}) + console.log(this.data.reallist) + } + +}) \ No newline at end of file diff --git a/pages/timetable/timetable.json b/pages/timetable/timetable.json new file mode 100644 index 0000000..8947d6b --- /dev/null +++ b/pages/timetable/timetable.json @@ -0,0 +1,6 @@ +{ + "usingComponents": { + "xiala":"../../components/dist/dropdown-menu/index", + "xiala-item":"../../components/dist/dropdown-item/index" + } +} \ No newline at end of file diff --git a/pages/timetable/timetable.wxml b/pages/timetable/timetable.wxml new file mode 100644 index 0000000..418d92a --- /dev/null +++ b/pages/timetable/timetable.wxml @@ -0,0 +1,25 @@ + + + + + + + + + 星期{{item}} + + + + {{item}} + + + + + + + + + {{item.course_name}} + + + diff --git a/pages/timetable/timetable.wxss b/pages/timetable/timetable.wxss new file mode 100644 index 0000000..95c1a8a --- /dev/null +++ b/pages/timetable/timetable.wxss @@ -0,0 +1,58 @@ +/* pages/timetable/timetable.wxss */ +.xiala{ +/* margin-bottom: 100rpx; */ +} +.top { + display: flex; + flex-direction: row; + margin-left: 50rpx; + background-color: #E6E6E6; + color: #000; + display: flex; + justify-content: space-around; + align-items: center; +} + +.top-text { + width: 200rpx; + height: 50rpx; + font-size: 10pt; + justify-content: center; + display: flex; + align-items: center; +} +.left { + width: 50rpx; + height: 100rpx; + font-size: 10pt; + justify-content: center; + display: flex; + align-items: center; +} +.flex-item { + width: 95rpx; + height: 100px; +} + +.kcb-item { + background-color: #EFD3A1; + position: absolute; + display: flex; + justify-content: space-around; + align-items: center; + border-radius: 5px; + box-shadow: -3px 0px 5px #EFB56F; + width: 140rpx; +} + +.smalltext { + background-color: #EFD3A1; + font-size: 10pt; + color: #A1731D; + padding-left: 2px; +} +.scroll { + height: 1250rpx; + z-index: 101; + position: fixed; +} \ No newline at end of file