|
@@ -3,7 +3,8 @@ const tools = require('../../utils/tools.js');
|
|
|
Page({
|
|
|
data: {
|
|
|
kcArr: [],
|
|
|
- showZhfk: true
|
|
|
+ showZhfk: true,
|
|
|
+ istask:false
|
|
|
},
|
|
|
// 跳转直播点播页面
|
|
|
goStudy(e) {
|
|
@@ -77,46 +78,84 @@ Page({
|
|
|
const hoursValue = hours % 60; //小时
|
|
|
return `${hoursValue}时${minutesValue}分${secondValue}秒`;
|
|
|
},
|
|
|
- // 综合反馈填写
|
|
|
- goWrite2() {
|
|
|
- if (this.data.istask3 == false) {
|
|
|
- wx.showModal({
|
|
|
- showCancel: false,
|
|
|
- content: "请按照任务顺序执行哦!"
|
|
|
- })
|
|
|
- return false
|
|
|
- }
|
|
|
- console.log(this.data.sessionKey, "dayin");
|
|
|
- console.log(this.data.classInfo.id);
|
|
|
+ checkTaskList(sessionKey) {
|
|
|
+ console.log(this.data.classInfo, "777777");
|
|
|
wx.request({
|
|
|
- url: app.globalData.publicUrl + '/wx/exam/quesExamList',
|
|
|
+ url: app.globalData.publicUrl + '/wx/exam/status',
|
|
|
method: "post",
|
|
|
data: {
|
|
|
- sessionKey: this.data.sessionKey,
|
|
|
- questSub: '1',
|
|
|
+ sessionKey: sessionKey,
|
|
|
clasId: this.data.id
|
|
|
},
|
|
|
success: (res) => {
|
|
|
- if (res.data.code == 0) {
|
|
|
- console.log(res.data, "zonghe");
|
|
|
- //let answersId = res.data.list[0].answersId ;
|
|
|
- console.log(res.data.list.length);
|
|
|
- if (res.data.list[0]) {
|
|
|
- if (res.data.list[0].answersId) {
|
|
|
- if (res.data.list[0].status == '1') {
|
|
|
+ console.log(res.data, "我是第四个任务的检查状态")
|
|
|
+ if (res.data.code == 0 && res.data.status == 1) {
|
|
|
+ this.setData({
|
|
|
+ istask: true
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ // 综合反馈填写
|
|
|
+ goWrite2() {
|
|
|
+ console.log(this.data.istask)
|
|
|
+ if (this.data.istask) {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/exam/quesExamList',
|
|
|
+ method: "post",
|
|
|
+ data: {
|
|
|
+ sessionKey: this.data.sessionKey,
|
|
|
+ questSub: '1',
|
|
|
+ clasId: this.data.id
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ if (res.data.list[0]) {
|
|
|
+ if (res.data.list[0].answersId) {
|
|
|
wx.navigateTo({
|
|
|
url: '/pages/feedBackDetail/feedBackDetail?answersId=' + res.data.list[0].answersId,
|
|
|
})
|
|
|
} else {
|
|
|
- this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'feedBack');
|
|
|
+ this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'feedBack');
|
|
|
}
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ wx.request({
|
|
|
+ url: app.globalData.publicUrl + '/wx/exam/quesExamList',
|
|
|
+ method: "post",
|
|
|
+ data: {
|
|
|
+ sessionKey: this.data.sessionKey,
|
|
|
+ questSub: '1',
|
|
|
+ clasId: this.data.id
|
|
|
+ },
|
|
|
+ success: (res) => {
|
|
|
+ if (res.data.code == 0) {
|
|
|
+ if (res.data.list.length == 0) {
|
|
|
+ wx.showModal({
|
|
|
+ showCancel: false,
|
|
|
+ content: '当前综合反馈还不可以填写哦!'
|
|
|
+ })
|
|
|
} else {
|
|
|
- this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'feedBack');
|
|
|
+ if (res.data.list[0].answersId) {
|
|
|
+ if (res.data.list[0].status == '1') {
|
|
|
+ wx.navigateTo({
|
|
|
+ url: '/pages/feedBackDetail/feedBackDetail?answersId=' + res.data.list[0].answersId,
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'feedBack');
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'feedBack');
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
- }
|
|
|
- })
|
|
|
+ })
|
|
|
+ }
|
|
|
},
|
|
|
toPath(id, paperId, answersId, address, status) {
|
|
|
wx.navigateTo({
|
|
@@ -146,6 +185,7 @@ Page({
|
|
|
})
|
|
|
},
|
|
|
async onLoad(options) {
|
|
|
+ console.log(options)
|
|
|
const sessionKey = await tools.checkSessionAndLogin();
|
|
|
this.setData({
|
|
|
sessionKey: sessionKey,
|
|
@@ -154,6 +194,7 @@ Page({
|
|
|
clasEnd: options.clasEnd
|
|
|
})
|
|
|
this.getArr(sessionKey);
|
|
|
+ this.checkTaskList(sessionKey)
|
|
|
let currrentTime = new Date().getTime()
|
|
|
let endTime = new Date(this.data.clasEnd).getTime()
|
|
|
let day = Math.floor((currrentTime - endTime) / 86400000);
|