|
@@ -20,7 +20,8 @@ Page({
|
|
|
studentName: "",
|
|
|
classInfo: {},
|
|
|
byzsbj: "../../images/zsbj.jpg",
|
|
|
- myCanvasId: 0
|
|
|
+ myCanvasId: 0,
|
|
|
+ IngCourseArr: [] //如果有正在进行的课就存一下
|
|
|
},
|
|
|
selectBtn0() {
|
|
|
this.setData({
|
|
@@ -35,6 +36,7 @@ Page({
|
|
|
gokhAnswer(e) {
|
|
|
console.log(e.currentTarget.dataset.item, "8888")
|
|
|
let isStudyDone = e.currentTarget.dataset.item.isStudyDone
|
|
|
+ let isExam = e.currentTarget.dataset.item.isExam
|
|
|
// let courseName = e.currentTarget.dataset.item.courseName
|
|
|
if (isStudyDone != 1) {
|
|
|
wx.showModal({
|
|
@@ -42,25 +44,43 @@ Page({
|
|
|
content: "您的学习课程还未完成哦,请先完成学习任务后再来考试吧!"
|
|
|
})
|
|
|
return false
|
|
|
+ } else {
|
|
|
+ if (isExam == 0) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../answerAfterclass/answerAfterclass'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: "您已经考完试了!"
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- wx.navigateTo({
|
|
|
- url: '../answerAfterclass/answerAfterclass'
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
gopjClass(e) {
|
|
|
console.log(e.currentTarget.dataset.item, "8888")
|
|
|
let isStudyDone = e.currentTarget.dataset.item.isStudyDone
|
|
|
- // let courseName = e.currentTarget.dataset.item.courseName
|
|
|
+ let isFeedback = e.currentTarget.dataset.item.isFeedback
|
|
|
if (isStudyDone != 1) {
|
|
|
wx.showModal({
|
|
|
showCancel: false,
|
|
|
content: "您的学习课程还未完成哦,请先完成学习任务后再来评价吧!"
|
|
|
})
|
|
|
return false
|
|
|
+ } else {
|
|
|
+ if (isFeedback == 0) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../evaluationCourse/evaluationCourse'
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: "您已经评价过了!"
|
|
|
+ })
|
|
|
+ }
|
|
|
}
|
|
|
- wx.navigateTo({
|
|
|
- url: '../evaluationCourse/evaluationCourse'
|
|
|
- })
|
|
|
+
|
|
|
},
|
|
|
startAnswer() {
|
|
|
wx.navigateTo({
|
|
@@ -87,6 +107,7 @@ Page({
|
|
|
url: '../feedBack/feedBack'
|
|
|
})
|
|
|
},
|
|
|
+ // 领取结业证
|
|
|
lq() {
|
|
|
wx.showLoading({
|
|
|
mask: true,
|
|
@@ -126,6 +147,16 @@ Page({
|
|
|
showzs: true,
|
|
|
istask5: true
|
|
|
});
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/student/wxGraduation',
|
|
|
+ method: "post",
|
|
|
+ data: {
|
|
|
+ sessionKey: this.data.sessionKey
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res.data, "领取结业证提交")
|
|
|
+ }
|
|
|
+ })
|
|
|
},
|
|
|
saveZs() {
|
|
|
wx.canvasToTempFilePath({ //把当前画布指定区域的内容导出生成指定大小的图片
|
|
@@ -150,27 +181,53 @@ Page({
|
|
|
},
|
|
|
// 点击去学习转直播点播页面
|
|
|
goStudy(e) {
|
|
|
-
|
|
|
- console.log(e.currentTarget.dataset.item, "8888")
|
|
|
- console.log(this.data.kcArr,"我是所有的列表 我要过滤")
|
|
|
- // let id = e.currentTarget.dataset.item.id
|
|
|
- // if (e.currentTarget.dataset.item.isLive == 1) {
|
|
|
- // if (e.currentTarget.dataset.item.isActive == 1) {
|
|
|
- // wx.navigateTo({
|
|
|
- // url: '../zbDetails/zbDetails?id=' + id
|
|
|
- // })
|
|
|
- // } else {
|
|
|
- // wx.showModal({
|
|
|
- // showCancel: false,
|
|
|
- // content: "直播还未开始哦",
|
|
|
- // success(res) {}
|
|
|
- // })
|
|
|
- // }
|
|
|
- // } else {
|
|
|
- // wx.navigateTo({
|
|
|
- // url: '../dbDetails/dbDetails?id=' + id
|
|
|
- // })
|
|
|
- // }
|
|
|
+ let id = e.currentTarget.dataset.item.id //此课程的id
|
|
|
+ console.log(id)
|
|
|
+ console.log(this.data.IngCourseArr, "我是筛选的列表")
|
|
|
+ if (this.data.IngCourseArr.length == 0) {
|
|
|
+ if (e.currentTarget.dataset.item.isLive == 1) {
|
|
|
+ if (e.currentTarget.dataset.item.isActive == 1) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../zbDetails/zbDetails?id=' + id
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: "直播还未开始哦"
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../dbDetails/dbDetails?id=' + id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (id == this.data.IngCourseArr.id) {
|
|
|
+ if (e.currentTarget.dataset.item.isLive == 1) {
|
|
|
+ if (e.currentTarget.dataset.item.isActive == 1) {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../zbDetails/zbDetails?id=' + id
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: "直播还未开始哦"
|
|
|
+ })
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '../dbDetails/dbDetails?id=' + id
|
|
|
+ })
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: "您有未完成的学习课程,请先完成学习任务后再进行其他课程学习!"
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
},
|
|
|
// 获取我的课表
|
|
|
getMycourse(sessionKey) {
|
|
@@ -187,6 +244,15 @@ Page({
|
|
|
kcArr: res.data.list,
|
|
|
istask3: res.data.allDone
|
|
|
});
|
|
|
+ // 过滤数组
|
|
|
+ for (let i = 0; i < res.data.list.length; i++) {
|
|
|
+ if (res.data.list[i].isStudyDone == 0) {
|
|
|
+ this.setData({
|
|
|
+ IngCourseArr: res.data.list[i]
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // 换算时间
|
|
|
let result = [];
|
|
|
if (res.data.list)
|
|
|
for (let i = 0; i < res.data.list.length; i++) {
|
|
@@ -240,9 +306,9 @@ Page({
|
|
|
sessionKey: sessionKey
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- console.log(res.data, "wwwwww")
|
|
|
+ console.log(res.data, "检查第一个任务")
|
|
|
if (res.data.code == 0) {
|
|
|
- if (res.data.data.remark == 1) {
|
|
|
+ if (res.data.data.joinClas == 0) {
|
|
|
this.setData({
|
|
|
istask1: true
|
|
|
})
|
|
@@ -257,16 +323,16 @@ Page({
|
|
|
// 检查第二个任务 学院登记表
|
|
|
checkTaskList2(sessionKey) {
|
|
|
wx.request({
|
|
|
- url: app.globalData.publicUrl + '/wx/exam/status',
|
|
|
+ url: app.globalData.publicUrl + '/wx/student/selStudentSessionKey',
|
|
|
method: "post",
|
|
|
data: {
|
|
|
sessionKey: sessionKey
|
|
|
},
|
|
|
success: (res) => {
|
|
|
console.log(res.data, "我是第二个任务的检查状态")
|
|
|
- if (res.data.code == 0 && res.data.status == 0) {
|
|
|
+ if (res.data.code == 0 && res.data.data.register == 0) {
|
|
|
this.setData({
|
|
|
- istask4: true
|
|
|
+ istask2: true
|
|
|
})
|
|
|
}
|
|
|
}
|
|
@@ -290,6 +356,23 @@ Page({
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ checkTaskList5(sessionKey) {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/student/wxGraduation',
|
|
|
+ method: "post",
|
|
|
+ data: {
|
|
|
+ sessionKey: sessionKey
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ console.log(res.data, "我是第五个任务的检查状态")
|
|
|
+ if (res.data.code == 0 && res.data.code == 0) {
|
|
|
+ this.setData({
|
|
|
+ istask5: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 查询我是否有班&&班级名字
|
|
|
isClass(sessionKey) {
|
|
|
wx.request({
|
|
@@ -456,11 +539,15 @@ Page({
|
|
|
},
|
|
|
async onShow() {
|
|
|
const sessionKey = await tools.checkSessionAndLogin();
|
|
|
+ this.setData({
|
|
|
+ sessionKey
|
|
|
+ })
|
|
|
this.checkTaskList(sessionKey)
|
|
|
this.isClass(sessionKey);
|
|
|
this.getMycourse(sessionKey);
|
|
|
this.checkTaskList2(sessionKey)
|
|
|
this.checkTaskList4(sessionKey)
|
|
|
+ this.checkTaskList5(sessionKey)
|
|
|
// this.canvasImg();
|
|
|
// this.getbyzsText();
|
|
|
}
|