Skip to content

Commit 656c943

Browse files
committed
demo
0 parents  commit 656c943

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+1545
-0
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
.DS_Store
2+
node_modules/
3+
npm-debug.log
4+
selenium-debug.log

app.js

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
//app.js
2+
import service from './utils/service'
3+
4+
App({
5+
onLaunch: function () {
6+
// 预登录
7+
// let that = this
8+
// this.doLogin(function (data) {
9+
// that.globalData.userInfo = data
10+
// }, function () {
11+
// console.log('login error')
12+
// })
13+
},
14+
15+
doLogin: function (onSuccess, onFail) {
16+
wx.checkSession({
17+
success: function () { // wx session_key 未过期
18+
// 从本地缓存中获取 sys session
19+
try {
20+
let value = wx.getStorageSync('sysSession')
21+
if (value) { // system login
22+
service.getUserInfo(value, onSuccess, onFail)
23+
} else { // weixin login
24+
service.login(onSuccess, onFail)
25+
}
26+
} catch (e) { // weixin login
27+
service.login(onSuccess, onFail)
28+
}
29+
},
30+
fail: function () { // 登录态过期,需重新登录
31+
service.login(onSuccess, onFail)
32+
}
33+
})
34+
},
35+
36+
/**
37+
* 获取用户信息
38+
*/
39+
getUserInfo: function (onSuccess, onFail) {
40+
if (this.globalData.userInfo) {
41+
typeof onSuccess == "function" && onSuccess(this.globalData.userInfo)
42+
} else {
43+
let that = this
44+
this.doLogin(function (data) {
45+
that.globalData.userInfo = data
46+
onSuccess(data)
47+
}, function () {
48+
console.log('login error')
49+
typeof onFail == "function" && onFail()
50+
})
51+
}
52+
},
53+
54+
/**
55+
* 全局数据
56+
*/
57+
globalData: {
58+
userInfo: null, // 用户信息
59+
currentCourse: null // 当前课程数据
60+
}
61+
})

app.json

+50
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
{
2+
"pages": [
3+
"pages/splash/splash",
4+
"pages/schedule/schedule",
5+
"pages/addCourse/addCourse",
6+
"pages/editCourse/editCourse",
7+
"pages/queryCourse/queryCourse",
8+
"pages/queryResult/queryResult",
9+
"pages/queryQuiz/queryQuiz",
10+
"pages/feedback/feedback"
11+
],
12+
"window": {
13+
"navigationBarBackgroundColor": "#000000",
14+
"navigationBarTextStyle": "white",
15+
"navigationBarTitleText": "课表",
16+
"backgroundColor": "#000000",
17+
"backgroundTextStyle": "light",
18+
"enablePullDownRefresh": false
19+
},
20+
"tabBar": {
21+
"color": "#7a7d80",
22+
"selectedColor": "#fe5700",
23+
"borderStyle": "black",
24+
"backgroundColor": "#ffffff",
25+
"list": [
26+
{
27+
"text": "查看课程",
28+
"pagePath": "pages/queryCourse/queryCourse",
29+
"iconPath": "images/icon_1course_n@2x.png",
30+
"selectedIconPath": "images/icon_1course_p@2x.png"
31+
},
32+
{
33+
"text": "查看反馈",
34+
"pagePath": "pages/queryResult/queryResult",
35+
"iconPath": "images/icon_2feedback_n@2x.png",
36+
"selectedIconPath": "images/icon_2feedback_p@2x.png"
37+
},
38+
{
39+
"text": "考考孩子",
40+
"pagePath": "pages/queryQuiz/queryQuiz",
41+
"iconPath": "images/icon_3child_n@2x.png",
42+
"selectedIconPath": "images/icon_3child_p@2x.png"
43+
}
44+
]
45+
},
46+
"networkTimeout": {
47+
"request": 10000
48+
},
49+
"debug": true
50+
}

app.wxss

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/**app.wxss**/
2+
/*@import 'libs/weui.wxss';*/
3+
4+
page {
5+
height: 100%;
6+
width: 100%;
7+
overflow: hidden;
8+
background-color: #f8f8f8;
9+
font-family: -apple-system-font, 'Helvetica Neue', Helvetica, 'Microsoft YaHei', sans-serif;
10+
}
11+
12+
.container {
13+
display: flex;
14+
flex-direction: column;
15+
box-sizing: border-box;
16+
height: 100%;
17+
}
18+
19+
.nav-home-btn {
20+
width: 128rpx;
21+
height: 128rpx;
22+
position: absolute;
23+
right: 20rpx;
24+
bottom: 70rpx;
25+
}
26+
27+
.nav-home-btn image {
28+
width: 100%;
29+
height: 100%;
30+
}
31+
32+
.img-button {
33+
display: inline-block;
34+
}
35+
36+
.img-button image {
37+
width: 100%;
38+
height: 100%;
39+
}

images/Triangle@2x.png

291 Bytes
Loading

images/btn_add@2x.png

1.07 KB
Loading

images/btn_feed@2x.png

1.78 KB
Loading

images/btn_home@2x.png

3.68 KB
Loading

images/btn_next@2x.png

198 Bytes
Loading

images/btn_prev@2x.png

195 Bytes
Loading

images/icon_1course_n@2x.png

1.9 KB
Loading

images/icon_1course_p@2x.png

1.67 KB
Loading

images/icon_2feedback_n@2x.png

1.15 KB
Loading

images/icon_2feedback_p@2x.png

1.01 KB
Loading

images/icon_3child_n@2x.png

