Commit bad0db76 authored by ltz's avatar ltz

fix

parent de894bfc
......@@ -18,8 +18,12 @@ import {
} from '../../../utilities/index.js';
import {
modeStudentDetail
} from '../../../service/business/morethemeindex'
modeStudentDetail,
modeStudentClockRemove
} from '../../../service/business/morethemeindex';
import {
getMemberMe
} from '../../../service/common.js';
function compare(property) {
return function (a, b) {
......@@ -62,6 +66,7 @@ Page({
videoId: '',
src: ''
},
memberMeInfo: {}
},
onLoad: function (options) {
......@@ -76,6 +81,7 @@ Page({
studentId: studentId || 0,
modeid: modeid || 0
})
this.getMemberMeInfo();//报名要用到老师信息
this.studentInfoGet()
},
onReady: function () {
......@@ -106,6 +112,18 @@ Page({
onReachBottom: function () {
this.clockListGet('up');
},
getMemberMeInfo(){
let that = this;
getMemberMe({
school_id: that.data.sid
}).then(res=>{
if (res.code == 200) {
that.setData({
memberMeInfo : res.data.schoolTeacher
})
}
})
},
studentInfoGet() {
modeStudentDetail({
student_id: this.data.studentId,
......@@ -577,69 +595,6 @@ Page({
[`clockList[${listindex}][${index}]`]: curclockList
})
},
//操作
handeloperate(e) {
const that = this;
let mySystem = wx.getSystemInfoSync();
let needIosWarn = LocalStorage.getItem('needIosWarn');
let itemList = [];
if (mySystem.system && mySystem.system.toLowerCase().indexOf('ios') != -1 && !needIosWarn) {
itemList = ['退班'];
} else {
itemList = ['退班', '取消'];
}
wx.showActionSheet({
itemList: itemList,
success(res) {
const {
tapIndex
} = res;
if (tapIndex == 0) {
wx.showModal({
title: '提示',
content: '是否退出该班级',
confirmColor: '#65B8F4',
success(res) {
if (res.confirm) {
const {
courseitem,
item
} = e.currentTarget.dataset;
that.studentremovePost(item.id, courseitem.id)
} else if (res.cancel) {
}
}
})
}
if (tapIndex == 1) {
// that.delClock()
}
}
})
},
// 退班
studentremovePost(class_id, id) {
studentremovePost({
student_ids: this.data.studentInfo.id,
school_id: this.data.sid,
class_id: class_id
}).then(res => {
if (res.code == 200) {
wx.showToast({
title: '退班成功',
icon: 'success',
duration: 2000
})
this.data.courselist.find(ele => ele.id == id).classes = this.data.courselist.find(ele => ele.id == id).classes.filter(ele => ele.id != class_id);
this.setData({
courselist: this.data.courselist
})
}
}).catch(res => {
})
},
caculateArrLength(array) {
let _length = 0;
array.forEach(ele => {
......@@ -699,11 +654,89 @@ Page({
url: `/business/pages/studentcenter/courseeliminate?studentId=${this.data.studentId}&courseid=${item.id}`
})
},
// 转为在读学员 -> 学员报名
bindBuyCourse(e) {
const { item } = e.currentTarget.dataset;
let url = item ? `sid=${this.data.sid}&studentId=${this.data.studentId}&id=${item.id || 0}` : `sid=${this.data.sid}&studentId=${this.data.studentId}`
wx.navigateTo({
url: `/business/pages/studentcenter/buycourse?${url}`
let that = this;
let studentInfo = that.data.studentInfo;
erpstudentAdd({
school_id: that.data.sid,
name: studentInfo.nickname,
gender: '',
mobile : studentInfo.mobile,
remark: '',
operator_id: that.data.memberMeInfo.id,
force: ''
}).then(res=>{
const {code,data} = res;
if(code!=200){
if(code==40204){
wx.showModal({
title: '提示',
content: '学员姓名重复',
showCancel: false,
confirmColor: '#35BAFD'
})
return
}
if(code==40203){
that.getRepeatStudents();
return
}
return
}else{
that.setData({
newStudentInfo: data,
showStudentsRepeat: false
})
that.studentRenewal();
}
})
},
// 获取重复学员
getRepeatStudents(){
studentsListGet({
page: 1,
perPage: 99,
school_id: this.data.sid,
extra:'time,recently_course',
keyword_any: this.data.studentInfo.mobile,
}).then((res) => {
const { code, data } = res;
if (code != 200) { // 失败的处理
} else {
this.setData({
findStudent: data.list,
showStudentsRepeat: true
})
}
}).catch((e) => {
})
},
// 踢出
bindStudentClockRemove(){
modeStudentClockRemove({
mode_id: this.data.modeid,
student_id: this.data.studentId
}).then( res =>{
console.log(res)
if (res.code == 200) {
wx.showToast({
title: '踢出成功',
icon: 'success',
duration: 2000
})
const pages = getCurrentPages();
const prePages = pages[pages.length - 2];
prePages.setData({
needRefresh: true,
})
wx.navigateBack({
delta: 1
})
}else{
}
})
}
})
\ No newline at end of file
......@@ -17,7 +17,7 @@
</view>
<view class="opt-box" wx:if="{{studentInfo.is_formal_student && studentInfo.is_formal_student}}">
<view class="btn btn-exchange" bindtap="bindBuyCourse">转化为在读学员</view>
<view class="btn btn-out">踢出</view>
<view class="btn btn-out" bindtap="bindStudentClockRemove">踢出</view>
</view>
</view>
......
......@@ -509,6 +509,7 @@ const apis = {
unlocksubjectsituation: `${api}member/unlock_subject/situation`, //B-参与概况
unlocksubjectstudents: `${api}member/unlock_subject/students`, //B-成员列表
modeStudentDetail: `${api}member/unlock_subject/mode_student_detail`, //B-闯关个人动态详情
modeStudentClockRemove: `${api}member/unlock_subject/delete_unlock_clock`, //B-闯关 踢出学员
},
points: {
exchangeRecord: `${api}member/integral_goods/exchange`, //B-积分兑换记录
......
......@@ -63,11 +63,22 @@ function modeStudentDetail(data) {
errorresolve: 1,
})
}
//闯关 踢出学员
function modeStudentClockRemove(data) {
return wxRequest({
role: '2b',
url: apis.business.morethemeindex.modeStudentClockRemove,
data,
method: 'POST',
errorresolve: 1,
})
}
export {
unlocksubjectshow,
unlocksubjectindex,
unlocksubjectdetail,
unlocksubjectsituation,
unlocksubjectstudents,
modeStudentDetail
modeStudentDetail,
modeStudentClockRemove
}
\ No newline at end of file
......@@ -1267,7 +1267,7 @@ page {
width: 670rpx;
background: rgba(255, 238, 210, 1);
border-radius: 20rpx;
margin: 0 auto;
margin: 0 auto 50rpx;
padding: 32rpx;
display: flex;
align-items: center;
......
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