Commit 5d519376 authored by lvtz's avatar lvtz

fix

parent d82b1c5e
...@@ -719,7 +719,8 @@ ...@@ -719,7 +719,8 @@
"name": "coursemgt", "name": "coursemgt",
"pages": [ "pages": [
"index", "index",
"edit" "edit",
"selectcourse"
] ]
} }
], ],
......
...@@ -51,6 +51,7 @@ Page({ ...@@ -51,6 +51,7 @@ Page({
sort: 0, sort: 0,
need_audit: 1 need_audit: 1
}, },
courseSelect: [],
submit: false, submit: false,
audioStatus: { // 录音弹窗的交互状态 audioStatus: { // 录音弹窗的交互状态
show: false, show: false,
...@@ -278,6 +279,7 @@ Page({ ...@@ -278,6 +279,7 @@ Page({
id: this.data.id, id: this.data.id,
school_id: this.data.sid, school_id: this.data.sid,
sort: 0, sort: 0,
// coursename: this.data.courseSelect.title
// need_audit: this.data.needPsd // need_audit: this.data.needPsd
})).then((res) => { })).then((res) => {
if (res.code == 200) { if (res.code == 200) {
...@@ -489,6 +491,14 @@ Page({ ...@@ -489,6 +491,14 @@ Page({
} }
console.log(this.data.params) console.log(this.data.params)
}, },
// 选择课程
toSelectCourse(){
let courseSelect = this.data.courseSelect
console.log(courseSelect)
wx.navigateTo({
url: `/business/pages/coursemgt/selectcourse?id=${this.data.id}&sid=${this.data.sid}&from=circle&courseSelect=${courseSelect.id}`
})
},
// 选择老师 // 选择老师
toSelectTeachers(){ toSelectTeachers(){
wx.navigateTo({ wx.navigateTo({
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
<view class="form-box"> <view class="form-box">
<view class="form-item"> <view class="form-item">
<view class="form-label">课程</view> <view class="form-label">课程</view>
<view class="form-content"> <view class="form-content" bindtap="toSelectCourse">
<input type="text" class="form-input" value="{{}}" placeholder="请选择课程" bindinput=""/> <input type="text" class="form-input" value="{{courseSelect.title}}" placeholder="请选择课程" disabled/>
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
</view> </view>
......
...@@ -30,7 +30,7 @@ Page({ ...@@ -30,7 +30,7 @@ Page({
onLoad: function (options) { onLoad: function (options) {
if (options.sid) { if (options.sid) {
this.setData({ this.setData({
sid: options.sid || 3 sid: options.sid
}); });
} }
}, },
......
// src/pages/classmgt/index.js
import {
courseList,
} from '../../../service/business/coursemgt.js';
import {
formIdCreate
} from '../../../service/common.js';
import {
LocalStorage
} from '../../../utilities/index.js';
var app = getApp();
Page({
data: {
localImageRoot: '../../../images/',
imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion,
page: 1,
perPage: 10,
sid: 0,
courseList: [],
courseTatol: '',
hasmore: true,
emptyPage: false,
checkedItems: []
},
/**
* 生命周期函数--监听页面加载
*/
onLoad: function (options) {
const{sid,courseSelect} = options
this.setData({
sid: sid || 0,
'checkedItems.id':courseSelect
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady: function () {
},
/**
* 生命周期函数--监听页面显示
*/
onShow: function () {
this.setData({
page: 1,
hasmore: true,
})
this.getCourseList('init');
},
onPullDownRefresh: function () {
this.setData({
hasmore: true,
page: 1,
})
this.getCourseList('down')
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
this.getCourseList('up')
},
getCourseList(type) {
let dakarole = LocalStorage.getItem('dakarole');
if (!this.data.hasmore) {
return;
}
if (this.data.listLoading) {
return
}
this.setData({
listLoading: true
})
courseList({
page: this.data.page,
perPage: this.data.perPage,
school_id: this.data.sid
}).then((res) => {
const { code, data } = res;
wx.hideLoading();
this.setData({
listLoading: false
})
if (code != 200) { // 失败的处理
} else {
if (data.total) {
this.setData({
courseTatol: data.total
})
}
switch (type) {
case 'init': //页面进来第一次加载
this.setData({
courseList: [data.list]
}, () => {
if (data.total > this.caculateArrLength(this.data.courseList)) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
break;
case 'down': // 页面下拉刷新
this.setData({
courseList: [data.list]
}, () => {
if (data.total > this.caculateArrLength(this.data.courseList)) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
wx.stopPullDownRefresh();
break;
case 'up': // 页面上拉刷新
this.setData({
[`courseList[${this.data.page - 1}]`]: data.list
}, () => {
if (this.data.classTatol > this.caculateArrLength(this.data.courseList)) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
break;
default:
break;
}
if (this.caculateArrLength(this.data.courseList) == 0) {
this.setData({
emptyPage: true
})
} else {
this.setData({
emptyPage: false,
})
}
}
}).catch((e) => {
this.setData({
listLoading: false
})
})
},
caculateArrLength(array) {
let _length = 0;
array.forEach(ele => {
_length = _length + ele.length;
})
return _length;
},
// 选择课程 单选
listenCheckboxChange: function (e) {
const { item } = e.currentTarget.dataset;
this.setData({
checkedItems: item
})
console.log(this.data.checkedItems);
let pages = getCurrentPages();
let prevPage = pages[pages.length - 2];
prevPage.setData({
courseSelect: item,
})
wx.navigateBack({
delta: 1,
})
},
})
\ No newline at end of file
{
"navigationBarTitleText": "选择课程",
"usingComponents": {
"list-loading": "../../../components/listloading"
}
}
\ No newline at end of file
<!-- <wxs src="../../../filter/index.wxs" module="filter" /> -->
<view class="container">
<view class="userlist-box" wx:if="{{!emptyPage}}">
<block wx:for="{{courseList}}" wx:for-item="bigitem" wx:key="bigindex" wx:for-index="bigindex">
<view class="list-item" wx:for="{{bigitem}}" wx:for-item="item" data-item="{{item}}" wx:key="{{index}}" bindtap="listenCheckboxChange">
<image class="icon-checkbox" src="{{imageRoot}}2b/common/radioactive2.png?{{imageVersion}}" wx:if="{{item.id == checkedItems.id}}"></image>
<image class="icon-checkbox" src="{{localImageRoot}}2b/common/radiono.png?{{imageVersion}}" wx:else></image>
<!-- <image class="avatar" src="{{filter.imagify(item.avatar, 'image/resize,w_160/format,jpg')}}"></image> -->
<view class="itme-content">
<view class="nickname">{{item.title}}</view>
</view>
</view>
</block>
<list-loading loading="{{listLoading}}"></list-loading>
</view>
<view class="empty-content" wx:else>
<image class='empty-img' src='{{imageRoot}}2c/rankinglist/empty.png?{{imageVersion}}'></image>
<view class="empty-text">暂无数据~</view>
</view>
<view class="has-nomore" wx:if="{{!emptyPage && !hasmore}}">没有更多了</view>
</view>
\ No newline at end of file
@import '../../../style/userlist.wxss';
/* 空场景 */
.empty-content {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%,-50%);
display: flex;
flex-direction: column;
align-items: center;
line-height: 45rpx;
}
.empty-content .empty-img {
width: 263rpx;
height: 219rpx;
}
.empty-content .empty-text {
font-size: 26rpx;
color: rgba(0, 0, 0, 0.6);
}
.has-nomore{
font-size: 26rpx;
color: #9C9C9D;
padding: 75rpx 0;
text-align: center;
}
\ No newline at end of file
...@@ -13,6 +13,9 @@ import { ...@@ -13,6 +13,9 @@ import {
schoolList schoolList
} from '../../../service/business/ucenter.js'; } from '../../../service/business/ucenter.js';
import messages from '../../../constants/messages.js'; import messages from '../../../constants/messages.js';
import {
bTokenExchange
} from '../../../service/common.js'
const app = getApp(); const app = getApp();
Page({ Page({
...@@ -289,17 +292,22 @@ Page({ ...@@ -289,17 +292,22 @@ Page({
}) })
return; return;
}else { // 登录成功 }else { // 登录成功
LocalStorage.setItem('user', {
expires_in: data.expires_in, bTokenExchange({
token: `bearer ${data.token}`, type: 1,
mobile, member_token: data.token
// role: 1 // 1是校长 2是老师 }).then(res2=>{
}) LocalStorage.setItem('user', {
LocalStorage.setItem('dakarole', 1); expires_in: res2.data.expires_in,
wx.showToast({ token: `bearer ${res2.data.token}`,
title: '登录成功', mobile,
mask: true, // role: 1 // 1是校长 2是老师
success () { })
LocalStorage.setItem('dakarole', 1);
wx.showToast({
title: '登录成功',
mask: true,
success () {
formIdCreate({ formIdCreate({
formId formId
}) })
...@@ -325,8 +333,11 @@ Page({ ...@@ -325,8 +333,11 @@ Page({
url: '/business/pages/shopeditor/index?from=1' url: '/business/pages/shopeditor/index?from=1'
}) })
}) })
} }
})
}) })
} }
}).catch((err) => { }).catch((err) => {
wx.hideLoading(); wx.hideLoading();
......
...@@ -13,6 +13,9 @@ import { ...@@ -13,6 +13,9 @@ import {
schoolList schoolList
} from '../../../service/business/ucenter.js'; } from '../../../service/business/ucenter.js';
import messages from '../../../constants/messages.js'; import messages from '../../../constants/messages.js';
import {
bTokenExchange
} from '../../../service/common.js'
const app = getApp(); const app = getApp();
Page({ Page({
...@@ -63,34 +66,6 @@ Page({ ...@@ -63,34 +66,6 @@ Page({
}, },
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom: function () {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage: function () {
},
mobileInput(e) { mobileInput(e) {
this.setData({ this.setData({
"params.mobile": e.detail.value "params.mobile": e.detail.value
...@@ -166,8 +141,14 @@ Page({ ...@@ -166,8 +141,14 @@ Page({
}) })
}, },
login(e) { login(e) {
LocalStorage.setItem('dakarole', 2);
wx.reLaunch({
url: `/business/pages/organizationalmgt/index?sid=3`
})
return;
const { formId } = e.detail; const { formId } = e.detail;
const { mobile, password, verify_code } = this.data.params; const { mobile, verify_code } = this.data.params;
const visitor = LocalStorage.getItem('visitor') || {}; const visitor = LocalStorage.getItem('visitor') || {};
const that = this; const that = this;
if (mobile == '') { if (mobile == '') {
...@@ -194,30 +175,6 @@ Page({ ...@@ -194,30 +175,6 @@ Page({
}) })
return; return;
} }
if (password == '' && !that.data.type) {
that.setData({
warnTip: '请输入密码'
}, () => {
setTimeout(function () {
that.setData({
warnTip: false
})
}, 2000)
})
return
}
if (!regexp.passWord.test(password) && !that.data.type) {
that.setData({
warnTip: '密码格式不正确'
}, () => {
setTimeout(function () {
that.setData({
warnTip: false
})
}, 2000)
})
return;
}
if (that.submiting) { if (that.submiting) {
return return
} }
...@@ -233,8 +190,7 @@ Page({ ...@@ -233,8 +190,7 @@ Page({
}) })
login({ login({
mobile, mobile,
password: this.data.type ? '' : password, verify_code ,
verify_code: this.data.type ? verify_code : '',
min_open_id: visitor && visitor.openid, min_open_id: visitor && visitor.openid,
union_id: visitor && visitor.unionid, union_id: visitor && visitor.unionid,
}).then((res) => { }).then((res) => {
...@@ -255,43 +211,49 @@ Page({ ...@@ -255,43 +211,49 @@ Page({
}) })
return; return;
} else { // 登录成功 } else { // 登录成功
LocalStorage.setItem('user', { bTokenExchange({
expires_in: data.expires_in, type: 1,
token: `bearer ${data.token}`, member_token: data.token
mobile, }).then(res2=>{
// role: 1 // 1是校长 2是老师 LocalStorage.setItem('user', {
}) expires_in: res2.data.expires_in,
LocalStorage.setItem('dakarole', 1); token: `bearer ${res2.data.token}`,
wx.showToast({ mobile,
title: '登录成功', // role: 1 // 1是校长 2是老师
mask: true, })
success() { LocalStorage.setItem('dakarole', 2);
formIdCreate({ wx.showToast({
formId title: '登录成功',
}) mask: true,
schoolList({ success () {
page: 1, formIdCreate({
perPage: 100 formId
}).then((res) => { })
if (res.code == 200) { schoolList({
if (res.data.total > 0) { page: 1,
wx.reLaunch({ perPage: 100
url: `/business/pages/organizationalmgt/index?sid=${res.data.list[0].id}` }).then((res) => {
}) if (res.code == 200) {
if (res.data.total > 0 ) {
wx.reLaunch({
url: `/business/pages/organizationalmgt/index?sid=${res.data.list[0].id}`
})
} else {
wx.redirectTo({
url: '/business/pages/shopeditor/index?from=1'
})
}
} else { } else {
wx.redirectTo({
url: '/business/pages/shopeditor/index?from=1'
})
} }
} else { }).catch(() => {
wx.redirectTo({
} url: '/business/pages/shopeditor/index?from=1'
}).catch(() => { })
wx.redirectTo({
url: '/business/pages/shopeditor/index?from=1'
}) })
}) }
} })
}) })
} }
}).catch((err) => { }).catch((err) => {
......
...@@ -12,13 +12,15 @@ Page({ ...@@ -12,13 +12,15 @@ Page({
imageVersion: app.globalData.imageVersion, imageVersion: app.globalData.imageVersion,
id: 0, id: 0,
sid: 0, sid: 0,
params: { number: '',
students: '', remark: '',
type: 1, consumer_id: '',
number: '',
remark: '',
},
submit: false, submit: false,
typeList: [
{type: 'add',title: '增加积分'},
{type: 'sub',title: '减少积分'}
],
typeSelect: 'add'
}, },
onLoad: function(options) { // Do some initialize when page load. onLoad: function(options) { // Do some initialize when page load.
const {sid} = options; const {sid} = options;
...@@ -41,30 +43,25 @@ Page({ ...@@ -41,30 +43,25 @@ Page({
numberinput(e){ numberinput(e){
const {value} = e.detail; const {value} = e.detail;
this.setData({ this.setData({
'params.number': Number(value) 'number': Number(value)
}) })
}, },
remarkinput (e) { remarkinput (e) {
const {value} = e.detail; const {value} = e.detail;
this.setData({ this.setData({
'params.remark': value.length > 500 ? value.substr(0, 500) : value 'remark': value.length > 500 ? value.substr(0, 500) : value
}) })
}, },
// 类型选择 // 类型选择
typeChange(){ typeChange(e){
let type=this.data.params.type; const {type} = e.currentTarget.dataset;
if(type==1){
type=2
}else{
type=1
}
this.setData({ this.setData({
'params.type': type typeSelect: type
}) })
}, },
doSave (e) { doSave (e) {
const number = parseInt(Number(this.data.params.number)) let number = parseInt(Number(this.data.number))
if (number<1) { if (number<1) {
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
...@@ -75,7 +72,7 @@ Page({ ...@@ -75,7 +72,7 @@ Page({
}) })
return; return;
} }
if (!this.data.params.remark) { if (!this.data.remark) {
wx.showModal({ wx.showModal({
title: '提示', title: '提示',
content: '备注内容不能为空', content: '备注内容不能为空',
...@@ -96,11 +93,16 @@ Page({ ...@@ -96,11 +93,16 @@ Page({
title: '保存中...' title: '保存中...'
}) })
// TODO 换接口 if(this.data.typeSelect=='sub'){
memberIntegral(Object.assign({},this.data.params,{ number =- number
}else{
}
memberIntegral({
school_id: this.data.sid, school_id: this.data.sid,
// consumer_id: this.data.singleStudentInfo.consumer_id, consumer_id: this.data.consumer_id,
})).then((res) => { number: number,
remark: this.data.remark
}).then((res) => {
const { code, data } = res; const { code, data } = res;
this.setData({ this.setData({
listLoading: false listLoading: false
......
...@@ -4,36 +4,31 @@ ...@@ -4,36 +4,31 @@
<view class="form-item"> <view class="form-item">
<view class="form-label">学员</view> <view class="form-label">学员</view>
<view class="form-content" bindtap="toSelectStudents"> <view class="form-content" bindtap="toSelectStudents">
<input type="text" class="form-input" value="{{params.students}}" placeholder="请选择学员" disabled/> <input type="text" class="form-input" value="{{consumer_id}}" placeholder="请选择学员" disabled/>
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-label">类型</view> <view class="form-label">类型</view>
<view class="form-content"> <view class="form-content">
<view class="radio-item" bindtap="typeChange"> <view class="radio-item" bindtap="typeChange" wx:for="{{typeList}}" data-type="{{item.type}}" wx:key="">
<image class="icon-checkbox" src="{{imageRoot}}2b/common/radioactive2.png?{{imageVersion}}" wx:if="{{params.type==1}}"></image> <image class="icon-checkbox" src="{{imageRoot}}2b/common/radioactive2.png?{{imageVersion}}" wx:if="{{item.type==typeSelect}}"></image>
<image class="icon-checkbox" src="{{localImageRoot}}2b/common/radiono.png?{{imageVersion}}" wx:if="{{params.type!=1}}"></image> <image class="icon-checkbox" src="{{localImageRoot}}2b/common/radiono.png?{{imageVersion}}" wx:else></image>
<view class="radio-title">增加积分</view> <view class="radio-title">{{item.title}}</view>
</view>
<view class="radio-item" bindtap="typeChange">
<image class="icon-checkbox" src="{{imageRoot}}2b/common/radioactive2.png?{{imageVersion}}" wx:if="{{params.type==2}}"></image>
<image class="icon-checkbox" src="{{localImageRoot}}2b/common/radiono.png?{{imageVersion}}" wx:if="{{params.type!=2}}"></image>
<view class="radio-title">减少积分</view>
</view> </view>
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-label">积分值</view> <view class="form-label">积分值</view>
<view class="form-content"> <view class="form-content">
<input type="number" class="form-input" value="{{params.number}}" placeholder="请输入积分值" bindinput="numberinput"/> <input type="number" class="form-input" value="{{number}}" placeholder="请输入积分值" bindinput="numberinput"/>
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
</view> </view>
<view class="form-item"> <view class="form-item">
<view class="form-label">备注</view> <view class="form-label">备注</view>
<view class="form-content"> <view class="form-content">
<textarea class="form-input form-remark" auto-height value="{{params.remark}}"placeholder="请输入备注信息" bindinput="remarkinput"></textarea> <textarea class="form-input form-remark" auto-height value="{{remark}}"placeholder="请输入备注信息" bindinput="remarkinput"></textarea>
<image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image> <image class="arrowsmall" src="{{imageRoot}}2b/organizationalmgt/right.png?{{imageVersion}}"></image>
</view> </view>
</view> </view>
......
...@@ -14,12 +14,12 @@ ...@@ -14,12 +14,12 @@
<list-loading loading="{{listLoading}}"></list-loading> <list-loading loading="{{listLoading}}"></list-loading>
</view> </view>
<view class="bottom-fixbox" bindtap="sureSelect">确认</view> <view class="form-fixbtn" bindtap="sureSelect">确认</view>
<view class="empty-content" wx:if="{{emptyPage}}"> <view class="empty-content" wx:if="{{emptyPage}}">
<image class='empty-img' src='{{imageRoot}}2c/rankinglist/empty.png?{{imageVersion}}'></image> <image class='empty-img' src='{{imageRoot}}2c/rankinglist/empty.png?{{imageVersion}}'></image>
<view class="empty-text">暂无数据~</view> <view class="empty-text">暂无数据~</view>
</view> </view>
<view class="has-nomore" wx:if="{{!emptyPage && !hasmore}}">没有更多了</view> <view class="has-nomore" wx:if="{{!emptyPage && !hasmore && page>1}}">没有更多了</view>
</view> </view>
\ No newline at end of file
...@@ -24,79 +24,4 @@ ...@@ -24,79 +24,4 @@
color: #9C9C9D; color: #9C9C9D;
padding: 75rpx 0; padding: 75rpx 0;
text-align: center; text-align: center;
} }
\ No newline at end of file
/* 学员列表 */
.userlist-box{
width: 100%;
}
.userlist-box .list-item{
display: flex;
align-items: center;
padding: 24rpx;
position: relative;
}
.list-item::after{
content: '';
width: 100%;
height: 1px;
background: rgba(0,0,0,.05);
position: absolute;
left: 0;
bottom: 0;
}
.userlist-box .list-item .icon-checkbox{
width: 31rpx;
height: 31rpx;
position: relative;
margin-right: 39rpx;
}
.userlist-box .list-item .avatar{
width: 66rpx;
height: 66rpx;
border-radius: 50%;
margin-right: 30rpx;
}
.userlist-box .list-item .itme-content{
display: flex;
flex-direction: column;
justify-content: space-between;
font-size: 26rpx;
color: #000;
line-height: 1;
/* min-height: 66rpx; */
}
.userlist-box .list-item .itme-content .nickname{
font-size: 26rpx;
color: #000;
}
.userlist-box .list-item .itme-content .info-box{
font-size: 24rpx;
color: #777;
display: flex;
align-items: center;
}
.userlist-box .list-item .itme-content .info-box .num{
font-size: 26rpx;
color: #FFB97A;
font-weight: 500;
}
/* 底部固定操作栏 */
.bottom-fixbox{
font-size: 30rpx;
color: #fff;
position: fixed;
bottom: 120rpx;
left: 50%;
transform: translateX(-50%);
width: 365rpx;
height: 80rpx;
background: #65B8F4;
border-radius: 40rpx;
display: flex;
align-items: center;
justify-content: center;
z-index: 5;
}
import { import {
commonwaitjobGet, commonwaitjobGet,
} from '../../service/business/common.js' } from '../../service/business/common.js'
import {
LocalStorage,
} from '../../utilities/index.js';
var app = getApp(); var app = getApp();
Component({ Component({
properties: { properties: {
...@@ -34,6 +37,12 @@ Component({ ...@@ -34,6 +37,12 @@ Component({
pageLifetimes: { pageLifetimes: {
show: function () { show: function () {
this.getCommonwaitJob(); this.getCommonwaitJob();
const dakarole = LocalStorage.getItem('dakarole');
this.setData({
dakarole: dakarole,
},()=>{
console.log('this.data.dakarole',this.data.dakarole)
})
}, },
hide: function () { hide: function () {
} }
......
...@@ -17,25 +17,34 @@ ...@@ -17,25 +17,34 @@
</view> </view>
</view> --> </view> -->
<view class="btabbar"> <view class="btabbar">
<view class="btabbaritem class {{current == 'dc' ? 'active' : ''}}" bindtap="chooseTab" data-type="dc"> <block wx:if="{{dakarole==1}}">
<image class="icon class" wx:if="{{current != 'dc'}}" src="/images/btabbar/dc.png" ></image> <view class="btabbaritem {{current == 'dc' ? 'active' : ''}}" bindtap="chooseTab" data-type="dc">
<image class="icon class" wx:if="{{current == 'dc'}}" src="/images/btabbar/dcactive.png" ></image> <image class="icon dc" wx:if="{{current != 'dc'}}" src="/images/btabbar/dc.png" ></image>
<text class="btabbaritemname" >数据中心</text> <image class="icon dc" wx:if="{{current == 'dc'}}" src="/images/btabbar/dcactive.png" ></image>
</view> <text class="btabbaritemname">数据中心</text>
<view class="btabbaritem message {{current == 'workbench' ? 'active' : ''}}" bindtap="chooseTab" data-type="workbench"> </view>
<image class="icon workbench" wx:if="{{current != 'workbench'}}" src="/images/btabbar/workbench.png" ></image> <view class="btabbaritem {{current == 'workbench' ? 'active' : ''}}" bindtap="chooseTab" data-type="workbench">
<image class="icon workbench" wx:if="{{current == 'workbench'}}" src="/images/btabbar/workbenchactive.png" ></image> <image class="icon workbench" wx:if="{{current != 'workbench'}}" src="/images/btabbar/workbench.png" ></image>
<text class="btabbaritemname" >工作台</text> <image class="icon workbench" wx:if="{{current == 'workbench'}}" src="/images/btabbar/workbenchactive.png" ></image>
<!-- <view class="message-count" wx:if="{{waitJob > 0}}">{{waitJob > 99 ? '99+' : waitJob}}</view> --> <text class="btabbaritemname">工作台</text>
</view> <!-- <view class="message-count" wx:if="{{waitJob > 0}}">{{waitJob > 99 ? '99+' : waitJob}}</view> -->
<view class="btabbaritem class {{current == 'class' ? 'active' : ''}}" bindtap="chooseTab" data-type="class"> </view>
<image class="icon class" wx:if="{{current != 'class'}}" src="/images/btabbar/class.png" ></image> <view class="btabbaritem {{current == 'class' ? 'active' : ''}}" bindtap="chooseTab" data-type="class">
<image class="icon class" wx:if="{{current == 'class'}}" src="/images/btabbar/classactive.png" ></image> <image class="icon class" wx:if="{{current != 'class'}}" src="/images/btabbar/class.png" ></image>
<text class="btabbaritemname" >课务</text> <image class="icon class" wx:if="{{current == 'class'}}" src="/images/btabbar/classactive.png" ></image>
</view> <text class="btabbaritemname">课务</text>
<view class="btabbaritem ucenter {{current == 'ucenter' ? 'active' : ''}}" bindtap="chooseTab" data-type="ucenter"> </view>
</block>
<block wx:if="{{dakarole==2}}">
<view class="btabbaritem {{current == 'class' ? 'active' : ''}}" bindtap="chooseTab" data-type="class">
<image class="icon class" wx:if="{{current != 'class'}}" src="/images/btabbar/home.png" ></image>
<image class="icon class" wx:if="{{current == 'class'}}" src="/images/btabbar/homeactive.png" ></image>
<text class="btabbaritemname">首页</text>
</view>
</block>
<view class="btabbaritem {{current == 'ucenter' ? 'active' : ''}}" bindtap="chooseTab" data-type="ucenter">
<image class="icon ucenter" wx:if="{{current != 'ucenter'}}" src="/images/btabbar/ucenter.png" ></image> <image class="icon ucenter" wx:if="{{current != 'ucenter'}}" src="/images/btabbar/ucenter.png" ></image>
<image class="icon ucenter" wx:if="{{current == 'ucenter'}}" src="/images/btabbar/ucenteractive.png" ></image> <image class="icon ucenter" wx:if="{{current == 'ucenter'}}" src="/images/btabbar/ucenteractive.png" ></image>
<text class="btabbaritemname" >我</text> <text class="btabbaritemname">我</text>
</view> </view>
</view> </view>
\ No newline at end of file
...@@ -130,6 +130,9 @@ const apis = { ...@@ -130,6 +130,9 @@ const apis = {
noticecount: `${api}student/notice/count`, // 我的未读消息数量 noticecount: `${api}student/notice/count`, // 我的未读消息数量
noticeread: `${api}student/notice/read`, // 消息已读上报 noticeread: `${api}student/notice/read`, // 消息已读上报
}, },
mycourse: {
courseApi: `${api}member/erp/student/classes`//我的课程列表
},
schoolindex: { schoolindex: {
classindex: `${api}student/class/index`, classindex: `${api}student/class/index`,
schoolClassList: `${api}student/class/class_list`, schoolClassList: `${api}student/class/class_list`,
......
import {
wxRequest
} from '../../utilities/request.js';
import apis from '../../constants/api.js';
function courseList(data) {
return wxRequest({
url: apis.customer.mycourse.courseApi,
data,
method: 'GET',
errorresolve: 1,
})
}
export {
courseList
}
\ No newline at end of file
// src/pages/myclassrecord/index.js // src/pages/myclassrecord/index.js
import {
courseList,
} from '../../../service/business/coursemgt.js';
var app = getApp(); var app = getApp();
Page({ Page({
...@@ -9,6 +12,14 @@ Page({ ...@@ -9,6 +12,14 @@ Page({
imageRoot: app.globalData.imageRoot, imageRoot: app.globalData.imageRoot,
imageVersion: app.globalData.imageVersion, imageVersion: app.globalData.imageVersion,
localImageRoot: '../../../images/', localImageRoot: '../../../images/',
page: 1,
perPage: 10,
sid: 0,
courselist: [],
courseTatol: '',
hasmore: true,
emptyPage: false,
courselist: [ courselist: [
{ {
id:1, id:1,
...@@ -69,55 +80,148 @@ Page({ ...@@ -69,55 +80,148 @@ Page({
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad: function (options) { onLoad: function (options) {
if (options.sid) {
this.setData({
sid: options.sid
});
}
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady: function () { onReady: function () {
}, },
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow: function () { onShow: function () {
this.setData({
}, page: 1,
hasmore: true,
/** })
* 生命周期函数--监听页面隐藏 this.getCourseList('init');
*/
onHide: function () {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload: function () {
}, },
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh: function () { onPullDownRefresh: function () {
this.setData({
hasmore: true,
page: 1,
})
this.getCourseList('down')
}, },
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom: function () { onReachBottom: function () {
this.getCourseList('up')
}, },
/** getCourseList(type) {
* 用户点击右上角分享 if (!this.data.hasmore) {
*/ return;
onShareAppMessage: function () { }
if (this.data.listLoading) {
} return
}
this.setData({
listLoading: true
})
courseList({
page: this.data.page,
perPage: this.data.perPage,
school_id: this.data.sid
}).then((res) => {
const { code, data } = res;
wx.hideLoading();
this.setData({
listLoading: false
})
if (code != 200) { // 失败的处理
} else {
if (data.total) {
this.setData({
courseTatol: data.total
})
}
switch (type) {
case 'init': //页面进来第一次加载
this.setData({
courseList: [data.list]
}, () => {
if (data.total > this.caculateArrLength(this.data.courseList)) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
break;
case 'down': // 页面下拉刷新
this.setData({
courseList: [data.list]
}, () => {
if (data.total > this.caculateArrLength(this.data.courseList)) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
wx.stopPullDownRefresh();
break;
case 'up': // 页面上拉刷新
this.setData({
[`courseList[${this.data.page - 1}]`]: data.list
}, () => {
if (this.data.classTatol > this.caculateArrLength(this.data.courseList)) {
let page = this.data.page + 1;
this.setData({
page,
})
} else { // 没有更多了
this.setData({
hasmore: false
})
}
})
break;
default:
break;
}
if (this.caculateArrLength(this.data.courseList) == 0) {
this.setData({
emptyPage: true
})
} else {
this.setData({
emptyPage: false,
})
}
}
}).catch((e) => {
this.setData({
listLoading: false
})
})
},
caculateArrLength(array) {
let _length = 0;
array.forEach(ele => {
_length = _length + ele.length;
})
return _length;
},
}) })
\ No newline at end of file
...@@ -31,9 +31,9 @@ ...@@ -31,9 +31,9 @@
</view> </view>
</block> </block>
</view> </view>
<view class="empty-content" wx:if="{{!emptyPage}}"> <view class="empty-content" wx:if="{{emptyPage}}">
<image class='empty-img' src='{{imageRoot}}2b/potentialcustomer/emptyimg.png?{{imageVersion}}'></image> <image class='empty-img' src='{{imageRoot}}2b/potentialcustomer/emptyimg.png?{{imageVersion}}'></image>
<view class="empty-text">暂无数据~</view> <view class="empty-text">暂无数据~</view>
</view> </view>
<view class="has-nomore">没有更多了</view> <view class="has-nomore" wx:if="{{!emptyPage && page>1}}">没有更多了</view>
</view> </view>
import { import {
mixedthemeList courseList
} from '../../../service/customer/circleindex.js'; } from '../../../service/customer/mycourses.js';
import {
formIdCreate,
getActivities,
activityLog
} from '../../../service/common.js';
import { import {
LocalStorage LocalStorage
} from '../../../utilities/index.js'; } from '../../../utilities/index.js';
import {
noticecount
} from '../../../service/customer/mynews.js';
import {
mineClassList
} from '../../../service/customer/circleindex.js';
import {
noticeread,
} from '../../../service/customer/mynews.js';
var app = getApp(); var app = getApp();
Page({ Page({
data: { data: {
...@@ -40,22 +27,21 @@ Page({ ...@@ -40,22 +27,21 @@ Page({
classList: [], classList: [],
classTotal: 0, classTotal: 0,
selectedClass: {}, selectedClass: {},
noticecount: 0,
statusTab: [ statusTab: [
{ tabname: "进行中课程", statusType: 1 }, { tabname: "进行中课程", statusType: 1 },
{ tabname: "已结束课程", statusType: 2 } { tabname: "已结束课程", statusType: 2 }
], ],
statusType: 1 statusType: 1,
custormeId: 0
}, },
onLoad: function (options) { // Do some initialize when page load. onLoad: function (options) { // Do some initialize when page load.
const { const {
sid sid,custormeId
} = options; } = options;
this.setData({ this.setData({
sid sid,
custormeId
}); });
wx.hideShareMenu();
const visitor = LocalStorage.getItem('visitor');
}, },
onReady: function () { // Do something when page ready onReady: function () { // Do something when page ready
}, },
...@@ -67,8 +53,7 @@ Page({ ...@@ -67,8 +53,7 @@ Page({
page: 1, page: 1,
hasmore: true, hasmore: true,
}) })
this.getClassList(); // this.getClassList();
this.noticecountGet();
if (this.data.id) { if (this.data.id) {
this.courseListGet('init'); this.courseListGet('init');
} }
...@@ -95,21 +80,6 @@ Page({ ...@@ -95,21 +80,6 @@ Page({
backTopValue: backTopValue backTopValue: backTopValue
}) })
}, },
noticecountGet() {
noticecount({
school_id: this.data.sid
}).then((res) => {
const {
code,
data
} = res;
if (code == 200) {
this.setData({
noticecount: data.list[3] + data.list[1] + data.list[2]
})
}
})
},
subjectStatusShift(e) { subjectStatusShift(e) {
const { statustype } = e.currentTarget.dataset; const { statustype } = e.currentTarget.dataset;
this.setData({ this.setData({
...@@ -176,12 +146,12 @@ Page({ ...@@ -176,12 +146,12 @@ Page({
// wx.showLoading({ // wx.showLoading({
// title: '数据加载中' // title: '数据加载中'
// }) // })
mixedthemeList({ courseList({
page: this.data.page, page: this.data.page,
perPage: this.data.perPage, perPage: this.data.perPage,
student_id: 0,
class_id: this.data.id, class_id: this.data.id,
type: this.data.statusType, type: this.data.statusType,
sort_type: 1
}).then((res) => { }).then((res) => {
const { const {
code, code,
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
} }
.userlist-box .list-item .icon-checkbox{ .userlist-box .list-item .icon-checkbox{
width: 31rpx; width: 31rpx;
min-width: 31rpx;
height: 31rpx; height: 31rpx;
position: relative; position: relative;
margin-right: 39rpx; margin-right: 39rpx;
...@@ -35,11 +36,11 @@ ...@@ -35,11 +36,11 @@
font-size: 26rpx; font-size: 26rpx;
color: #000; color: #000;
line-height: 1; line-height: 1;
/* min-height: 66rpx; */
} }
.userlist-box .list-item .itme-content .nickname{ .userlist-box .list-item .itme-content .nickname{
font-size: 26rpx; font-size: 26rpx;
color: #000; color: #000;
line-height: 40rpx;
} }
.userlist-box .list-item .itme-content .info-box{ .userlist-box .list-item .itme-content .info-box{
font-size: 24rpx; font-size: 24rpx;
......
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