1.7 KB
Loading

images/icon_3child_p@2x.png

1.51 KB
Loading

images/launch@2x.jpg

62 KB
Loading

images/xing@2x.png

1.61 KB
Loading

images/xk_n@2x.png

1.4 KB
Loading

images/xk_p@2x.png

1.77 KB
Loading

libs/weui.wxss

+6
Large diffs are not rendered by default.

pages/addCourse/addCourse.js

+69
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
// pages/addCourse/addCourse.js
2+
import service from '../../utils/service'
3+
var app = getApp();
4+
5+
Page({
6+
7+
/**
8+
* 页面的初始数据
9+
*/
10+
data: {
11+
12+
},
13+
14+
/**
15+
* 生命周期函数--监听页面加载
16+
*/
17+
onLoad: function (options) {
18+
19+
},
20+
21+
/**
22+
* 生命周期函数--监听页面初次渲染完成
23+
*/
24+
onReady: function () {
25+
26+
},
27+
28+
/**
29+
* 生命周期函数--监听页面显示
30+
*/
31+
onShow: function () {
32+
33+
},
34+
35+
/**
36+
* 生命周期函数--监听页面隐藏
37+
*/
38+
onHide: function () {
39+
40+
},
41+
42+
/**
43+
* 生命周期函数--监听页面卸载
44+
*/
45+
onUnload: function () {
46+
47+
},
48+
49+
/**
50+
* 页面相关事件处理函数--监听用户下拉动作
51+
*/
52+
onPullDownRefresh: function () {
53+
54+
},
55+
56+
/**
57+
* 页面上拉触底事件的处理函数
58+
*/
59+
onReachBottom: function () {
60+
61+
},
62+
63+
/**
64+
* 用户点击右上角分享
65+
*/
66+
onShareAppMessage: function () {
67+
68+
}
69+
})

pages/addCourse/addCourse.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"navigationBarTitleText": "新增课程"
3+
}

pages/addCourse/addCourse.wxml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!--pages/addCourse/addCourse.wxml-->
2+
<text>pages/addCourse/addCourse.wxml</text>

pages/addCourse/addCourse.wxss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* pages/addCourse/addCourse.wxss */

pages/editCourse/editCourse.js

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
// pages/editCourse/editCourse.js
2+
var app = getApp();
3+
4+
Page({
5+
6+
/**
7+
* 页面的初始数据
8+
*/
9+
data: {
10+
11+
},
12+
13+
/**
14+
* 生命周期函数--监听页面加载
15+
*/
16+
onLoad: function (options) {
17+
18+
},
19+
20+
/**
21+
* 生命周期函数--监听页面初次渲染完成
22+
*/
23+
onReady: function () {
24+
25+
},
26+
27+
/*
28+
* 生命周期函数--监听页面显示
29+
*/
30+
onShow: function () {
31+
32+
},
33+
34+
/**
35+
* 生命周期函数--监听页面隐藏
36+
*/
37+
onHide: function () {
38+
39+
},
40+
41+
/**
42+
* 生命周期函数--监听页面卸载
43+
*/
44+
onUnload: function () {
45+
46+
},
47+
48+
/**
49+
* 页面相关事件处理函数--监听用户下拉动作
50+
*/
51+
onPullDownRefresh: function () {
52+
53+
},
54+
55+
/**
56+
* 页面上拉触底事件的处理函数
57+
*/
58+
onReachBottom: function () {
59+
60+
},
61+
62+
/**
63+
* 用户点击右上角分享
64+
*/
65+
onShareAppMessage: function () {
66+
67+
}
68+
})

pages/editCourse/editCourse.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"navigationBarTitleText": "查看课程"
3+
}

pages/editCourse/editCourse.wxml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!--pages/editCourse/editCourse.wxml-->
2+
<text>pages/editCourse/editCourse.wxml</text>

pages/editCourse/editCourse.wxss

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/* pages/editCourse/editCourse.wxss */

pages/feedback/feedback.js

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
// pages/feedback/feedback.js
2+
Page({
3+
4+
/**
5+
* 页面的初始数据
6+
*/
7+
data: {
8+
9+
},
10+
11+
/**
12+
* 生命周期函数--监听页面加载
13+
*/
14+
onLoad: function (options) {
15+
16+
},
17+
18+
/**
19+
* 生命周期函数--监听页面初次渲染完成
20+
*/
21+
onReady: function () {
22+
23+
},
24+
25+
/**
26+
* 生命周期函数--监听页面显示
27+
*/
28+
onShow: function () {
29+
30+
},
31+
32+
/**
33+
* 生命周期函数--监听页面隐藏
34+
*/
35+
onHide: function () {
36+
37+
},
38+
39+
/**
40+
* 生命周期函数--监听页面卸载
41+
*/
42+
onUnload: function () {
43+
44+
},
45+
46+
/**
47+
* 页面相关事件处理函数--监听用户下拉动作
48+
*/
49+
onPullDownRefresh: function () {
50+
51+
},
52+
53+
/**
54+
* 页面上拉触底事件的处理函数
55+
*/
56+
onReachBottom: function () {
57+
58+
},
59+
60+
/**
61+
* 用户点击右上角分享
62+
*/
63+
onShareAppMessage: function () {
64+
65+
}
66+
})

pages/feedback/feedback.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"navigationBarTitleText": "反馈"
3+
}

pages/feedback/feedback.wxml

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
<!--pages/feedback/feedback.wxml-->
2+
<text>pages/feedback/feedback.wxml</text>

0 commit comments

Comments
 (0)