Skip to content

Commit 975fac9

Browse files
author
Yang
committed
xdu1.1
1 parent 45b1470 commit 975fac9

15 files changed

+912
-197
lines changed

app.js

+15
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,19 @@ App({
55
//host:"http://localhost:8080",
66
//host:"http://192.168.137.1:8080"
77
},
8+
9+
onLaunch: function() {
10+
wx.getSystemInfo({
11+
success: e => {
12+
this.globalData.StatusBar = e.statusBarHeight;
13+
let capsule = wx.getMenuButtonBoundingClientRect();
14+
if (capsule) {
15+
this.globalData.Custom = capsule;
16+
this.globalData.CustomBar = capsule.bottom + capsule.top - e.statusBarHeight;
17+
} else {
18+
this.globalData.CustomBar = e.statusBarHeight + 50;
19+
}
20+
}
21+
})
22+
}
823
})

app.json

+41-40
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,28 @@
11
{
2-
"pages": [
3-
"pages/index/index",
4-
"pages/login/login",
5-
"pages/edit/edit",
6-
7-
8-
9-
"pages/topic/topic",
10-
"pages/user/user",
11-
"pages/authorize/authorize",
12-
13-
"pages/detailTopic/detailTopic",
14-
15-
"pages/addTopic/addTopic",
16-
"pages/detail/detail",
17-
"pages/contestDetail/contestDetail"
18-
19-
20-
],
21-
"lazyCodeLoading": "requiredComponents",
22-
"tabBar": {
23-
"selectedColor": "#3271ae",
24-
"list": [
25-
{
2+
"pages": [
3+
"pages/index/index",
4+
"pages/course/course",
5+
"pages/login/login",
6+
"pages/edit/edit",
7+
8+
9+
10+
"pages/topic/topic",
11+
"pages/user/user",
12+
"pages/authorize/authorize",
13+
14+
"pages/detailTopic/detailTopic",
15+
16+
"pages/addTopic/addTopic",
17+
"pages/detail/detail",
18+
"pages/contestDetail/contestDetail"
19+
20+
21+
],
22+
"lazyCodeLoading": "requiredComponents",
23+
"tabBar": {
24+
"selectedColor": "#3271ae",
25+
"list": [{
2626
"pagePath": "pages/index/index",
2727
"text": "首页",
2828
"iconPath": "/assets/images/index.png",
@@ -41,22 +41,23 @@
4141
"selectedIconPath": "/assets/images/user1.png"
4242
}
4343
]
44-
},
45-
"window": {
46-
"backgroundTextStyle": "dark",
47-
"navigationBarBackgroundColor": "#fff",
48-
"navigationBarTitleText": "Weixin",
44+
},
45+
"window": {
46+
"backgroundTextStyle": "dark",
47+
"navigationBarBackgroundColor": "#fff",
48+
"navigationBarTitleText": "Weixin",
4949
"navigationBarTextStyle": "black",
5050
"backgroundColor": "#ececec"
51-
},
52-
"usingComponents": {
53-
"van-button": "@vant/weapp/button/index",
54-
"van-toast": "@vant/weapp/toast/index",
55-
"van-empty": "@vant/weapp/empty/index",
56-
"van-dialog": "@vant/weapp/dialog/index",
57-
"van-notify": "@vant/weapp/notify/index",
58-
"i-load-more": "../../dist/load-more/index"
59-
},
60-
61-
"sitemapLocation": "sitemap.json"
51+
},
52+
"usingComponents": {
53+
"van-button": "@vant/weapp/button/index",
54+
"van-toast": "@vant/weapp/toast/index",
55+
"van-empty": "@vant/weapp/empty/index",
56+
"van-dialog": "@vant/weapp/dialog/index",
57+
"van-notify": "@vant/weapp/notify/index",
58+
"i-load-more": "../../dist/load-more/index",
59+
"van-icon": "@vant/weapp/icon/index"
60+
},
61+
62+
"sitemapLocation": "sitemap.json"
6263
}

app.wxss

+5-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@
1010
url('//at.alicdn.com/t/c/font_3984136_sq6x3xc6m3s.woff?t=1680071199075') format('woff'),
1111
url('//at.alicdn.com/t/c/font_3984136_sq6x3xc6m3s.ttf?t=1680071199075') format('truetype');
1212
}
13-
13+
page{
14+
--theme: #1380ff;
15+
--yellow: #ffa807;
16+
--gradualTheme: linear-gradient(45deg, #1380ff, #1cbbb4);
17+
}
1418
.iconfont {
1519
font-family: "iconfont" !important;
1620
font-size: 16px;

pages/course/course.js

+195
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,195 @@
1+
// pages/course/course.js
2+
import utils from '../../utils/utils.js'
3+
const app = getApp()
4+
Page({
5+
6+
/**
7+
* 页面的初始数据
8+
*/
9+
data: {
10+
colorArrays: ["#85B8CF", "#90C652", "#D8AA5A", "#FC9F9D", "#0A9A84", "#61BC69", "#12AEF3", "#E29AAD"],
11+
wlist: [
12+
{ "xqj": 1, "skjc": 1, "skcd": 3, "kcmc": "高等数学@教A-301" },
13+
{ "xqj": 1, "skjc": 5, "skcd": 3, "kcmc": "高等数学@教A-301" },
14+
{ "xqj": 2, "skjc": 1, "skcd": 2, "kcmc": "高等数学@教A-301" },
15+
{ "xqj": 2, "skjc": 8, "skcd": 2, "kcmc": "高等数学@教A-301" },
16+
{ "xqj": 3, "skjc": 4, "skcd": 1, "kcmc": "高等数学@教A-301" },
17+
{ "xqj": 3, "skjc": 8, "skcd": 1, "kcmc": "高等数学@教A-301" },
18+
{ "xqj": 3, "skjc": 5, "skcd": 2, "kcmc": "高等数学@教A-301" },
19+
{ "xqj": 4, "skjc": 2, "skcd": 3, "kcmc": "高等数学@教A-301" },
20+
{ "xqj": 4, "skjc": 8, "skcd": 2, "kcmc": "高等数学@教A-301" },
21+
{ "xqj": 5, "skjc": 1, "skcd": 2, "kcmc": "高等数学@教A-301" },
22+
{ "xqj": 6, "skjc": 3, "skcd": 2, "kcmc": "高等数学@教A-301" },
23+
{ "xqj": 7, "skjc": 5, "skcd": 3, "kcmc": "高等数学@教A-301" },
24+
25+
],
26+
kcb: [],
27+
result: null,
28+
showWeekList: false,
29+
classShow:false,
30+
customBar: app.globalData.CustomBar,
31+
statusBar: app.globalData.StatusBar,
32+
custom: app.globalData.Custom,
33+
selectWeek:null
34+
35+
},
36+
BackPage(){
37+
wx.navigateBack({
38+
delta: 1
39+
});
40+
41+
},
42+
clickClass(e) {
43+
wx.vibrateShort({
44+
type: 'medium',
45+
})
46+
this.setData({
47+
classShow:true,
48+
currentClass:e.currentTarget.dataset.index
49+
})
50+
console.log(e)
51+
52+
},
53+
onClassClose(){
54+
this.setData({
55+
classShow:false
56+
})
57+
},
58+
selectWeek(e){
59+
var week = parseInt(e.currentTarget.dataset.index) + 1;
60+
var date = utils.getWeekDates(week)
61+
62+
this.setData({
63+
selectWeek:week,
64+
date:date
65+
})
66+
wx.getStorage({
67+
key: "kcb",
68+
success: (res) => {
69+
let array = res.data
70+
let kcb = []
71+
for (let index = 0; index < array.length; index++) {
72+
const element = array[index];
73+
if (utils.checkWeekRange(element.ZCMC, week)) {
74+
kcb.push(element)
75+
}
76+
77+
}
78+
//console.log(kcb)
79+
kcb = utils.getWeekSchedul(kcb)
80+
//console.log(kcb)
81+
this.setData({
82+
kcb: kcb
83+
// userInfo: res.data
84+
})
85+
86+
87+
}
88+
})
89+
this.hideWeekList()
90+
},
91+
92+
showWeekList() {
93+
wx.vibrateShort({
94+
type: 'heavy'
95+
96+
})
97+
this.setData({
98+
showWeekList: true
99+
})
100+
},
101+
102+
hideWeekList() {
103+
this.setData({
104+
showWeekList: false
105+
})
106+
},
107+
108+
109+
110+
/**
111+
* 生命周期函数--监听页面加载
112+
*/
113+
onLoad(options) {
114+
let result = utils.calcuWeek()
115+
let date = utils.getThisWeekDates()
116+
this.setData({
117+
result: result,
118+
date: date,
119+
selectWeek:result.week
120+
})
121+
wx.getStorage({
122+
key: "kcb",
123+
success: (res) => {
124+
let array = res.data
125+
let kcb = []
126+
for (let index = 0; index < array.length; index++) {
127+
const element = array[index];
128+
if (utils.checkWeekRange(element.ZCMC, result.week)) {
129+
kcb.push(element)
130+
}
131+
132+
}
133+
kcb = utils.getWeekSchedul(kcb)
134+
console.log(kcb)
135+
this.setData({
136+
kcb: kcb
137+
// userInfo: res.data
138+
})
139+
140+
141+
}
142+
})
143+
144+
145+
},
146+
147+
/**
148+
* 生命周期函数--监听页面初次渲染完成
149+
*/
150+
onReady() {
151+
152+
},
153+
154+
/**
155+
* 生命周期函数--监听页面显示
156+
*/
157+
onShow() {
158+
159+
},
160+
161+
/**
162+
* 生命周期函数--监听页面隐藏
163+
*/
164+
onHide() {
165+
166+
},
167+
168+
/**
169+
* 生命周期函数--监听页面卸载
170+
*/
171+
onUnload() {
172+
173+
},
174+
175+
/**
176+
* 页面相关事件处理函数--监听用户下拉动作
177+
*/
178+
onPullDownRefresh() {
179+
180+
},
181+
182+
/**
183+
* 页面上拉触底事件的处理函数
184+
*/
185+
onReachBottom() {
186+
187+
},
188+
189+
/**
190+
* 用户点击右上角分享
191+
*/
192+
onShareAppMessage() {
193+
194+
}
195+
})

pages/course/course.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"usingComponents": {
3+
"cu-custom": "/colorui/components/cu-custom",
4+
"van-popup": "@vant/weapp/popup/index"
5+
6+
},
7+
"navigationBarTitleText": "课程安排",
8+
"navigationStyle": "custom"
9+
10+
11+
}

0 commit comments

Comments
 (0)