roose 5 年之前
父節點
當前提交
a6b01a1db2
共有 1 個文件被更改,包括 56 次插入21 次删除
  1. 56 21
      pages/myMission/myMission.js

+ 56 - 21
pages/myMission/myMission.js

@@ -34,17 +34,8 @@ Page({
     });
   },
   gokhAnswer(e) {
-    if (this.data.istask2 == false) {
-      wx.showModal({
-        showCancel: false,
-        content: "请按照任务顺序执行哦!"
-      })
-      return false
-    }
-    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({
         showCancel: false,
@@ -53,8 +44,28 @@ Page({
       return false
     } else {
       if (isExam == 0) {
-        wx.navigateTo({
-          url: '../answerAfterclass/answerAfterclass'
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/exam/examList',
+          method: "post",
+          data: {
+            sessionKey: this.data.sessionKey,
+            courseId: e.currentTarget.dataset.item.id,
+            clasId: this.data.classInfo.id
+          },
+          success: (res) => {
+            if (res.data.code == 0) {
+              console.log(res.data);
+              //let answersId =  res.data.list[0].answersId ;
+              if (res.data.list[0]) {
+                if (res.data.list[0].answersId) {
+                  this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'answerAfterclass');
+                } else {
+                  console.log('777777');
+                  this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'answerAfterclass');
+                }
+              }
+            }
+          }
         })
       } else {
         wx.showModal({
@@ -63,17 +74,11 @@ Page({
         })
       }
     }
+    // console.log(e.currentTarget.dataset.courseid, "00");
+
 
   },
   gopjClass(e) {
-
-    if (this.data.istask2 == false) {
-      wx.showModal({
-        showCancel: false,
-        content: "请按照任务顺序执行哦!"
-      })
-      return false
-    }
     console.log(e.currentTarget.dataset.item, "8888")
     let isStudyDone = e.currentTarget.dataset.item.isStudyDone
     let isFeedback = e.currentTarget.dataset.item.isFeedback
@@ -85,8 +90,37 @@ Page({
       return false
     } else {
       if (isFeedback == 0) {
-        wx.navigateTo({
-          url: '../evaluationCourse/evaluationCourse'
+      console.log(e.currentTarget.dataset,"111111111111111");
+      console.log(this.data.classInfo.id,"0000000000000");
+        wx.request({
+          url: app.globalData.publicUrl + '/wx/exam/quesExamList',
+          method: "post",
+          data: {
+            sessionKey: this.data.sessionKey,
+            questSub: '3',
+            courseId: e.currentTarget.dataset.item.id,
+            clasId: this.data.classInfo.id
+          },
+          success: (res) => {
+            if (res.data.code == 0) {
+              console.log(res.data);
+              //let answersId =  res.data.list[0].answersId ;
+              if (res.data.list[0]) {
+                if (res.data.list[0].answersId) {
+                  if (res.data.list[0].status == '1') {
+                    wx.navigateTo({
+                      url: '/pages/evaluationCourseDetail/evaluationCourseDetail?answersId=' + res.data.list[0].answersId,
+                    })
+                  } else {
+                    this.toPath(res.data.list[0].id, res.data.list[0].paperId, res.data.list[0].answersId, 'evaluationCourse');
+                  }
+                } else {
+                  console.log('777777');
+                  this.beginKao(res.data.list[0].id, res.data.list[0].paperId, this.data.sessionKey, 'evaluationCourse');
+                }
+              }
+            }
+          }
         })
       } else {
         wx.showModal({
@@ -96,6 +130,7 @@ Page({
       }
     }
 
+
   },
   // startAnswer() {
   //   wx.navigateTo({