Skip to content
This repository has been archived by the owner on Apr 12, 2022. It is now read-only.

Commit

Permalink
Merge pull request #1 from BB-fat/feature/school-life-2020
Browse files Browse the repository at this point in the history
归拢分支,存档项目。
  • Loading branch information
BB-fat authored Mar 6, 2021
2 parents 0e74389 + 3c860e5 commit 744dec9
Show file tree
Hide file tree
Showing 14 changed files with 323 additions and 72 deletions.
10 changes: 3 additions & 7 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
"pages/my/my",
"pages/webview/webview",
"pages/aboutus/aboutus",
"pages/homework/homework"
"pages/homework/homework",
"pages/school-life-2020/school-life-2020",
"pages/school-life-2020-web/school-life-2020-web"
],
"window": {
"backgroundTextStyle": "light",
Expand All @@ -38,12 +40,6 @@
"pagePath": "pages/iclass/iclass",
"text": "多模式"
},
{
"selectedIconPath": "img/tabbar/[email protected]",
"iconPath": "img/tabbar/[email protected]",
"pagePath": "pages/idel-index/idel-index",
"text": "闲置屋Beta"
},
{
"selectedIconPath": "img/tabbar/my_active.png",
"iconPath": "img/tabbar/my.png",
Expand Down
Binary file added img/school-life/banner.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added img/school-life/bg.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
52 changes: 26 additions & 26 deletions pages/auth/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,32 +14,32 @@ Page({
/**
* 生命周期函数--监听页面加载
*/
// onLoad: function (options) {
// let that = this
// if (options.mode == "yunschool") {
// wx.login({
// success(res1) {
// if (res1.code) {
// setTimeout(() => {
// that.setData({
// url: "https://ucpay.ncut.edu.cn/open/user/oauth/index?redirect=" + Requests.baseUrl + "/auth&appid=31b1e992583074382&state=" + res1.code,
// show: 1
// })
// }, 2000)
// } else {
// console.log('登录失败!' + res1.errMsg)
// }
// }
// })
// } else if (options.mode == "wechat") {
// if (Requests.token == null) {
// Requests.refreshToken(() => {})
// }
// that.setData({
// show: 2
// })
// }
// },
onLoad: function (options) {
let that = this
if (options.mode == "yunschool") {
wx.login({
success(res1) {
if (res1.code) {
setTimeout(() => {
that.setData({
url: "https://ucpay.ncut.edu.cn/open/user/oauth/index?redirect=" + Requests.baseUrl + "/auth&appid=31b1e992583074382&state=" + res1.code,
show: 1
})
}, 2000)
} else {
console.log('登录失败!' + res1.errMsg)
}
}
})
} else if (options.mode == "wechat") {
if (Requests.token == null) {
Requests.refreshToken(() => {})
}
that.setData({
show: 2
})
}
},

tapButton: function (e) {
Requests.put({
Expand Down
84 changes: 47 additions & 37 deletions pages/index/index.wxml
Original file line number Diff line number Diff line change
@@ -1,39 +1,49 @@
<view>
<swiper class="picswiper" autoplay="true" circular="true" interval="4000">
<block wx:for="{{indexBanner}}">
<swiper-item class='pic_item radius-shadow'>
<navigator hover-class="banner-hover" url="{{'../webview/webview?url='+item.msgurl}}">
<image src='{{item.imgurl}}' class="swiper_img" mode='scaleToFill' data-index='{{index}}' bindtap='swipclick'></image>
</navigator>
</swiper-item>
</block>
</swiper>
<view class="notice radius-shadow">
<view class='imgbox'>
<image src="/img/index/notice.svg" class="notice_img" bindlongpress="clearStorage"></image>
</view>
<view style="flex:1;">
<swiper class="wordswiper" autoplay="true" circular="true" interval="4000" vertical='true'>
<block wx:for="{{indexNotice}}">
<swiper-item class='word_item'>
<text>{{item.text}}</text>
</swiper-item>
</block>
</swiper>
</view>
</view>
<view class="button-view">
<index-button icon="/img/index/kebiao.svg" text="课表" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_kecheng'}}" />
<index-button icon="/img/index/jiaoshi.svg" text="教室" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_room/emroom/index'}}" />
<index-button icon="/img/index/chengji.svg" text="成绩" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_score'}}" />
<index-button icon="/img/index/jidian.svg" text="绩点" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_kecheng/grade/list'}}" />
<index-button icon="/img/index/xuefen.svg" text="学分" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_exam/default/graduate'}}" />
<index-button icon="/img/index/selectcourse.svg" text="选课" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_kecheng/course/list'}}" />
</view>
<view class='cat-box'>
<image src='/img/index/dialog.svg' class='dialog' hidden='{{showCat}}'>
<text>我的北方可以接推广了哦!</text>
</image>
<image class='cat' bindtap='tapCat' src='/img/index/cat.svg'></image>
</view>
<swiper class="picswiper" autoplay="true" circular="true" interval="5000">

<!-- 点滴校园2020 -->
<swiper-item class='pic_item radius-shadow'>
<navigator hover-class="banner-hover" url="{{'../school-life-2020/school-life-2020'}}">
<!-- TODO 填写海报数据 -->
<image src='../../img/school-life/banner.png' class="swiper_img" mode='scaleToFill'></image>
</navigator>
</swiper-item>

<!-- 常规banner -->
<!-- <block wx:for="{{indexBanner}}">
<swiper-item class='pic_item radius-shadow'>
<navigator hover-class="banner-hover" url="{{'../webview/webview?url='+item.msgurl}}">
<image src='{{item.imgurl}}' class="swiper_img" mode='scaleToFill' data-index='{{index}}' bindtap='swipclick'></image>
</navigator>
</swiper-item>
</block> -->
</swiper>
<view class="notice radius-shadow">
<view class='imgbox'>
<image src="/img/index/notice.svg" class="notice_img" bindlongpress="clearStorage"></image>
</view>
<view style="flex:1;">
<swiper class="wordswiper" autoplay="true" circular="true" interval="4000" vertical='true'>
<block wx:for="{{indexNotice}}">
<swiper-item class='word_item'>
<text>{{item.text}}</text>
</swiper-item>
</block>
</swiper>
</view>
</view>
<view class="button-view">
<index-button icon="/img/index/kebiao.svg" text="课表" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_kecheng'}}" />
<index-button icon="/img/index/jiaoshi.svg" text="教室" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_room/emroom/index'}}" />
<index-button icon="/img/index/chengji.svg" text="成绩" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_score'}}" />
<index-button icon="/img/index/jidian.svg" text="绩点" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_kecheng/grade/list'}}" />
<index-button icon="/img/index/xuefen.svg" text="学分" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_exam/default/graduate'}}" />
<index-button icon="/img/index/selectcourse.svg" text="选课" url="{{'../webview/webview?url=https://app.ncut.edu.cn/w_kecheng/course/list'}}" />
</view>
<view class='cat-box'>
<image src='/img/index/dialog.svg' class='dialog' hidden='{{showCat}}'>
<text>我的北方可以接推广了哦!</text>
</image>
<image class='cat' bindtap='tapCat' src='/img/index/cat.svg'></image>
</view>
</view>
68 changes: 68 additions & 0 deletions pages/school-life-2020-web/school-life-2020-web.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
// pages/school-life-2020-web/school-life-2020-web.js
Page({

/**
* 页面的初始数据
*/
data: {

},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
this.setData({
url:"https://myncut.ncut.edu.cn/school-life?token=" + options.token
})
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})
3 changes: 3 additions & 0 deletions pages/school-life-2020-web/school-life-2020-web.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"usingComponents": {}
}
2 changes: 2 additions & 0 deletions pages/school-life-2020-web/school-life-2020-web.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
<!--pages/school-life-2020-web/school-life-2020-web.wxml-->
<web-view src="{{url}}"></web-view>
1 change: 1 addition & 0 deletions pages/school-life-2020-web/school-life-2020-web.wxss
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/* pages/school-life-2020-web/school-life-2020-web.wxss */
128 changes: 128 additions & 0 deletions pages/school-life-2020/school-life-2020.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
// pages/school-life-2020/school-life-2020.js
import {
Requests
} from "../../utils/Requests";

Page({

/**
* 页面的初始数据
*/
data: {

},

/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
/*
判断是否已经授权个人信息
如果已经授权就更新一次信息
没有授权弹出提示授权框
不允许不让过!!!
*/

wx.getUserInfo({
success: function (res) {
var userInfo = res.userInfo;
console.log(userInfo);
// 向服务器提交用户最新的数据
Requests.put({
url: "/user",
data: {
nickName: userInfo.nickName,
avatarUrl: userInfo.avatarUrl,
},
success(data) {
wx.navigateTo({
url: '../school-life-2020-web/school-life-2020-web?token=' + Requests.token,
})
}
});
},
fail: function (res) {
console.log("getUserInfo fail");
}
})
},

// 获取用户信息回调
tapGetUserInfo: function (e) {
let that = this;
if (e.detail.userInfo === undefined) {
console.log("user refused getUserInfo");
// 未同意
wx.showToast({
title: '请同意后进入点滴校园',
icon: "none"
})
} else {
// 同意后向服务器提交userInfo
// 然后将页面切换成H5
console.log("user agreed getUserInfo");
console.log(e.detail.userInfo);
Requests.put({
url: "/user",
data: {
nickName: e.detail.userInfo.nickName,
avatarUrl: e.detail.userInfo.avatarUrl,
},
success(data) {
wx.navigateTo({
url: '../school-life-2020-web/school-life-2020-web?token=' + Requests.token,
})
}
});
}
},

/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {

},

/**
* 生命周期函数--监听页面显示
*/
onShow: function () {

},

/**
* 生命周期函数--监听页面隐藏
*/
onHide: function () {

},

/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {

},

/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {

},

/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {

},

/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {

}
})
3 changes: 3 additions & 0 deletions pages/school-life-2020/school-life-2020.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"usingComponents": {}
}
7 changes: 7 additions & 0 deletions pages/school-life-2020/school-life-2020.wxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!--pages/school-life-2020/school-life-2020.wxml-->
<view>
<image class="bg" src="../../img/school-life/bg.jpeg"></image>
<view class="btn-view">
<button class="btn" open-type="getUserInfo" bindgetuserinfo="tapGetUserInfo">点击进入</button>
</view>
</view>
Loading

0 comments on commit 744dec9

Please sign in to comment.