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

Commit

Permalink
搜索+课程列表刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
poltawa committed May 2, 2019
1 parent db3370a commit 277811b
Show file tree
Hide file tree
Showing 20 changed files with 621 additions and 471 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1 @@
.DS_Store
.DS_Store
90 changes: 45 additions & 45 deletions app.json
Original file line number Diff line number Diff line change
@@ -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
}
Binary file added imgs/iclass/refresh.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 18 additions & 2 deletions pages/document/document.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ import {
offFavor
} from "../../utils/document.js"

import {
mySearch,
} from "../../utils/search.js"

const app = getApp()

Page({
Expand All @@ -22,7 +26,9 @@ Page({
courseList: '',
course_code: '',
course_name: '',
status: ''
inform_loading:true,
// searchBan: false,
searchInfo:false,
},


Expand Down Expand Up @@ -59,6 +65,12 @@ Page({
else{
that.setData({
courseList: res.data,
inform_loading:false,
// searchBan:true
})
wx.setStorage({
key: 'courseList',
data: that.data.courseList,
})
}
}
Expand Down Expand Up @@ -115,5 +127,9 @@ Page({
courseList: that.data.courseList
})
offFavor(that.data.courseList[index])
}
},

search: function (e) { //搜索
mySearch(this, e)
},
})
58 changes: 33 additions & 25 deletions pages/document/document.wxml
Original file line number Diff line number Diff line change
@@ -1,36 +1,44 @@
<view class='inform'>
<view wx:if='{{inform_loading}}' class='inform'>
<image class='informIMG' src='../../imgs/document/waiting.gif' mode="widthFix"></image>
<text>我们不生产课件</text>
<text>我们只是知识的搬运工</text>
<text>loading...</text>
</view>


<view style='height:20rpx;'></view>
<view class='main'>
<block class='coursewareList' wx:for='{{courseList}}'>
<view class='coursewareBlock'>
<view class='name_favor'>
<view class='courseware_name'>{{item.file_name}}</view>
<view class='favorView'>
<image wx:if='{{!item.favourite}}' bindtap='favourites' data-index='{{index}}' class='unfavor_img' src='../../imgs/document/unfavourate.png'></image>
<image wx:else class='favor_img' bindtap='unfavourites' data-index='{{index}}' src='../../imgs/document/favourate.png'></image>
<view wx:else class='main'>
<view class='mySearch'>
<input placeholder="请输入关键字" placeholder-class="place-holder" confirm-type='search' value="{{inputValue}}" bindinput='search'></input>
</view>
<view wx:if='{{searchInfo}}' class='search_inform'>
<text class='txtInfo'>---无相关内容---</text>
</view>
<view wx:else>
<view style='height:20rpx;'></view>
<block class='coursewareList' wx:for='{{courseList}}'>
<view class='coursewareBlock'>
<view class='name_favor'>
<view class='courseware_name'>{{item.file_name}}</view>
<view class='favorView'>
<image wx:if='{{!item.favourite}}' bindtap='favourites' data-index='{{index}}' class='unfavor_img' src='../../imgs/document/unfavourate.png'></image>
<image wx:else class='favor_img' bindtap='unfavourites' data-index='{{index}}' src='../../imgs/document/favourate.png'></image>
</view>
</view>
</view>
<image class='line' src='../../imgs/document/line.jpg'></image>
<view class='doWare'>
<view class='imgView' hover="true" hover-class="imghover">
<image class='img' bindtap='lookFile' data-index='{{index}}' src='../../imgs/document/look.jpg'></image>
</view>
<view class='imgView' hover="true" hover-class="imghover">
<image class='img' bindtap='downFile' data-index='{{index}}' src='../../imgs/document/download.jpg'></image>
</view>
<view class='imgView' hover="true" hover-class="imghover">
<button class='imgBTN' id='sendBTN' hover="true" open-type="share" data-index='{{index}}'></button>
<image class='sendimg' src='../../imgs/document/send.jpg'></image>
<image class='line' src='../../imgs/document/line.jpg'></image>
<view class='doWare'>
<view class='imgView' hover="true" hover-class="imghover">
<image class='img' bindtap='lookFile' data-index='{{index}}' src='../../imgs/document/look.jpg'></image>
</view>
<view class='imgView' hover="true" hover-class="imghover">
<image class='img' bindtap='downFile' data-index='{{index}}' src='../../imgs/document/download.jpg'></image>
</view>
<view class='imgView' hover="true" hover-class="imghover">
<button class='imgBTN' id='sendBTN' hover="true" open-type="share" data-index='{{index}}'></button>
<image class='sendimg' src='../../imgs/document/send.jpg'></image>
</view>
</view>
</view>
</view>
</block>
<view style='height:40rpx'></view>
</block>
<view style='height:40rpx'></view>
</view>
</view>
45 changes: 38 additions & 7 deletions pages/document/document.wxss
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
Expand Down
82 changes: 41 additions & 41 deletions pages/homework/homework.js
Original file line number Diff line number Diff line change
@@ -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
}
}
},
})
4 changes: 2 additions & 2 deletions pages/homework/homework.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"usingComponents": {}
{
"usingComponents": {}
}
Loading

0 comments on commit 277811b

Please sign in to comment.