ssfg 5 år sedan
förälder
incheckning
dbacd571f4
2 ändrade filer med 70 tillägg och 28 borttagningar
  1. 67 26
      pages/historyClass/historyClass.js
  2. 3 2
      pages/historyClass/historyClass.wxml

+ 67 - 26
pages/historyClass/historyClass.js

@@ -3,7 +3,8 @@ const tools = require('../../utils/tools.js');
 Page({
 Page({
   data: {
   data: {
     kcArr: [],
     kcArr: [],
-    showZhfk: true
+    showZhfk: true,
+    istask:false
   },
   },
   // 跳转直播点播页面
   // 跳转直播点播页面
   goStudy(e) {
   goStudy(e) {
@@ -77,46 +78,84 @@ Page({
     const hoursValue = hours % 60; //小时
     const hoursValue = hours % 60; //小时
     return `${hoursValue}时${minutesValue}分${secondValue}秒`;
     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({
     wx.request({
-      url: app.globalData.publicUrl + '/wx/exam/quesExamList',
+      url: app.globalData.publicUrl + '/wx/exam/status',
       method: "post",
       method: "post",
       data: {
       data: {
-        sessionKey: this.data.sessionKey,
-        questSub: '1',
+        sessionKey: sessionKey,
         clasId: this.data.id
         clasId: this.data.id
       },
       },
       success: (res) => {
       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({
                 wx.navigateTo({
                   url: '/pages/feedBackDetail/feedBackDetail?answersId=' + res.data.list[0].answersId,
                   url: '/pages/feedBackDetail/feedBackDetail?answersId=' + res.data.list[0].answersId,
                 })
                 })
               } else {
               } 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 {
             } 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) {
   toPath(id, paperId, answersId, address, status) {
     wx.navigateTo({
     wx.navigateTo({
@@ -146,6 +185,7 @@ Page({
     })
     })
   },
   },
   async onLoad(options) {
   async onLoad(options) {
+    console.log(options)
     const sessionKey = await tools.checkSessionAndLogin();
     const sessionKey = await tools.checkSessionAndLogin();
     this.setData({
     this.setData({
       sessionKey: sessionKey,
       sessionKey: sessionKey,
@@ -154,6 +194,7 @@ Page({
       clasEnd: options.clasEnd
       clasEnd: options.clasEnd
     })
     })
     this.getArr(sessionKey);
     this.getArr(sessionKey);
+    this.checkTaskList(sessionKey)
     let currrentTime = new Date().getTime()
     let currrentTime = new Date().getTime()
     let endTime = new Date(this.data.clasEnd).getTime()
     let endTime = new Date(this.data.clasEnd).getTime()
     let day = Math.floor((currrentTime - endTime) / 86400000);
     let day = Math.floor((currrentTime - endTime) / 86400000);

+ 3 - 2
pages/historyClass/historyClass.wxml

@@ -3,7 +3,7 @@
 		<text>{{name}}</text>
 		<text>{{name}}</text>
 	</van-divider>
 	</van-divider>
 	<view class="sp {{idx>2 ? 'none' : ''}}" wx:for="{{kcArr}}" wx:for-index="idx" wx:for-item="item">
 	<view class="sp {{idx>2 ? 'none' : ''}}" wx:for="{{kcArr}}" wx:for-index="idx" wx:for-item="item">
-		<image src='{{item.courseImg}}' mode="widthFix" class="spfm"></image>
+		<image src='{{item.courseImg}}' mode="aspectFill" class="spfm"></image>
 		<view class="sp_text">
 		<view class="sp_text">
 			<view class="fisrt_set">
 			<view class="fisrt_set">
 				<image src='/images/db.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==-1}}'></image>
 				<image src='/images/db.png' mode='aspectFill' class="dbimg" wx:if='{{item.isLive==-1}}'></image>
@@ -22,6 +22,7 @@
 	<view class="layout" style="margin-top:40rpx" bindtap="goWrite2" wx:if='{{showZhfk}}'>
 	<view class="layout" style="margin-top:40rpx" bindtap="goWrite2" wx:if='{{showZhfk}}'>
 		<image src='/images/zhfk_bj.png' mode='aspectFill' class="bgimg1"></image>
 		<image src='/images/zhfk_bj.png' mode='aspectFill' class="bgimg1"></image>
 		<view class="layout_text1">综合反馈表</view>
 		<view class="layout_text1">综合反馈表</view>
-		<view class="layout_text3">去填写</view>
+		<view class="layout_text3" wx:if='{{istask}}'>查看详情</view>
+		<view class="layout_text3" wx:else>去填写</view>
 	</view>
 	</view>
 </view>
 </view>