|
@@ -23,6 +23,22 @@ Page({
|
|
|
currentId: null,
|
|
|
currentName: "",
|
|
|
tva: 32,
|
|
|
+ noticeVis: false,
|
|
|
+ defAvatarm: "/images/mm.jpg",
|
|
|
+ defAvatarf: "/images/fm.jpg",
|
|
|
+ gender_icon_m: "/images/g_m.png",
|
|
|
+ gender_icon_f: "/images/g_f.png",
|
|
|
+ cardVis: false,
|
|
|
+ stuItem: null,
|
|
|
+ pageNum: 1,
|
|
|
+ pageSize: 4,
|
|
|
+ stuInfo: {},
|
|
|
+ jobArr: [],
|
|
|
+ classVis: false,
|
|
|
+ classErrVis: false,
|
|
|
+ classNVis: false,
|
|
|
+ scheduleList: [],
|
|
|
+
|
|
|
},
|
|
|
// 查询我是否认证
|
|
|
isRz(sessionKey) {
|
|
@@ -33,6 +49,7 @@ Page({
|
|
|
sessionKey
|
|
|
},
|
|
|
success: (res) => {
|
|
|
+
|
|
|
if (res.data.code == 0 && (res.data.data !== null || res.data.data !== "")) {
|
|
|
this.setData({
|
|
|
isRz: false
|
|
@@ -60,6 +77,7 @@ Page({
|
|
|
},
|
|
|
// 查询我是否有班&&班级名字
|
|
|
isClass(sessionKey) {
|
|
|
+ var that = this;
|
|
|
wx.request({
|
|
|
url: app.globalData.publicUrl + '/wx/student/selMyClas',
|
|
|
method: "post",
|
|
@@ -67,45 +85,77 @@ Page({
|
|
|
sessionKey
|
|
|
},
|
|
|
success: (res) => {
|
|
|
-
|
|
|
+ console.log(res);
|
|
|
if (res.data.code == 0) {
|
|
|
- this.setData({
|
|
|
- classInfo: res.data.data
|
|
|
+ let classInfo = res.data.data;
|
|
|
+ classInfo.clasBegin = app.timeFmt(classInfo.clasBegin, "yyyy\/MM\/dd hh:mm ");
|
|
|
+ classInfo.clasEnd = app.timeFmt(classInfo.clasEnd, "yyyy\/MM\/dd hh:mm ");
|
|
|
+ // classInfo.clasBegin=app.timeFilter(classInfo.clasBegin);
|
|
|
+ // classInfo.clasEnd=app.timeFilter(classInfo.clasEnd);
|
|
|
+ //console.log("classInfo.clasBegin:",app.timeFilter(classInfo.clasBegin));
|
|
|
+ that.setData({
|
|
|
+ classInfo: classInfo,
|
|
|
+ classVis: true
|
|
|
})
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
this.isAgree(sessionKey);
|
|
|
this.getMynotice(sessionKey);
|
|
|
- this.getMycourse(sessionKey);
|
|
|
- this.checkTaskList(sessionKey);
|
|
|
- this.checkTaskList3(sessionKey, res.data.data.id);
|
|
|
- this.checkTaskList4(sessionKey, res.data.data.id);
|
|
|
+ // this.getMycourse(sessionKey);
|
|
|
+ // this.checkTaskList(sessionKey);
|
|
|
+ // this.checkTaskList3(sessionKey, res.data.data.id);
|
|
|
+ // this.checkTaskList4(sessionKey, res.data.data.id);
|
|
|
} else {
|
|
|
if (res.data.msg == "运行时异常:学员不可同时存在两个班级中。") {
|
|
|
- wx.showModal({
|
|
|
- content: "学员不可同时存在多个班级中哦",
|
|
|
- showCancel: false,
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- wx.switchTab({
|
|
|
- url: '../index/index'
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
+ that.setData({ classErrVis: true });
|
|
|
+ // wx.showModal({
|
|
|
+ // content: "学员不可同时存在多个班级中哦",
|
|
|
+ // showCancel: false,
|
|
|
+ // success(res) {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // wx.switchTab({
|
|
|
+ // url: '../index/index'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
return false;
|
|
|
} else {
|
|
|
- wx.showModal({
|
|
|
- content: "您当前还没有正在开放的班级!",
|
|
|
- showCancel: false,
|
|
|
- success(res) {
|
|
|
- if (res.confirm) {
|
|
|
- wx.switchTab({
|
|
|
- url: '../index/index'
|
|
|
- })
|
|
|
- }
|
|
|
+
|
|
|
+
|
|
|
+ that.setData({ classNVis: true });
|
|
|
+
|
|
|
+
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/student/selClasToo',
|
|
|
+ method: "post",
|
|
|
+ data: {
|
|
|
+ sessionKey,
|
|
|
+ isActive: 0
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res);
|
|
|
+ let list = res.data.data.map(item => {
|
|
|
+ item.clasBegin = app.timeFmt(item.clasBegin, "yyyy\/MM\/dd hh:mm ");
|
|
|
+ item.clasEnd = app.timeFmt(item.clasEnd, "yyyy\/MM\/dd hh:mm ");
|
|
|
+ return item;
|
|
|
+ })
|
|
|
+ that.setData({ scheduleList: list })
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
})
|
|
|
+ // wx.showModal({
|
|
|
+ // content: "您当前还没有正在开放的班级!",
|
|
|
+ // showCancel: false,
|
|
|
+ // success(res) {
|
|
|
+ // if (res.confirm) {
|
|
|
+ // wx.switchTab({
|
|
|
+ // url: '../index/index'
|
|
|
+ // })
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // })
|
|
|
return false;
|
|
|
}
|
|
|
}
|
|
@@ -233,12 +283,28 @@ Page({
|
|
|
isSee: 1
|
|
|
// isNotice: 0
|
|
|
},
|
|
|
+ fail: () => {
|
|
|
+ this.setData({
|
|
|
+ noticeVis: false
|
|
|
+ })
|
|
|
+ },
|
|
|
success: (res) => {
|
|
|
if (res.data.code == 0) {
|
|
|
- if (res.data.list && res.data.list.length !== 0)
|
|
|
+ if (res.data.list && res.data.list.length !== 0) {
|
|
|
this.setData({
|
|
|
- notice: res.data.list[0].noticeContent
|
|
|
+ notice: res.data.list[0].noticeContent,
|
|
|
+ noticeVis: true
|
|
|
});
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ noticeVis: false
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ } else {
|
|
|
+ this.setData({
|
|
|
+ noticeVis: false
|
|
|
+ });
|
|
|
}
|
|
|
}
|
|
|
})
|
|
@@ -942,12 +1008,12 @@ Page({
|
|
|
console.log(res.data, "领取结业证提交")
|
|
|
|
|
|
wx.hideLoading();
|
|
|
- if(res.data.code==500){
|
|
|
+ if (res.data.code == 500) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: "领取失败,请稍后再试"
|
|
|
})
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
that.setData({
|
|
|
myCanvasId: that.data.myCanvasId + 1
|
|
|
})
|
|
@@ -977,12 +1043,12 @@ Page({
|
|
|
ctx.font = 'normal bold 14px sans-serif'
|
|
|
ctx.setTextAlign('left'); //是否居中显示,参考点画布中线
|
|
|
let leftPositionAarr = [59, 30]
|
|
|
- let graduationNum =res.data.data.graduationNum!=""? "编号:" + res.data.data.graduationNum:"";
|
|
|
+ let graduationNum = res.data.data.graduationNum != "" ? "编号:" + res.data.data.graduationNum : "";
|
|
|
ctx.fillText(graduationNum, 130, 150);
|
|
|
- let topPt=190-(strTar.length-4)*5;
|
|
|
- let lineHeight=30-(strTar.length>4?strTar.length>6?10:(strTar.length-4)*5:0)
|
|
|
+ let topPt = 190 - (strTar.length - 4) * 5;
|
|
|
+ let lineHeight = 30 - (strTar.length > 4 ? strTar.length > 6 ? 10 : (strTar.length - 4) * 5 : 0)
|
|
|
for (let i = 0; i < strTar.length; i++) {
|
|
|
-
|
|
|
+
|
|
|
ctx.fillText(strTar[i], i == 0 ? leftPositionAarr[0] : leftPositionAarr[1], topPt + i * lineHeight);
|
|
|
}
|
|
|
ctx.draw();
|
|
@@ -990,7 +1056,7 @@ Page({
|
|
|
showzs: true
|
|
|
});
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
},
|
|
|
fail: () => {
|
|
|
wx.hideLoading();
|
|
@@ -1055,7 +1121,168 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ onClickShow(e) {
|
|
|
+
|
|
|
+ this.setData({ stuItem: e.currentTarget.dataset.item });
|
|
|
+
|
|
|
+ this.setData({ cardVis: true });
|
|
|
+ },
|
|
|
+
|
|
|
+ onClickHide() {
|
|
|
+ this.setData({ cardVis: false });
|
|
|
+ },
|
|
|
+
|
|
|
+
|
|
|
+ onUnload() {
|
|
|
+ this.setData({ cardVis: false });
|
|
|
+ },
|
|
|
+ onHide() {
|
|
|
+ this.setData({ cardVis: false });
|
|
|
+ },
|
|
|
+ studentList(page) {
|
|
|
+ var that = this;
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/student/progress',
|
|
|
+ method: "post",
|
|
|
+ data: {
|
|
|
+ sessionKey: that.data.sessionKey,
|
|
|
+ pageNum: page,
|
|
|
+ pageSize: that.data.pageSize
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ let info = res.data.data;
|
|
|
+
|
|
|
+ info.list = info.list.map(item => {
|
|
|
+ if (item.studentHead == "" || item.studentHead == null) {
|
|
|
+ item.avatar = item.studentSex == 1 ? that.data.defAvatarf : that.data.defAvatarm;
|
|
|
+ } else {
|
|
|
+ item.avatar = item.studentHead;
|
|
|
+ }
|
|
|
+ return item;
|
|
|
+ })
|
|
|
+ console.log(info);
|
|
|
+ resolve(info)
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ fail: (error) => {
|
|
|
+ reject(error)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ getjob(sessionKey) {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/student/position',
|
|
|
+ method: "get",
|
|
|
+ data: {
|
|
|
+ sessionKey
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res, '我是获取到的数组')
|
|
|
+ let Arr = [];
|
|
|
+ res.data.data.forEach(item => {
|
|
|
+ let newdata = {};
|
|
|
+ newdata.dictLabel = item.dictLabel;
|
|
|
+ newdata.dictValue = item.dictValue;
|
|
|
+ Arr.push(newdata);
|
|
|
+ });
|
|
|
+ this.setData({
|
|
|
+ jobArr: Arr
|
|
|
+ })
|
|
|
+
|
|
|
+ },
|
|
|
+ fail: () => {
|
|
|
+ wx.hideLoading();
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ onReachBottom() {
|
|
|
+ console.log("下拉刷新");
|
|
|
+ var that = this;
|
|
|
+ if (that.data.classVis && that.data.stuInfo.list.length > 0) {
|
|
|
+ var page = that.data.pageNum;
|
|
|
+ page++;
|
|
|
+ that.setData({ pageNum: page });
|
|
|
+ wx.showLoading({
|
|
|
+ title: '加载更多',
|
|
|
+ })
|
|
|
+ that.studentList(this.data.pageNum).then(res => {
|
|
|
+ wx.hideLoading();
|
|
|
+
|
|
|
+ let oldList = that.data.stuInfo.list.slice();
|
|
|
+ let newInfo = Object.assign({}, that.data.stuInfo, res)
|
|
|
+ console.log("that.data.pageNum",that.data.pageNum);
|
|
|
+ console.log("res.pages:",res.pages);
|
|
|
+ if (that.data.pageNum <= res.pages) {
|
|
|
+ newInfo.list=oldList.concat(newInfo.list)
|
|
|
+ that.setData({
|
|
|
+ stuInfo:newInfo
|
|
|
+ });
|
|
|
+ }else{
|
|
|
+ wx.showToast({
|
|
|
+ title: '没有更多了',
|
|
|
+ })
|
|
|
+ }
|
|
|
+ console.log(res)
|
|
|
+
|
|
|
+ },()=>{
|
|
|
+ wx.hideLoading();
|
|
|
+ wx.showToast({
|
|
|
+ title: '加载失败',
|
|
|
+ })
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ },
|
|
|
+ // onReachBottom: function () {
|
|
|
+ // var that = this;
|
|
|
+ // console.log(that)
|
|
|
+ // var page = that.data.page
|
|
|
+ // page++;
|
|
|
+ // that.setData({
|
|
|
+ // page: page
|
|
|
+ // })
|
|
|
+ // // 显示加载图标
|
|
|
+ // wx.showLoading({
|
|
|
+ // title: '玩命加载中',
|
|
|
+ // })
|
|
|
+ // wx.request({
|
|
|
+ // url: '', //请求的接口地址
|
|
|
+ // data: {
|
|
|
+ // page: that.data.page, // 页数
|
|
|
+
|
|
|
+ // },
|
|
|
+ // header: {
|
|
|
+ // 'content-type': 'application/json'
|
|
|
+ // },
|
|
|
+
|
|
|
+ // method: 'GET',
|
|
|
+ // success: function (res) {
|
|
|
+ // console.log(res)
|
|
|
+ // var goods = that.data.grade.concat(res.data.data.list) //grade 为一进入页面请求完数据定义的集合
|
|
|
+ // if (res.data.data.list == '') {
|
|
|
+ // console.log(1)
|
|
|
+ // wx.showToast({
|
|
|
+ // title: '暂无更多',
|
|
|
+ // icon: 'none',
|
|
|
+ // })
|
|
|
+ // } else {
|
|
|
+ // that.setData({
|
|
|
+ // grade : goods,
|
|
|
+ // });
|
|
|
+ // }
|
|
|
+ // wx.hideLoading();
|
|
|
+
|
|
|
+ // },
|
|
|
+ // })
|
|
|
+ // },
|
|
|
async onShow() {
|
|
|
+ var that = this;
|
|
|
// wx.showLoading({
|
|
|
// title: '加载中',
|
|
|
// mask:true
|
|
@@ -1064,6 +1291,14 @@ Page({
|
|
|
this.setData({
|
|
|
sessionKey
|
|
|
});
|
|
|
- this.isRz(sessionKey)
|
|
|
+ await this.isRz(sessionKey)
|
|
|
+ that.getjob(sessionKey)
|
|
|
+ console.log(that.data.classVis);
|
|
|
+ this.studentList(this.data.pageNum).then((info) => {
|
|
|
+ this.setData({ stuInfo: info });
|
|
|
+ console.log(this.data.stuInfo)
|
|
|
+ })
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
})
|