Repository: qq273681448/TimeTable Branch: master Commit: fc40618dcb6f Files: 13 Total size: 5.4 KB Directory structure: gitextract_5iyk_n_u/ ├── README.md ├── app.js ├── app.json ├── app.wxss ├── pages/ │ ├── index/ │ │ ├── index.js │ │ ├── index.json │ │ ├── index.wxml │ │ └── index.wxss │ └── logs/ │ ├── logs.js │ ├── logs.json │ ├── logs.wxml │ └── logs.wxss └── utils/ └── util.js ================================================ FILE CONTENTS ================================================ ================================================ FILE: README.md ================================================ # TimeTable 微信小程序课程表,漂亮简洁大方。
博客https://juejin.im/post/593246bd2f301e005840e37f
![课程表](https://github.com/qq273681448/TimeTable/blob/master/p.jpg) ![课程表](https://github.com/qq273681448/TimeTable/blob/master/p1.jpg) ![课程表](https://github.com/qq273681448/TimeTable/blob/master/p2.jpg) ![课程表](https://github.com/qq273681448/TimeTable/blob/master/p3.jpg) ================================================ FILE: app.js ================================================ //app.js App({ onLaunch: function () { //调用API从本地缓存中获取数据 var logs = wx.getStorageSync('logs') || [] logs.unshift(Date.now()) wx.setStorageSync('logs', logs) }, getUserInfo:function(cb){ var that = this if(this.globalData.userInfo){ typeof cb == "function" && cb(this.globalData.userInfo) }else{ //调用登录接口 wx.login({ success: function () { wx.getUserInfo({ success: function (res) { that.globalData.userInfo = res.userInfo typeof cb == "function" && cb(that.globalData.userInfo) } }) } }) } }, globalData:{ userInfo:null } }) ================================================ FILE: app.json ================================================ { "pages":[ "pages/index/index", "pages/logs/logs" ], "window":{ "backgroundTextStyle": "dark", "navigationBarTitleText": "TimeTable", "navigationBarBackgroundColor": "#7cba23", "navigationBarTextStyle": "light" } } ================================================ FILE: app.wxss ================================================ /**app.wxss**/ .container { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: space-between; padding: 200rpx 0; box-sizing: border-box; } ================================================ FILE: pages/index/index.js ================================================ //index.js //获取应用实例 var app = getApp() Page({ data: { colorArrays: [ "#85B8CF", "#90C652", "#D8AA5A", "#FC9F9D", "#0A9A84", "#61BC69", "#12AEF3", "#E29AAD"], 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": 4, "skjc": 8, "skcd": 2, "kcmc": "高等数学@教A-301" }, { "xqj": 5, "skjc": 1, "skcd": 2, "kcmc": "高等数学@教A-301" }, { "xqj": 6, "skjc": 3, "skcd": 2, "kcmc": "高等数学@教A-301" }, { "xqj": 7, "skjc": 5, "skcd": 3, "kcmc": "高等数学@教A-301" }, ] }, onLoad: function () { console.log('onLoad') } }) ================================================ FILE: pages/index/index.json ================================================ {} ================================================ FILE: pages/index/index.wxml ================================================ 周{{item}} {{item}} {{item.kcmc}} ================================================ FILE: pages/index/index.wxss ================================================ /**index.wxss**/ .flex-item { width: 95rpx; height: 100px; } .kcb-item { position: absolute; justify-content: center; display: flex; align-items: center; border-radius: 5px; } .smalltext { font-size: 8pt; color: #fff; padding-left: 2px; } .top { display: flex; flex-direction: row; margin-left: 35rpx; background-color: #d2e6b3; color: #7cba23; } .top-text { width: 100rpx; height: 35rpx; font-size: 9pt; justify-content: center; display: flex; align-items: center; } .scroll { height: 1170rpx; z-index: 101; position: fixed; } .left { width: 35rpx; height: 100rpx; font-size: 9pt; justify-content: center; display: flex; align-items: center; } ================================================ FILE: pages/logs/logs.js ================================================ //logs.js var util = require('../../utils/util.js') Page({ data: { logs: [] }, onLoad: function () { this.setData({ logs: (wx.getStorageSync('logs') || []).map(function (log) { return util.formatTime(new Date(log)) }) }) } }) ================================================ FILE: pages/logs/logs.json ================================================ { "navigationBarTitleText": "查看启动日志" } ================================================ FILE: pages/logs/logs.wxml ================================================ {{index + 1}}. {{log}} ================================================ FILE: pages/logs/logs.wxss ================================================ .log-list { display: flex; flex-direction: column; padding: 40rpx; } .log-item { margin: 10rpx; } ================================================ FILE: utils/util.js ================================================ function formatTime(date) { var year = date.getFullYear() var month = date.getMonth() + 1 var day = date.getDate() var hour = date.getHours() var minute = date.getMinutes() var second = date.getSeconds() return [year, month, day].map(formatNumber).join('/') + ' ' + [hour, minute, second].map(formatNumber).join(':') } function formatNumber(n) { n = n.toString() return n[1] ? n : '0' + n } module.exports = { formatTime: formatTime }