From 277811bfe472fd04b27ca241c5d2f1af91356fa0 Mon Sep 17 00:00:00 2001 From: poltawa Date: Thu, 2 May 2019 19:35:28 +0800 Subject: [PATCH] =?UTF-8?q?=E6=90=9C=E7=B4=A2+=E8=AF=BE=E7=A8=8B=E5=88=97?= =?UTF-8?q?=E8=A1=A8=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 2 +- app.json | 90 +++++++------- imgs/iclass/refresh.png | Bin 0 -> 628 bytes pages/document/document.js | 20 ++- pages/document/document.wxml | 58 +++++---- pages/document/document.wxss | 45 +++++-- pages/homework/homework.js | 82 ++++++------ pages/homework/homework.json | 4 +- pages/homework/homework.wxml | 60 ++++----- pages/iclass/iclass.js | 15 ++- pages/iclass/iclass.wxml | 3 + pages/iclass/iclass.wxss | 18 ++- pages/myFavor/myFavor.js | 206 +++++++++++++++++-------------- pages/myFavor/myFavor.json | 4 +- pages/myFavor/myFavor.wxml | 78 ++++++------ pages/myFavor/myFavor.wxss | 28 +++-- templates/authView/authView.wxml | 34 ++--- templates/authView/authView.wxss | 110 ++++++++--------- utils/document.js | 194 ++++++++++++++--------------- utils/search.js | 41 ++++++ 20 files changed, 621 insertions(+), 471 deletions(-) create mode 100644 imgs/iclass/refresh.png create mode 100644 utils/search.js diff --git a/.gitignore b/.gitignore index e43b0f9..6e8821b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -.DS_Store +.DS_Store diff --git a/app.json b/app.json index 3a08a57..748dd3c 100644 --- a/app.json +++ b/app.json @@ -1,46 +1,46 @@ -{ - "pages": [ - "pages/index/index", - "pages/iclass/iclass", - "pages/document/document", - "pages/my/my", - "pages/feedback/feedback", - "pages/webview/webview", - "pages/aboutus/aboutus", - "pages/homework/homework", - "pages/myFavor/myFavor" - ], - "window": { - "backgroundTextStyle": "light", - "navigationBarBackgroundColor": "#ffffff", - "navigationBarTitleText": "我的北方", - "navigationBarTextStyle": "black" - }, - "tabBar": { - "color": "#a9b7b7", - "selectedColor": "#000000", - "borderStyle": "black", - "list": [ - { - "selectedIconPath": "imgs/index/teach_y.png", - "iconPath": "imgs/index/teach_n.png", - "pagePath": "pages/index/index", - "text": "教务" - }, - { - "selectedIconPath": "imgs/index/model_y.png", - "iconPath": "imgs/index/model_n.png", - "pagePath": "pages/iclass/iclass", - "text": "多模式" - }, - { - "selectedIconPath": "imgs/index/my_y.png", - "iconPath": "imgs/index/my_n.png", - "pagePath": "pages/my/my", - "text": "我的" - } - ] - }, - "sitemapLocation": "sitemap.json", - "resizable": true +{ + "pages": [ + "pages/index/index", + "pages/iclass/iclass", + "pages/document/document", + "pages/my/my", + "pages/feedback/feedback", + "pages/webview/webview", + "pages/aboutus/aboutus", + "pages/homework/homework", + "pages/myFavor/myFavor" + ], + "window": { + "backgroundTextStyle": "light", + "navigationBarBackgroundColor": "#ffffff", + "navigationBarTitleText": "我的北方", + "navigationBarTextStyle": "black" + }, + "tabBar": { + "color": "#a9b7b7", + "selectedColor": "#000000", + "borderStyle": "black", + "list": [ + { + "selectedIconPath": "imgs/index/teach_y.png", + "iconPath": "imgs/index/teach_n.png", + "pagePath": "pages/index/index", + "text": "教务" + }, + { + "selectedIconPath": "imgs/index/model_y.png", + "iconPath": "imgs/index/model_n.png", + "pagePath": "pages/iclass/iclass", + "text": "多模式" + }, + { + "selectedIconPath": "imgs/index/my_y.png", + "iconPath": "imgs/index/my_n.png", + "pagePath": "pages/my/my", + "text": "我的" + } + ] + }, + "sitemapLocation": "sitemap.json", + "resizable": true } \ No newline at end of file diff --git a/imgs/iclass/refresh.png b/imgs/iclass/refresh.png new file mode 100644 index 0000000000000000000000000000000000000000..8ca4d5e8ae7216f3d84509ba34fba9e4d5edd703 GIT binary patch literal 628 zcmV-)0*n2LP);Th%*nu5r33MPdkkJY} zJHQU41E>HeOxD@kOK$g$Kl*0)0JpdIBYDZ@&bHev{)5hs%|Jvi^2x0`YD9?W8o(03 zC4d`d{`S^h^xRxNjgygT~Jj)HRHy8L`>vuvS8+E z+pgL@OCb;$ch_}y5z%PKzp=tv0ugu6uG$$lnAOYe$}6`-vz`zL#to_QTJMY1d<-oU z^LCPCB&5bN*@l@1eK+r_kQ&Qm=>c{U5KFy7-3vr3=FfE@W+bAcacF5<M`MiN6God>IQz2TGgQ49(NmtB{gr=1LFITjTo58v`20asbgB_tng~uQ4v} zK$v-{?L3vV?YBNDBBHqy4OoD2AMw&4n^iIYlbLt^ z=ycaM4s3J=$%3?v1F=36gAcXbbN7|MPG}0MJ&tuxkId{9Mf0ptQ5a0`LQT;^@Iy4ZU3e O0000 + 我们不生产课件 我们只是知识的搬运工 @@ -6,31 +6,39 @@ - - - - - - {{item.file_name}} - - - + + + + + + ---无相关内容--- + + + + + + + {{item.file_name}} + + + + - - - - - - - - - - - - + + + + + + + + + + + + - - - + + + \ No newline at end of file diff --git a/pages/document/document.wxss b/pages/document/document.wxss index 964c036..b8df64a 100644 --- a/pages/document/document.wxss +++ b/pages/document/document.wxss @@ -1,8 +1,8 @@ .inform { - position: absolute; - z-index: 0; + /* position: absolute; + z-index: 0; */ width: 100%; - height: 50%; + margin-top: 250rpx; display: flex; flex-direction: column; justify-content: center; @@ -16,13 +16,44 @@ width: 80%; } -.main { - position: absolute; - z-index: 1; - left: 3%; +.main { background-color: #fff; } +.mySearch { + margin: 0 auto; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + width: 70%; + height: 40rpx; + background-color: whitesmoke; + /* margin-top: 30rpx; */ + border: 10rpx solid whitesmoke; + border-radius: 35px; + /* font-size: 15rpx; */ +} + +.place-holder { + font-size: 12px; +} + +.search_inform { + margin: 0 auto; + width: 100%; + margin-top: 100rpx; + display: flex; + flex-direction: column; + justify-content: center; + align-items: center; +} + +.txtInfo { + color: rgb(163, 159, 159); + font-size: 32rpx; +} + .coursewareBlock { height: 180rpx; width: 704rpx; diff --git a/pages/homework/homework.js b/pages/homework/homework.js index 7ad5513..1ca27e7 100644 --- a/pages/homework/homework.js +++ b/pages/homework/homework.js @@ -1,42 +1,42 @@ -// pages/homework/homework.js -import { - myURL -} from "../../setting.js" -const app = getApp() - -Page({ - - /** - * 页面的初始数据 - */ - data: { - // homeList_all:'', - homeList: '', - course_name: '', - // joint: '', - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - let that = this - // console.log(options.homeList_all) - that.setData({ - course_name: options.course_name, - homeList_all: JSON.parse(options.homeList_all) - }) - wx.setNavigationBarTitle({ - title: that.data.course_name, - }) - for (var key in that.data.homeList_all) { - if (that.data.course_name == key) { - that.setData({ - homeList: that.data.homeList_all[key], - // end_date: that.data.homeList_all[key].end_date - }) - break - } - } - }, +// pages/homework/homework.js +import { + myURL +} from "../../setting.js" +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + // homeList_all:'', + homeList: '', + course_name: '', + // joint: '', + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function (options) { + let that = this + // console.log(options.homeList_all) + that.setData({ + course_name: options.course_name, + homeList_all: JSON.parse(options.homeList_all) + }) + wx.setNavigationBarTitle({ + title: that.data.course_name, + }) + for (var key in that.data.homeList_all) { + if (that.data.course_name == key) { + that.setData({ + homeList: that.data.homeList_all[key], + // end_date: that.data.homeList_all[key].end_date + }) + break + } + } + }, }) \ No newline at end of file diff --git a/pages/homework/homework.json b/pages/homework/homework.json index 8835af0..6f5247b 100644 --- a/pages/homework/homework.json +++ b/pages/homework/homework.json @@ -1,3 +1,3 @@ -{ - "usingComponents": {} +{ + "usingComponents": {} } \ No newline at end of file diff --git a/pages/homework/homework.wxml b/pages/homework/homework.wxml index 246f124..9e283e4 100644 --- a/pages/homework/homework.wxml +++ b/pages/homework/homework.wxml @@ -1,31 +1,31 @@ - - - - - - {{item.assignment_name}} - - - - - - - - - - 截止时间:{{item.end_date}} - - - - - + + + + + + {{item.assignment_name}} + + + + + + + + + + 截止时间:{{item.end_date}} + + + + + \ No newline at end of file diff --git a/pages/iclass/iclass.js b/pages/iclass/iclass.js index 563fc96..bcb0514 100644 --- a/pages/iclass/iclass.js +++ b/pages/iclass/iclass.js @@ -19,7 +19,7 @@ Page({ * 页面的初始数据 */ data: { - authed:true, + authed: true, courseList: null, }, @@ -88,23 +88,22 @@ Page({ console.log('没作业') } }) - }//end if + } //end if }, -toAuth:function(){ - goAuth() -}, + toAuth: function() { + goAuth() + }, /** * 页面相关事件处理函数--监听用户下拉动作 */ - onPullDownRefresh: function() { - // wx.showNavigationBarLoading(); + doRefresh: function() { + wx.startPullDownRefresh() let that = this wx.request({ url: myURL + '/courselist', - // url:"http://v.ncut.edu.cn/course?sno=17152010120", data: { openid: app.globalData.openid }, diff --git a/pages/iclass/iclass.wxml b/pages/iclass/iclass.wxml index 7eaa10f..d42749e 100644 --- a/pages/iclass/iclass.wxml +++ b/pages/iclass/iclass.wxml @@ -7,7 +7,10 @@ 课程列表 + + + diff --git a/pages/iclass/iclass.wxss b/pages/iclass/iclass.wxss index da3d7ee..ca10ee7 100755 --- a/pages/iclass/iclass.wxss +++ b/pages/iclass/iclass.wxss @@ -6,11 +6,15 @@ z-index: 1; width: 100%; box-shadow: 0px 4px 30px 4px #fff; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; } .blackBG { width: 275rpx; height: 70rpx; - background-color: #000; + /* background-color: #000; */ display: flex; justify-content: center; align-items: center; @@ -19,10 +23,20 @@ } .title { - color: #fff; + color: #000; display: inline-block; font-size: 40rpx; + font-weight: bold; } +.freshView{ + background-color: rgb(173, 80, 80); +} +.fresh_img{ + margin-left: 28rpx; + width: 30rpx; + height: 30rpx; +} + .topView{ position: absolute; z-index: 0; diff --git a/pages/myFavor/myFavor.js b/pages/myFavor/myFavor.js index 34ed34d..5be7edb 100644 --- a/pages/myFavor/myFavor.js +++ b/pages/myFavor/myFavor.js @@ -1,95 +1,113 @@ -// pages/myFavor/myFavor.js -var util = require('../../utils/util.js') -import { - myURL -} from "../../setting.js" - -import { - lookFile, - downloadFile, - onFavor, - offFavor -} from "../../utils/document.js" - -const app = getApp() - -Page({ - - /** - * 页面的初始数据 - */ - data: { - favorList: [], - }, - - /** - * 生命周期函数--监听页面加载 - */ - onLoad: function (options) { - wx.setNavigationBarTitle({ - title: "我的收藏", - }) - let that = this - wx.request({ - url: myURL + '/favourite/get', - data: { - openid: app.globalData.openid - }, - success(res) { - console.log(res.data) - that.setData({ - favorList: res.data - }) - } - }) - }, - - onShareAppMessage: function (res) { - var courseware = this.data.favorList[res.target.dataset.index] - if (res.from === 'button') { - return { - title: courseware.file_name, - path: '/pages/iclass/iclass?courseware=' + JSON.stringify(courseware), - imageUrl: "../../imgs/share.png" - } - } - }, - - lookFile: function (e) { - var that = this - var index = e.currentTarget.dataset.index - if (that.data.favorList[index].type === 'dir') { - wx.navigateTo({ - url: '/pages/document/document?code=' + course_code + 'item' + that.data.favorList[index].sign - }) - } else { - lookFile(that.data.favorList[index]) - } - }, - - downFile: function (e) { //下载课件 - let that = this - var index = e.currentTarget.dataset.index - downloadFile(that.data.favorList[index]) - }, - - favourites: function (e) { - var index = e.currentTarget.dataset.index - var that = this - that.data.favorList[index].favourite = true - that.setData({ - favorList: that.data.favorList - }) - onFavor(that.data.favorList[index]) - }, - - unfavourites: function (e) { - var index = e.currentTarget.dataset.index - var that = this - that.data.favorList[index].favourite = false - that.setData({ - favorList: that.data.favorList - }) - offFavor(that.data.favorList[index]) - }, +// pages/myFavor/myFavor.js +var util = require('../../utils/util.js') +import { + myURL +} from "../../setting.js" + +import { + lookFile, + downloadFile, + onFavor, + offFavor +} from "../../utils/document.js" + +import { + mySearch, +} from "../../utils/search.js" + +const app = getApp() + +Page({ + + /** + * 页面的初始数据 + */ + data: { + courseList: [], + searchInfo: false + }, + + /** + * 生命周期函数--监听页面加载 + */ + onLoad: function(options) { + wx.setNavigationBarTitle({ + title: "我的收藏", + }) + }, + + onShow: function(res) { + let that = this + wx.request({ + url: myURL + '/favourite/get', + data: { + openid: app.globalData.openid + }, + success(res) { + console.log(res.data) + that.setData({ + courseList: res.data + }) + wx.setStorage({ + key: 'courseList', + data: that.data.courseList, + }) + } + }) + }, + + onShareAppMessage: function(res) { + var courseware = this.data.courseList[res.target.dataset.index] + if (res.from === 'button') { + return { + title: courseware.file_name, + path: '/pages/iclass/iclass?courseware=' + JSON.stringify(courseware), + imageUrl: "../../imgs/share.png" + } + } + }, + + lookFile: function(e) { + var that = this + var index = e.currentTarget.dataset.index + if (that.data.courseList[index].type === 'dir') { + wx.navigateTo({ + url: '/pages/document/document?code=' + course_code + 'item' + that.data.courseList[index].sign + }) + } else { + lookFile(that.data.courseList[index]) + } + }, + + downFile: function(e) { //下载课件 + let that = this + var index = e.currentTarget.dataset.index + downloadFile(that.data.courseList[index]) + }, + + favourites: function(e) { + var index = e.currentTarget.dataset.index + var that = this + that.data.courseList[index].favourite = true + that.setData({ + courseList: that.data.courseList + }) + onFavor(that.data.courseList[index]) + }, + + unfavourites: function(e) { + var index = e.currentTarget.dataset.index + var that = this + that.data.courseList[index].favourite = false + that.setData({ + courseList: that.data.courseList + }) + offFavor(that.data.courseList[index]) + }, + + + search: function(e) { //搜索 + mySearch(this,e) + }, + }) \ No newline at end of file diff --git a/pages/myFavor/myFavor.json b/pages/myFavor/myFavor.json index 8835af0..6f5247b 100644 --- a/pages/myFavor/myFavor.json +++ b/pages/myFavor/myFavor.json @@ -1,3 +1,3 @@ -{ - "usingComponents": {} +{ + "usingComponents": {} } \ No newline at end of file diff --git a/pages/myFavor/myFavor.wxml b/pages/myFavor/myFavor.wxml index 3a91fcf..4afb660 100644 --- a/pages/myFavor/myFavor.wxml +++ b/pages/myFavor/myFavor.wxml @@ -1,36 +1,44 @@ - - - ---无收藏内容--- - - - - - - - - - - {{item.file_name}} - - - - - - - - - - - - - - - - - - - - - - + + ---您的收藏夹是空的--- + + + + + + + + + ---无相关内容--- + + + + + + + + + {{item.file_name}} + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/pages/myFavor/myFavor.wxss b/pages/myFavor/myFavor.wxss index d5ab7d4..d5e1731 100644 --- a/pages/myFavor/myFavor.wxss +++ b/pages/myFavor/myFavor.wxss @@ -2,25 +2,37 @@ position: absolute; z-index: 0; width: 100%; - height: 50%; + margin-top: 100rpx; display: flex; flex-direction: column; justify-content: center; align-items: center; } -.informIMGview { - height: 500rpx; - /* background-color: rgb(172, 16, 16); */ - display: flex; - margin: 0 auto; -} - .txtInfo { color: rgb(163, 159, 159); font-size: 32rpx; } +.mySearch { + margin: 0 auto; + display: flex; + flex-direction: row; + justify-content: center; + align-items: center; + width: 70%; + height: 40rpx; + background-color: whitesmoke; + /* margin-top: 5%; */ + border: 10rpx solid whitesmoke; + border-radius: 35px; + /* font-size: 15rpx; */ +} + +.place-holder { + font-size: 12px; +} + .main { position: absolute; z-index: 1; diff --git a/templates/authView/authView.wxml b/templates/authView/authView.wxml index d4dd284..3c5247d 100644 --- a/templates/authView/authView.wxml +++ b/templates/authView/authView.wxml @@ -1,18 +1,18 @@ -