Commit a40ee783 authored by sujie@126.com's avatar sujie@126.com

dd

parent 5a449c81
......@@ -6,10 +6,10 @@ import {
getMemberMe,
formIdCreate
} from '../../../service/common.js';
import apis from '../../../constants/api.js';
import {
todocallGet,
statisticalGet
statisticalGet,
classrecentlyrecordsGet
} from '../../../service/business/classservice.js'
var app = getApp();
Page({
......@@ -25,8 +25,6 @@ Page({
my: 1,
memberChange: false,
accountExpired:false,
tabAct: 1,
allcount: 100,
windowWidth: app.globalData.windowWidth,
windowHeight: app.globalData.windowHeight,
total:0,
......@@ -35,7 +33,14 @@ Page({
modelHideClass: false,
guideDailogShow: false,
guideIndex: 1,
statisticalData:''
statisticalData:'',
page: 1,
perPage: 12,
classrecentlyList: [],
hasmore: true,
classrecentlyTotal: 0,
emptyPage: false,
listLoading: false,
},
onLoad: function (options) {
......@@ -51,6 +56,7 @@ Page({
app.watch(this.watchBack,this)
this.todocallGet();
this.statisticalGet();
this.classListGet('init');
if(this.data.modalshow){
this.setData({
modelHideClass: true
......@@ -67,6 +73,16 @@ Page({
},
onPageScroll(e){
},
onPullDownRefresh: function () { // Do something when pull down.
this.setData({
page: 1,
hasmore: true
})
this.classListGet('down');
},
onReachBottom: function () { // Do something when page reach bottom.
this.classListGet('up');
},
getMemberMeInfo(){
let that = this;
getMemberMe({
......@@ -110,7 +126,7 @@ Page({
// 预警处理
gotodolist(){
wx.navigateTo({
url: `/business/pages/classservice/todolist?sid=${this.data.sid}`
url: `/business/pages/classservice/todolist?sid=${this.data.sid}&my=${this.data.my}`
})
},
// 发布 弹窗
......@@ -133,18 +149,18 @@ Page({
// 打卡
goClocklist(){
wx.navigateTo({
url: `/business/pages/deskcenter/clocklist?sid=${this.data.sid}`
url: `/business/pages/deskcenter/clocklist?sid=${this.data.sid}&my=${this.data.my}`
})
},
goPointsMgt(){
wx.navigateTo({
url: `/business/pages/scoremgt/index?sid=${this.data.sid}`
url: `/business/pages/scoremgt/index?sid=${this.data.sid}&my=${this.data.my}`
})
},
// 作业点评
goNoComment () {
wx.navigateTo({
url: `/business/pages/nocomment/index?sid=${this.data.sid}`
url: `/business/pages/nocomment/index?sid=${this.data.sid}&my=${this.data.my}`
})
},
goclasslist(){
......@@ -154,7 +170,13 @@ Page({
},
goClassreviewindex(){
wx.navigateTo({
url: `/business/pages/classservice/classreviewindex?sid=${this.data.sid}`
url: `/business/pages/classservice/classreviewindex?sid=${this.data.sid}&my=${this.data.my}`
})
},
goClassDetail(e){
const { item } = e.currentTarget.dataset
wx.navigateTo({
url: `/business/pages/classservice/classdetail?id=${item.id}&from=2&sid=${this.data.sid}&my=${this.data.my}`
})
},
// 发布打卡
......@@ -163,13 +185,13 @@ Page({
let url = '';
switch (Number(createtype)){
case 1:
url = `/business/pages/themeeditor/index?id=0&tid=0&sid=${this.data.sid}`;
url = `/business/pages/themeeditor/index?id=0&tid=0&sid=${this.data.sid}&my=${this.data.my}`;
break;
case 2:
url = `/business/pages/calendarthemeeditor/index?id=0&tid=0&sid=${this.data.sid}`;
url = `/business/pages/calendarthemeeditor/index?id=0&tid=0&sid=${this.data.sid}&my=${this.data.my}`;
break;
case 3:
url = `/business/pages/themeeditorlock/index?id=0&tid=0&sid=${this.data.sid}`;
url = `/business/pages/themeeditorlock/index?id=0&tid=0&sid=${this.data.sid}&my=${this.data.my}`;
break;
default:
break;
......@@ -180,24 +202,24 @@ Page({
},
gotodotasks(){
wx.navigateTo({
url: `/business/pages/todotasks/index?sid=${this.data.sid}`
url: `/business/pages/todotasks/index?sid=${this.data.sid}&my=${this.data.my}`
})
},
goClassreviewindex(){
wx.navigateTo({
url: `/business/pages/classservice/classreviewindex?sid=${this.data.sid}`
url: `/business/pages/classservice/classreviewindex?sid=${this.data.sid}&my=${this.data.my}`
})
},
// 发布课堂瞬间
toReleaseMoment(){
wx.navigateTo({
url: `/business/pages/websiteindex/highlightsedit?sid=${this.data.sid}`
url: `/business/pages/websiteindex/highlightsedit?sid=${this.data.sid}&my=${this.data.my}`
})
},
// 发布机构新鲜事
toReleaseRefresh() {
wx.navigateTo({
url: `/business/pages/websiteindex/newsedit?sid=${this.data.sid}`
url: `/business/pages/websiteindex/newsedit?sid=${this.data.sid}&my=${this.data.my}`
})
},
......@@ -223,5 +245,104 @@ Page({
this.setData({
guideIndex: index+1
})
}
},
classListGet(type) {
if (!this.data.hasmore) {
return;
}
if (this.data.listLoading) {
return
};
this.setData({
listLoading: true
})
classrecentlyrecordsGet({
page: this.data.page,
perPage: this.data.perPage,
school_id: this.data.sid,
}).then((res) => {
const { code, data } = res;
this.setData({
listLoading: false
})
if (code != 200) { // 失败的处理
} else {
if (data.total) {
this.setData({
classrecentlyTotal: data.total
})
}
switch (type) {
case 'init': //页面进来第一次加载
this.setData({
classrecentlyList: data.list || [],
}, () => {
if (this.data.classrecentlyTotal > this.data.classrecentlyList.length) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
break;
case 'down': // 页面下拉刷新
this.setData({
classrecentlyList: data.list || []
}, () => {
if (this.data.classrecentlyTotal > this.data.classrecentlyList.length) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
wx.stopPullDownRefresh();
break;
case 'up': // 页面上拉刷新
let list = this.data.classrecentlyList;
let _list = list.concat(data.list);
this.setData({
classrecentlyList: _list
// [`classrecentlyList[${this.data.page - 1}]`]: data.list
}, () => {
if (this.data.classrecentlyTotal > this.data.classrecentlyList.length) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
break;
default:
break;
}
if (this.data.classrecentlyList==0) {
this.setData({
emptyPage: true
})
} else {
this.setData({
emptyPage: false
})
}
}
}).catch((e) => {
this.setData({
listLoading: false
})
})
},
})
\ No newline at end of file
......@@ -6,6 +6,7 @@
"backgroundTextStyle": "dark",
"usingComponents": {
"btabbar": "../../../components/btabbar",
"expiredTip": "../../components/expiredTip"
"expiredTip": "../../components/expiredTip",
"empty-content": "../../../components/emptycontent"
}
}
\ No newline at end of file
......@@ -91,18 +91,20 @@
</view>
</view>
</view>
<view class="recently-class">
<view class="recently-class" style="{{emptyPage ? 'min-height: 450rpx;' : ''}}">
<view class="title">
<view class="left"><image class="recently-clock" src="{{localImageRoot}}2b/classervice/recently-clock.png?{{imageRoot}}" mode="aspectFit|aspectFill|widthFix" />最近关注的班级</view>
<view class="right" bindtap="goclasslist">更多班级 <image class="icon-arr" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"/></view>
</view>
<view class="content-box">
<view class="class-item">
<view class="content-box" wx:if="{{!emptyPage}}">
<view class="class-item" wx:for="{{classrecentlyList}}" wx:key="{{index}}" data-item="{{item}}" bindtap="goClassDetail">
<view class="icon"></view>
<view class="name">美术课程周二下午3:00班级</view>
<view class="name">{{item.title}}</view>
</view>
</view>
<view class="wanted-btn">我要点名</view>
<empty-content text="暂无数据~" emptyimg="" wx:if="{{emptyPage}}"></empty-content>
<view class="has-nomore" wx:if="{{!emptyPage && !hasmore}}">没有更多了</view>
<view class="wanted-btn" bindtap="gotodolist">我要点名</view>
</view>
</view>
<view class="modal {{modelHideClass? 'hide': ''}}" hidden="{{!modalshow}}">
......
......@@ -196,8 +196,9 @@ Page({
})
},
gotodotasks(){
const dakarole = LocalStorage.getItem('dakarole');
wx.navigateTo({
url: `/business/pages/todotasks/index?sid=${this.data.sid}`
url: `/business/pages/todotasks/index?sid=${this.data.sid}&my=${ dakarole == 2 ? 1 : '' }`
})
},
})
\ No newline at end of file
/* components/tab/index.wxss */
.tab-header{
display: flex;
position: sticky;
top: 0;
z-index: 999;
background: #ffffff;
}
.tab-header .tab-item{
flex: 1;
......
......@@ -306,6 +306,7 @@ const apis = {
classroomreviewupdate: `${api}member/classroom_review/update`,//B端-课堂点评修改
classroomreviewlikes: `${api}member/classroom_review/likes`,//B端-课堂点评-点赞或取消
leaves: `${api}member/erp/student/leaves`,//请假
classrecentlyrecords: `${api}member/erp/class_recently_records`,//最近操作班级
},
common: {
memberSession: `${api}member/session`,
......
export default {
imageRoot: 'https://cdn.img.shangjiadao.cn/qingxiao/daka/images/',
host: 'https://qxapi.qingxiao.online/daka',
host2: 'https://wx.m.shangjiadao.cn',
// host: 'https://qxapi.qingxiao.online/daka',
// host2: 'https://wx.m.shangjiadao.cn',
storageVersion: '4.0',
imageVersion: '20191104',
// host: 'https://clock.wp53.cn',
// host2: 'https://test.wp53.cn',
host: 'https://clock.wp53.cn',
host2: 'https://test.wp53.cn',
appId: 'wxc1246ea029394785',
miniProgram: {
clock: 'wxdeee20e52a1fd7ee'
......
......@@ -220,6 +220,15 @@ function leavesDetailGet (data) {
errorresolve: 1,
})
}
function classrecentlyrecordsGet (data) {
return wxRequest({
role: '2b',
url: apis.business.classservice.classrecentlyrecords,
data,
method: 'GET',
errorresolve: 1,
})
}
export {
statisticalGet,
schedulesGet,
......@@ -244,5 +253,6 @@ export {
classroomreviewlikesPOST,
leavesListGet,
leavesPUT,
leavesDetailGet
leavesDetailGet,
classrecentlyrecordsGet
}
\ No newline at end of file
......@@ -151,7 +151,7 @@ Page({
}
this.setData({
showSeachBtn: scrollTop > 400 ? true : false,
floatTab: scrollTop > 290 ? true : false,
// floatTab: scrollTop > 290 ? true : false,
})
},
/**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment